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

Page 125

Advertising
background image

Appendix A

Sample Applications

A-3

/***************************************************************************/
/********************* PRIVATE FUNCTIONS DEFINITIONS ***********************/
/***************************************************************************/
void display_status(PLC540V_STATUS_TYPE *status);
void test_init_cc_to_vme(void);
void test_halt_cc_to_vme(void);
void test_init_cc_from_vme(void);
void test_halt_cc_from_vme(void);
void test_disable_slave_memory(void);
void test_enable_slave_memory(void);
void test_epc_to_plc_global_memory(void);
void show_error(char *str);
void test_pccc_id(void);
char *get_key_mode(int keyMode);
void go(void);

/***************************************************************************/
/******************************* MAINLINE **********************************/
/***************************************************************************/

/*****************************************************************************
*
* PURPOSE: This is the main function for the general VME demonstration
* program. This program implements a main menu to ”test drive”
*

various PLC–5/VME and Radisys functions.

*
* INPUT: None.
*
* OUTPUT: None
*
* RETURNS: This program will return 1 to the DOS shell if there is an
* error and 0 if the program completed normally.
*
* EXAMPLE:
* vmedemo <CR>
*
* where:
* <CR> is a carrage return
*
* BUILD ENVIRONENT:
*

Borland C++ 3.0 compiler

*

Use the VMEDEMO.MAK makefile to build the executable.

*
*
* EDIT HISTORY:
*
* Copyright Allen–Bradley Company, Inc. 1994
*
****************************************************************************/
main()
{
// Let’s clear the screen
clrscr();

// Verify that the Radisys VME driver is present
if (EpcCkBm() != EPC_SUCCESS)
{

show_error(”Fatal Error: Bus manager not installed.”);
exit(1);

}

// Let’s process menu selections...
go();

Advertising