Appendix a – Rockwell Automation 1785-Vx0B, D17856.5.9 PLC-5 VME VMEbus Programmable Controllers User Manual User Manual
Page 126
![background image](/manuals/579929/126/background.png)
Appendix A
Sample Applications
A-4
// Goodbye
clrscr();
gotoxy(0, 0);
return(0);
}
/***************************************************************************/
/*************************** PRIVATE FUNCTIONS *****************************/
/***************************************************************************/
/***************************************************************************/
/********************************** GO ************************************/
/***************************************************************************/
void go(void)
{
// This function will continuously process the user’s menu selections
// Current menu selection
int menuChoice = 0;
// Current status of a PLC–5/VME operation
PLC540V_STATUS_TYPE status;
// Main menu title line
static char *abTitle =
”*************************** Allen–Bradley’s VME Demo *************************”;
while(menuChoice != 100)
{
/* Let’s show the centered title on the first line. */
clrscr();
highvideo();
gotoxy(1, 1);
cprintf(abTitle);
normvideo();
/* Present the menu to the user. */
gotoxy(20, 3); cprintf(”1) Initiate continuous copy to VME.”);
gotoxy(20, 4); cprintf(”2) Halt continuous copy to VME.”);
gotoxy(20, 5); cprintf(”3) Initiate continuous copy from VME.”);
gotoxy(20, 6); cprintf(”4) Halt continuous copy from VME.”);
gotoxy(20, 7); cprintf(”5) Enable the PLC’s slave memory.”);
gotoxy(20, 8); cprintf(”6) Disable the PLC’s slave memory.”);
gotoxy(20, 9); cprintf(”7) Initiate EPC to PLC global memory test.”);
gotoxy(20, 10);cprintf(”8) Do the PCCC id host & status test.”);
gotoxy(20, 11);cprintf(”100) EXIT”);
highvideo();
gotoxy(20, 20);cprintf(” Enter a menu number:”);
gotoxy(46, 20);
normvideo();
// Get the user’s selection
scanf(”%d”, &menuChoice);