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

Page 177

Advertising
background image

Sample API Modules

Appendix B

B-19

/***************************************************************************/
/************************* PRIVATE TYPE DEFINITIONS ************************/
/***************************************************************************/
typedef enum
{

kPLC540V_CONT_COPY_TO_VME=0x0001,
kPLC540V_CONT_COPY_FROM_VME=0x0002,

} PLC540V_CONT_COPY_COMMAND;

typedef enum
{

kPLC540V_CONT_COPY_DISABLE=0x0,
kPLC540V_CONT_COPY_ENABLE=0x1,

} PLC540V_CONT_COPY_MODE;

/***************************************************************************/
/*************************** PRIVATE FUNCTIONS *****************************/
/***************************************************************************/
void plc540v_cont_copy(PLC540V_CONT_COPY_COMMAND ccCmd,

PLC540V_CONT_COPY_MODE ccMode,
ULONG vmeDataAddr,
UWORD vmeDataSize,
ULONG vmeCmdBlkAddr,
UWORD baseAddress,
VME_DATA_WIDTH_TYPE width,
VME_ADDRESS_MODIFIER_TYPE addrMod,
UWORD fileNumber,
UWORD elementNumber,
VME_INTERRUPT_LEVEL_TYPE cmdIntLevel,
UBYTE cmdStatusId,
VME_INTERRUPT_LEVEL_TYPE operationIntLevel,
UBYTE operationStatusId,
PLC540V_STATUS_TYPE *status);

/*****************************************************************************
*
* PURPOSE: This function configures the PLC–5/40V to continuously copy
* processor file memory to VME memory once per scan cycle in
* the processor.
*
* INPUT: ULONG vmeDataAddr contains the VME address where the
* processor file memory will be written into.
*
* UWORD vmeDataSize contains the number of 16 bit words which
* will be written.
*
* ULONG vmeCmdBlkAddr contains the VME address where the
* command block will be copied to so the PLC–5/40V can
* access its information.
*
* UWORD baseAddress contains the base address of the
* PLC–5/40V.
*
* VME_DATA_WIDTH_TYPE width contains the data width that
* should be used for the copy operations. It can be D16
* or D08.
*
* VME_ADDRESS_MODIFIER_TYPE addrMod defines the address space
* in which the VME data is accessed. It can be A16 or A24.
*
* UWORD fileNumber contains the PLC–5/40V data file number
* which will be continuously read from for the data transfer.
*

Advertising