Appendix b – Rockwell Automation 1785-Vx0B, D17856.5.9 PLC-5 VME VMEbus Programmable Controllers User Manual User Manual
Page 189
![background image](/manuals/579929/189/background.png)
Sample API Modules
Appendix B
B-31
/*
**
** Structure of the Send PCCC Command Block. This is used to communicate
** any PCCC command to the PLC.
*/
#pragma pack(1)
typedef struct
{
unsigned short commandWord; /* 0 : command word */
unsigned short responseWord; /* 1 : command response */
unsigned short interruptLevel; /* 2 : completion intr */
unsigned short interruptStatusID; /* 3 : completion statid */
unsigned short reserved0[3]; /* 4-6 : unused */
unsigned short transfer_info; /* 7 : xfer parameters */
unsigned short packetAddrHigh; /* 8 : packet address hi */
unsigned short packetAddrLow; /* 9 : packet address lo */
unsigned short packetSize; /* 10 : packet size */
unsigned short reserved2[4]; /* 11-14 : unused */
unsigned short reserved1; /* 15 : unused */
}PCCC_SEND_CMD_TYPE;
/*
**
** Structure of Command Packet. This packet contains command specific
** information which is attached to a PCCC_SEND_CMD_TYPE.
*/
typedef struct
{
unsigned char dstCmdPkt;
/* Reserved */
unsigned char
psn1CmdPkt;
/* Reserved */
unsigned char
srcCmdPkt;
/* Reserved */
unsigned char psn2CmdPkt;
/* Reserved */
unsigned char command; /* packet command */
unsigned char sts;
/* Reserved */
unsigned short tns;
unsigned char functionCode; /* extended function code */
unsigned char optionalData[243]; /* packet data */
}PCCC_CMD_PKT_TYPE;
/*
**
** Structure of Reply Packet
**
*/
typedef struct
{
unsigned char lnhFirstByte; /* reply packet length high */
unsigned char lnhSecondByte; /* reply packet length low */
unsigned char
dstRpyPkt;
/* Reserved */
unsigned char psn1RpyPkt;
/* Reserved */
unsigned char srcRpyPkt;
/* Reserved */
unsigned char psn2RpyPkt;
/* Reserved */
unsigned char command; /* packet command */
unsigned char remoteError; /* packet return code */
unsigned short tns;
/* sequence number */
unsigned char extSts; /* extended status */
unsigned char optionalData[243]; /* packet data */
}PCCC_RPY_PKT_ES_TYPE;