User`s manual

4-18 Intellio C218Turbo User's Manual
RS-485 Programming for Opt8J
If you intend to do RS-485 communication with Opt8J, please follow the RS-485
programming guide below and also refer to Chapter “Connection Option (Opt8x)
and Cable Wiring” for more Opt8J RS-485 operation details.
The Opt8J supports only 2-wire half-duplex RS-485 communication. Data+/- pins
are served for both data transmitting and receiving, depending on the RTS signal.
The port switch of each port should be set to On position. The port is for
transmitting data if RTS is asserted and for receiving data if RTS is not asserted.
RTS scheme is suitable for any system, including Windows NT and Windows 95/98,
DOS, or UNIX, that permits RTS control from application programs.
How to transmit and receive data under Windows NT, 95/98 & DOS
We recommend you to configure C218Turbo ports as follows in order to acquire
precise timing control in RS-485 2-wire transmission.
Windows NT, Windows 95/98
Set the “Transmission Mode” in the configuration program to “Classical”. UART
FIFO status has no effect under the circumstance.
DOS
Set the “UART FIFO” in the configuration program to “Disable”.
There are 2 solutions to control RS-485 2-wire transmission.
Solution 1
The following model is common in RS-485 2-wire transmission.
sio_SetWriteTimeouts(port, 0); /* Set sio_write() into block mode if
for Windows NT and Windows 95/98
*/
sio_RTS(port, 1); /* Turn on RTS signal. The RS-485
port is ready for transmitting data. */