Communication ports, Clear_com, Close_com – Argox PA-20 Programming Guide User Manual

Page 91: Com_cts, Com_eot

Advertising
background image

PT-20 Programming Guide

89

Communication Ports

clear_com

Purpose: Clear receive buffer

Syntax: void clear_com(int port);

Example call: clear_com(1);

Includes:

#include “SDK.h ”

Description: This routine is used to clear all data stored in the receive buffer. This can be

used to avoid mis-interpretation when overrun or other error occurred. Use

the argument “port” as the connect port which is chosen to open . You can

choose 1(RS232).

Returns: None

close_com

Purpose: To close specified communication port

Syntax: void close_com(int port);

Example call: close_com(1);

Includes:

#include “SDK.h ”

Description: The close_com disables the communication port specified. Use the

argument “port” as the connect port which is chosen to open . You can

choose 1(RS232).

Returns: None

com_cts

Purpose: Get CTS level

Syntax: int close_com(int port);

Example call:

if (com_cts(1) = = 0) _printf(“COM 1 CTS is space);

else _printf(“COM 1 CTS is mark”);

Includes:

#include “SDK.h ”

Description: This routine is used to check current CTS level.

Use the argument “port” as

the connect port which is chosen to open. Now we only can choose

1(RS232).

Returns: 1 : allow to deliver

0 : not allow to deliver

com_eot

Purpose: To see if any COM port transmission in process (End Of Transmission)

Syntax: int com_eot(int port);

Example call:

while (com_eot(1) != 0x00); write_com(1,”NEXT STRING”);

Includes:

#include “SDK.h ”

Advertising