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

Page 142

Advertising
background image

Appendix A

Sample Applications

A-20

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);

}
}

/***************************************************************************/
/*********************** RESTORE_PORT_CONFIGURATION ************************/
/***************************************************************************/
void restore_port_configuration(void)
{
// This function will make certain that the current port configuration
// information FOR ALL THE CHANNELS is saved when a physical save is
// performed.

PLC540V_PCCC_RPC_RPY_TYPE replyPacket;
PLC540V_STATUS_TYPE status;

plc540v_pccc_restore_port_config(kvmeSlaveAddress,

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

if(status.plc540vStatus != 0)
{

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

}
}

/***************************************************************************/
/********************** PLC_IN_REMOTE_PROGRAM_MODE *************************/
/***************************************************************************/
void plc_in_remote_program_mode(void)
{
PLC540V_PCCC_IHAS_RPY_TYPE replyPacket;
PLC540V_PCCC_SCM_RPY_TYPE scmReplyPacket;
PLC540V_STATUS_TYPE status;
PLC540V_PCCC_SCM_CTLMODE_TYPE ctlMode;

ctlMode.modeSelect=kPLC540V_SCM_PROGRAM_LOAD_MODE;

plc540v_pccc_id_host_and_status(kvmeSlaveAddress,

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

if (status.plc540vStatus != 0)
{

printf(”\nGetting the PLC’s keyswitch mode failed.”);
exit(1);

}

Advertising