Appendix b – Rockwell Automation 1785-Vx0B, D17856.5.9 PLC-5 VME VMEbus Programmable Controllers User Manual User Manual

Page 162

Advertising
background image

Sample API Modules

Appendix B

B-4

typedef struct
{
/* Indicates which type of error status is being returned. There are
three sources: EPC, PCCC or this library of routines.
*/
STATUS_CATEGORY_TYPE statusCategory;

/* EPC Status Code */
int epcStatus;

/* PCCC Status Code */
PCCC_STATUS_FIELDS_TYPE pcccStatus;

/* PLC540V Library Status Codes */
PLC540V_LIBRARY_STATUS_TYPE plc540vStatus;
} PLC540V_STATUS_TYPE;

// Register offsets in the PLC-5/40V
typedef enum
{
kPLC540V_ID_REG=0x0,
kPLC540V_DT_REG=0x2,
kPLC540V_SC_REG=0x4,
kPLC540V_OF_REG=0x6,
kPLC540V_CC_REG=0x8,
kPLC540V_CCL_REG=0xA,
kPLC540V_CH_REG=0xC,
kPLC540V_CL_REG=0xE,
} PLC540V_REGISTER_TYPE;

// PLC-5/40V VME interrupt levels
typedef enum
{
kVME_NO_INT_LEVEL= 0x0,
kVME_INT_LEVEL_1 = 0x1,
kVME_INT_LEVEL_2 = 0x2,
kVME_INT_LEVEL_3 = 0x3,
kVME_INT_LEVEL_4 = 0x4,
kVME_INT_LEVEL_5 = 0x5,
kVME_INT_LEVEL_6 = 0x6,
kVME_INT_LEVEL_7 = 0x7,
} VME_INTERRUPT_LEVEL_TYPE;

/* An array to hold the base address of each PLC-5/40V in VME space. */
/* The maximum number of installed PLC-5/40V’s permitted */
#define kINSTALLED_PLC540V_LIMIT 8
typedef ULONG LOCATED_PLC540V_ARRAY_TYPE[kINSTALLED_PLC540V_LIMIT];

// Types of VME address modifiers supported by the PLC-5/40V
typedef enum
{
kVME_A16_ADDR_SPACE=0x2d,
kVME_A24_ADDR_SPACE=0x3d,
} VME_ADDRESS_MODIFIER_TYPE;

// Standard VME data widths supported by the PLC-5/40V processor
typedef enum
{
kVME_D16_DATA_WIDTH=0,
kVME_D08_DATA_WIDTH=1,
} VME_DATA_WIDTH_TYPE;
#pragma pack()

Advertising