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

Page 153

Advertising
background image

Appendix A

Sample Applications

A-31

plc540v_pccc_get_edit_resource(kvmeSlaveAddress,

kplc540vUla,
kVME_D16_DATA_WIDTH,
kVME_A24_ADDR_SPACE,
&replyPacket,
&status);

if(status.plc540vStatus != 0)
{

printf(”\nGetting the edit resource failed.”);
exit(1);

}
}

/***************************************************************************/
/************************* RETURN_EDIT_RESOURCE ****************************/
/***************************************************************************/
void return_edit_resource(void)
{
// This function will attempt to return the edit resource to the
// processor

PLC540V_PCCC_RER_RPY_TYPE replyPacket;
PLC540V_STATUS_TYPE status;

plc540v_pccc_return_edit_resource(kvmeSlaveAddress,

kplc540vUla,
kVME_D16_DATA_WIDTH,
kVME_A24_ADDR_SPACE,
&replyPacket,
&status);

if(status.plc540vStatus != 0)
{

printf(”\nReturning the edit resource failed.”);
exit(1);

}
}

/***************************************************************************/
/************************ APPLY_PORT_CONFIGURATION *************************/
/***************************************************************************/
void apply_port_configuration(void)
{
// This function will make certain that the port configuration
// information FOR ALL THE CHANNELS is restored when a physical restore
// is performed.

PLC540V_PCCC_APC_RPY_TYPE replyPacket;
PLC540V_STATUS_TYPE status;

plc540v_pccc_apply_port_config(kvmeSlaveAddress,

kplc540vUla,
kVME_D16_DATA_WIDTH,
kVME_A24_ADDR_SPACE,
&replyPacket,
&status);

if(status.plc540vStatus != 0)
{

printf(”\nApplying port configurations failed.”);
exit(1);

}
}

Advertising