User manual

Appendix
A
Sample
Applications
A-13
/***************************************************************************/
/***************************** DISPLAY_STATUS ******************************/
/***************************************************************************/
void display_status(PLC540V_STATUS_TYPE *status)
{
// This function determines if the status was an error. If so, it will
// display a specific error type to the screen. Three areas can create
// errors: The PLC–5/VME Processor, the EPC Driver or PCCC commands.
char buf[80+1];
if (status–>plc540vStatus != 0)
{
cprintf(”\7\7\7”);
switch(status–>statusCategory)
{
case kPLC540V_STATUS:
sprintf(buf, ”%s: 0x%04x”, status–>plc540vStatus);
show_error(buf);
break;
case kEPC_STATUS:
sprintf(buf, ”%s: %04d”, status–>epcStatus);
show_error(buf);
break;
case kPCCC_STATUS:
sprintf(buf, ”%s: 0x%04x”, status–>pcccStatus.value);
show_error(buf);
break;
default:
show_error(”Unknown error!”);
}
}
}
.AUTODEPEND
# *Translator Definitions*
CC = bcc +VMEDEMO.CFG
TASM = TASM
TLIB = tlib
TLINK = tlink
LIBPATH = C:\BORLANDC\LIB
INCLUDEPATH = C:\BORLANDC\INCLUDE
# *Implicit Rules*
.c.obj:
$(CC) –c {$< }
.cpp.obj:
$(CC) –c {$< }
# *List Macros*
VMEDEMO.MAK