Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 117

Advertising
background image

Chapter 7

Using the Serial Ports

7-9

if ( sts != 0 )

{
printf ( “BARCODE::Error parsing barcode!\n” );
exit ( sts );
}
/* Loop back to the “readln()” to get the next tag being read */

}
/* Loop back to the “open()” to try again to open path... */

reopen:
;

}

}
int handle_barcode ( buffer )
char *buffer;
{

if ( ( buffer[0] != ’S’ ) || ( !( isalpha ( buffer[1] ) ) ) )
{
printf ( “BARCODE::Invalid location character in barcode.\n” );
return ( 0x0101 );
}

switch ( buffer[1] )

{
case ’D’:

printf ( “ This is a Dublin product.\n” );
break;

case ’T’:

printf ( “ This is a Twinsburg product.\n” );
break;

default:

printf ( “ I have no idea where this product came from!\n” );
break;

}
return ( 0 );

}

Advertising