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

Page 133

Advertising
background image

Appendix A

Sample Applications

A-11

// Stop the continuous copy opeation...
plc540v_halt_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_INIT_CC_FROM_VME *****************************/
/***************************************************************************/
void test_init_cc_from_vme(void)
{
// Initiate a continuous copy to a PLC data file from VME memory.

// Status information
PLC540V_STATUS_TYPE status;

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

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

Advertising