
PT-20 Programming Guide
transmitted one by one until the specified number of character is sent. Use
the argument “port” as the connect port which is chosen to open. You can
choose 1(RS232). The argument “count” is the number of words of sending
data.
If you select RS-232 and set hardware flow control(CTS/RTS), this function
will wait while data be transmitted.
-1 : error
Other value: the number of words that success writing into.
Initialize and enable specified RS232 port
int open_com(int com_port, int setting);
open_com(1,0x0b);/*openCOM1,baud rate 38400,8 data bits,no parity,no
handshake*/
The open_com function initializes the specified RS-232 port. It clears the
receive buffer, stops any data transmission under going, reset the status of
the port, and set the RS-232 specification according to parameters set. Use
the argument “port” as the connect port which is chosen to open. You can
choose 1(RS232).
Each bit of the argument “setting”:
0 :115200 1-2 : 57600
3 : 38400 4 : 19200
5 : 9600 6-7 : 4800
0 : Open fail
1 : Open success
When flow control set up disable and flow control method set up CTS/RTS.
When you use IR port, the baud rate only can be setted 115200, flow control
disable.
Read 1 byte from the RS232 receive buffer
int read_com(int port, char *c);
Kommentare zu diesen Handbüchern