user manual

Page 46
Sample Interface Program in C
#include <stdio.h> // MSC Standard I/O
#include <com.h> // C Run-Time Interrupt Driven Comm
#include <vdsp.h> // C Run-Time Video Display Functions
#define PRINTSPECS CM_SERIALFSM | CM_9600BAUD |
CM_NOPRTY | CM_8BITS| CM_1STOP
void readtrk( int );
void exit( void );
char buf[80]; // Rcv'd data buffer.
char *cp = buf; // Next buffer loc to use.
void main( void)
{
int i, status;
/**** Enable Printer ****/
if ((status = comopen( COM1, PRINTSPECS, "", CS_NODSP))
!=NOERR)
exit();
/**** SELECT XON communication ****/
comxoff( COM1, YES);
/**** Read Tracks ****/
readtrk( 1 );
readtrk( 2 );
readtrk( 3 );
comclose( COM1, CS_NODSP);
}
void readtrk( int tn )
{
char cmd[12];
cp = buf;
vdspls( 4, 11, "Req track read ");
sprintf( cmd, "%cM%02d%1d\r", 27, TIME-OUT, tn); /* read Track */
vdspls( 4, 11, "Read track %d ", tn); /* display */
}