Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 106

Advertising
background image

Chapter 6

Using the Ethernet Interface

6-25

#include ”dtl.h”

#define HOSTNAME ”copro2”

#define NI_ID 1

unsigned char pccc_color[] = {

0x12, /* DST - copro station address */

0x05, /* CTRL - packet type must be 5 for Interchange */

0x00, /* SRC - Source station filled in by NI */

0x00, /* LSAP - Set to 0 for local network */

0x0f, /* CMD - command for typed write */

0x00, /* STS - status byte */

0x01, 0x00, /* TNSW - L/H Transaction status word */

0x67, /* FNC - typed write function */

0x06, 0x00, /* OFF - Offset L/H to requested data 6 bytes */

0x01, 0x00, /* TT - Total transaction L/H 1 item */

0x00, ’C’,’a’,’r’,0x00, /* Symbolic address (TAG) */

0x91, /* Type in next byte, size of 1 byte */

0x22, /* Undefined type */

0x99}; /* Data to be transmitted */

unsigned char pccc_col_year[] = {

0x12, /* DST - copro station address */

0x05, /* CTRL - packet type must be 5 for Interchange */

0x00, /* SRC - Source station filled in by NI */

0x00, /* LSAP - Set to 0 for local network */

0x0f, /* CMD - command for typed write */

0x00, /* STS - status byte */

0x02, 0x00, /* TNSW - L/H Transaction status word */

0x67, /* FNC - typed write function */

0x06, 0x00, /* OFF - Offset L/H to requested data 6 bytes */

0x06, 0x00, /* TT - Total transaction L/H 6 items */

0x00, ’C’,’a’,’r’,0x00, /* Symbolic address (TAG) */

0x99, /* Type in next byte, size in following byte */

0x09, /* Type is array */

0x03, /* of 8 bytes */

0x91, /* Type in next byte, size of 1 byte */

0x22, /* Undefined type */

0x88, 0xff, 0x00, 0x00, 0x00, 0x00}; /* Data to be transmitted */

unsigned char pccc_read[] = {

0x12, /* DST - copro station address */

0x05, /* CTRL - packet type must be 5 for Interchange */

0x00, /* SRC - Source station filled in by NI */

0x00, /* LSAP - Set to 0 for local network */

0x0f, /* CMD - command for typed read */

0x00, /* STS - status byte */

0x03, 0x00, /* TNSW - L/H Transaction status word */

0x68, /* FNC - typed read function */

0x00, 0x00, /* OFF - Offset L/H to requested data 0 bytes */

0x0C, 0x00, /* TT - Total transaction L/H 12 items */

0x00, ’C’,’a’,’r’,0x00, /* Symbolic address (TAG) */

0x0C, 0x00}; /* SIZ - Size L/H same as TT 12 items */

Advertising