User`s manual
(54/56)
B. Application Note for RS485 based communication using CAT5 Tx BOX.
1)
RS-485 is half-duplex communication. So data flow control in HOST side is required.
2)
Data flow control is done by following procedure.
HOST send data to Monitor while both of RTS and DTR signal is “LOW” (Clear) status.
HOST receive data from Monitor while RTS signal is “HIGH”(Set) status.
3)
Following chart shows more detailed timing of data flow control by RTS.
a: setup time of TxD by HOST: up to programming
b: Data transmission time of TxD by HOST: up to data length
c: Margin time of TxD period by HOST: up to programming
d: Reply preparation time by Monitor =approx.140msec(min)
HOST PC should keep RTS signal “LOW” while above (b) period at least. (a) and (c) is required in order to make reliable
communication between HOST and Monitor.
4)
Example of programming.
System:
Case1:OS:Windows XP Professional SP2, CPU:Centrino Duo 1.66GHz
Case2:OS:Windows XP Home SP1, CPU: Pentium4 2.8GHz
Case3:OS:Windows XP Professional SP2, CPU:Pentium3 933MHz
Procedure:
///
/// Send Data ///
・・・・
EscapeCommFunction(hFile,CLRRTS) ; CLEAR RTS & DTR
SLEEP(20) ; put 20msec delay for above “
a: setup time of TxD by HOST”.
WriteFile() ; Data transmission of TxD
SLEEP(70) ; put 70msec delay for above “
c: Margin time of TxD period by HOST”.
EscapeCommFunction(hFile,SETRTS) ; SET RTS& DTR
・・・・
/// Receive Data (Ex. by Polling timer at 100msec interval)///
・・・・
ReadFile() ; Data Receive of RxD
・・・・
///
------------------------------------------- end of document--------------------------------------
R
equest
R
eply
RTS&DTR
TxD(Host->Monitor
RxD(Monitor->Host)
a
b
c
d