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

Page 141

Advertising
background image

Appendix A

Sample Applications

A-19

printf(”\n\nFinal Address: 0x%08.8lx”,
readAddr + finalPhysicalReadSize);

}

// Close the output file
fclose(out);

// Upload Complete command.
upload_is_complete();

// Return the edit resource to the processor.
return_edit_resource();

printf(”\n\nUpload was successfully completed.”);

return 0;

}

/***************************************************************************/
/*************************** PRIVATE FUNCTIONS *****************************/
/***************************************************************************/

/***************************************************************************/
/*************************** GET_EDIT_RESOURCE *****************************/
/***************************************************************************/
void get_edit_resource(void)
{
// This function will ask the processor for the edit resource.

PLC540V_PCCC_GER_RPY_TYPE replyPacket;
PLC540V_STATUS_TYPE status;

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;

Advertising