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

Page 237

Advertising
background image

Sample API Modules

Appendix B

B-79

* PLC540V_RMW_ADDRMASKS_TYPE addrMasks contains system
* addresses and their corresponding AND and OR masks.
* This structure MUST be initialized by calling
* plc540v_init_addrmasks() and each system address must
* be added to this data structure by calling the
* plc540v_add_addrmasks() function before using this function.
*
* PLC540V_PCCC_RMW_RPY_TYPE reply contains PCCC’s RMW command
* specific reply packet.
*
* OUTPUT: PLC540V_STATUS_TYPE *status will contain the final status
* of requesting this function. This status could be and EPC
* or PLC-5/40V value.
*
* RETURNS: Nothing.
*
* EXAMPLE:
* ULONG vmeCmdBlkAddr = 0xE0F100;
* UWORD baseAddress = 0XFC00;
* VME_DATA_WIDTH_TYPE width = kVME_D16_DATA_WIDTH;
* VME_ADDRESS_MODIFIER_TYPE addrMod = kVME_A24_ADDR_SPACE;
* PLC540V_PCCC_RMW_RPY_TYPE reply;
* PLC540V_STATUS_TYPE status;
* PLC540V_RMW_ADDRMASKS_TYPE addrMasks;
* register int addrCount = 0;
* UWORD fileNumber = 7;
* UWORD elementNumber = 20;
* UWORD andMask = 0xFF00;
* UWORD orMask = 0x00AA;
* plc540v_init_addrmasks(addrMasks);
* for (addrCount=0; addrCount<5; addrCount++,elementNumber++)
* {
* plc540v_add_addrmasks(addrCount,
* fileNumber,
* elementNumber,
* andMask,
* orMask,
* addrMasks,
* &status);
* }
* plc540v_pccc_rmw(
* vmeCmdBlkAddr,
* baseAddress,
* width,
* addrMod,
* addrMasks,
* &reply,
* &status);
*
* Copyright Allen-Bradley Company, Inc. 1993
*
****************************************************************************/
void plc540v_pccc_rmw(

ULONG vmeCmdBlkAddr,
UWORD baseAddress,
VME_DATA_WIDTH_TYPE width,
VME_ADDRESS_MODIFIER_TYPE addrMod,
PLC540V_RMW_ADDRMASKS_TYPE addrMasks,
PLC540V_PCCC_RMW_RPY_TYPE *reply,
PLC540V_STATUS_TYPE *status)

{
/* The RMW command packet. */
PLC540V_PCCC_RMW_CMD_TYPE cmdPacket;

Advertising