Metrologic Optimus S Programming Manual page 108

"c" programming guide
Table of Contents

Advertisement

102
"C" Programming Guide For Optimus S/R
Relevant routines are grouped by different communication types and described separately
in the following sections.
clear_com
close_com
com_eot
To clear the receive buffer.
Purpose
Syntax
void clear_com (int port);
int port;
clear_com (1);
Example
Description
This routine clears all the data stored in the receive buffer. It can be used to
avoid mis-interpretation when overrun or other error occurs.
Return
None
See Also
com_overrun
Purpose
To terminate communication and disable a specified COM port.
Syntax
int close_com (int port) ;
int port;
Example
close_com (2);
Description
This routine disables the COM port specified.
Return
It always returns 1.
open_com
See Also
Purpose
To check if there is any COM port transmission in progress.
Syntax
int com_eot (int port) ;
int port;
Example
while (!com_eot (1));
write_com (1,"NEXT STRING");
Description
This routine checks if there is any transmission still in progress. (eot = End Of
Transmission)
Return
If transmission is completed, it returns 1.
Otherwise, it returns 0.
/* COM port whose receive buffer is to be cleared */
/* clear the receive buffer of COM 1 */
/* COM port to be checked */
/* wait till prior transmission completed */
/* COM port to be closed */
/* close COM 2 */

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents