beautypg.com

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

Page 131

background image

Appendix A

Sample Applications

A-9

plcList[0] = mem.baseAddr;

// Turn on the memory on the PLC at the requested VME location.
plc540v_enable_shared_memory(plcList[0], mem.vmeSlaveAddr, &status);

display_status(&status);
}

/***************************************************************************/
/*********************** TEST_DISABLE_SLAVE_MEMORY ************************/
/***************************************************************************/
void test_disable_slave_memory(void)
{
// Disable the VME memory on a PLC–5/VME processor.

// Status info
PLC540V_STATUS_TYPE status;

// A list of PLC’s in the VME chassis. This is a list of 1.
LOCATED_PLC540V_ARRAY_TYPE plcList;

// Verify that they have already enabled the VME memory
if (mem.isInitialized == 0)
{

show_error(”You must first enable the PLC slave memory.”);
return;

}

memset((char *) &plcList, 0x0, sizeof(LOCATED_PLC540V_ARRAY_TYPE));
plcList[0] = mem.baseAddr;

// Turn off the memory.
plc540v_disable_shared_memory(plcList[0], mem.vmeSlaveAddr, &status);

display_status(&status);
}

/***************************************************************************/
/************************ TEST_INIT_CC_TO_VME ******************************/
/***************************************************************************/
void test_init_cc_to_vme(void)
{
// Initiate a continuous copy from a PLC data file to VME memory.

// Status information
PLC540V_STATUS_TYPE status;

memset((char *) &cc_to, 0x0, sizeof(CC_TYPE));
cc_to.isInitialized = 1;