AR-B1380/AR-1380A User’ s Guide
Page 76
11. PROGRAMMING THE RS-485
The majority of the communicative operations of the RS-485 are the same as the RS-232. When the RS-
485 proceeds with the transmission which needs control the TXC signal, the installation steps are as
follows:
Step 1:
Enable TXC (Data Terminal Relay)
Step 2:
Send out data
Step 3:
Waiting for data empty
Step 4:
Disable TXC
NOTE:
Please refer to Section 3.3.12 space of the “ Serial Port” for the detailed description of the COM
port’ s register.
(1) Initialize COM port
Step 1:
Initialize COM port in the receiver interrupt mode, and /or transmitter interrupt mode. (All of
the communication protocol buses of the RS-485 are in the same.)
Step 2:
Disable TXC (transmitter control), the bit 0 of the address of 4 just sets to “ 0”.
NOTE:
Set the AR-B1380/AR-B1380A CPU card’ s DTR signal to the control RS-485’ s TXC
communication.
(2) Send out one character (Transmit)
Step 1:
Enable the TXC signal, and the bit 0 of the address of 4 sets to “ 1”.
Step 2:
Send out the data. (Write this character to the 0 of the current COM port address)
Step 3:
Wait for the buffer’ s data empty. Check the transmitter holding register (THRE, bit 5 of the
address of 5), and transmitter shift register (TSRE, bit 6 of the address of 5)
are set to “ 0”.
Step 4:
Disabled the TXC signal, and the bit 0 of the address of 4 sets to “ 0”
(3) Send out one block data (Transmit – the data more than two characters)
Step 1:
Enable the TXC signal, and the bit 0 of the address of 4 sets to“ 1”.
Step 2:
Send out the data. (Write all data to the 0 of the current COM port address)
Step 3:
Wait for the buffer’ s data empty. Check transmitter holding register (THRE, bit 5 of the
address of 5), and transmitter shift register (TSRE, bit 6 of the address of 5)
are set to “ 0”.
Step 4:
Disabled the TXC signal, and the bit 0 of the address of 4 sets to “ 0”
Summary of Contents for AR-B1380
Page 2: ......