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

Page 132

Advertising
background image

Appendix A

Sample Applications

A-10

// Get the continuous copy information from the user.
clrscr();
gotoxy(0, 10);
cprintf(
”Enter the VME command block address in hex (for the A24 addr space): ”);
scanf(”%lx”, &cc_to.vmeCmdBlkAddr);
gotoxy(0, 11);
cprintf(”Enter the base address for the PLC–5/40V in hex: ”);
scanf(”%x”, &cc_to.baseAddr);
gotoxy(0, 12);
cprintf(”Enter the VME data address in hex (for the A24 addr space): ”);
scanf(”%lx”, &cc_to.vmeDataAddr);
gotoxy(0, 13);
cprintf(”Enter the file number to be copied from: ”);
scanf(”%d”, &cc_to.fileNumber);
gotoxy(0, 14);
cprintf(”Enter the element number to be copied from: ”);
scanf(”%d”, &cc_to.elementNumber);
gotoxy(0, 15);
cprintf(”Enter the number of words to be copied: ”);
scanf(”%d”, &cc_to.wordCount);

// Start the continuous copy operation...
plc540v_init_cont_copy_to_VME(

cc_to.vmeDataAddr,
cc_to.wordCount,
cc_to.vmeCmdBlkAddr,
cc_to.baseAddr,
kVME_D16_DATA_WIDTH,
kVME_A24_ADDR_SPACE,
cc_to.fileNumber,
cc_to.elementNumber,
kVME_NO_INT_LEVEL,
0,
kVME_NO_INT_LEVEL,
0,
&status);

display_status(&status);
}

/***************************************************************************/
/************************* TEST_HALT_CC_TO_VME *****************************/
/***************************************************************************/
void test_halt_cc_to_vme(void)
{
// Disables the previous started continuous copy from a PLC data file to
// VME memory.

// Status information
PLC540V_STATUS_TYPE status;

// Verify that a continuous copy operation has been initialized.
if (cc_to.isInitialized == 0)
{

show_error(”You must first initialize continuous copy to VME.”);
return;

}

Advertising