
PT-20 Programming Guide
This routine is used to check if prior transmission is still in process or not.
Use the argument “port” as the connect port which is chosen to open . You
can choose 1(RS232).
0, prior transmission still in course
1, transmission completed
-1, the transmitting port choices error
See if overrun error occurred
int com_overrun(int port);
if (com_overrun(1) > 0) clear_com(1);
This routine is used to see if overrun met. The overrun flag is automatically
cleared after examined. You can choose 1(RS232) or.
1, overrun error met
0, OK
-1, the transmitting port choices error
void com_rts(int port, int val);
This routine is used to control the RTS signal. It works even when the CTS
flow control is selected. However, RTS might be changed by the
background routine according to receiving buffer status. It is strongly
recommended not to use this routine if CTS control is utilized. Use the
argument “port” as the connect port which is chosen to open. Now we only
can choose 1(COM).
The argument “val” is set up RTS, 1 is ok for receiving data; 0 is error.
Send a specific number of characters out through RS232 port
int nwrite_com(int port, char *s, int count);
char s[20]={”Hello World\n”};
nwrite_com(1,s,5);/*send string “Hello” to connect port*/
This routine is used to send a specific number of characters specified by
count through RS232 ports. If any prior transmission is still in process, it is
terminated then the current transmission resumes. The character string is
Kommentare zu diesen Handbüchern