EJEMPLO EN C PARA PEDIR LA VELOCIDAD DE LA IMPRESORA
INICIALICE Y ABRA EL CANAL SERIAL PARA EJECUTAR LOS SIGUIENTES COMANDO:
// Query Print Station Address 7 for Line Speed
putchar(0x1b);
putchar(0x02);
putchar(0x30);
putchar(0x37);
putchar(0x26);
putchar(0x01);
putchar(0x04);
// Get results from print station
`
unsigned char dummy,speed;
dummy = getchar();
dummy = getchar();
dummy = getchar() << 4;
dummy |= getchar() & 0x0f;
if(dummy == our_address)
`
` else `
`
`
6-26
EVOLUTION LX SYSTEM MANUAL Issue 1.0 5 DEC 2009
// Send out ESC
// Send out STX
// Send out upper nibble of address 07
// Send out lower nibble of address 07
// Send out a '&' command
// Send out SOH
// Send out EOT
dummy = getchar();
speed = getchar() << 4;
speed |= getchar() & 0x0f;
dummy = getchar();
// error handler (not our address)
// Get ESC
// Get STX
// Get upper nibble of address
// Get lower nibble of address
// Get command
// Get upper nibble of speed
// Get lower nibble of speed
// Get EOT