Difference between revisions of "UIO-4031 RS485:U-COM0/1、U-COM2/3"

From ESS-WIKI
Jump to: navigation, search
 
 
Line 1: Line 1:
  
[[File:UIO-4031 U-COM01 23.png]]
+
[[File:UIO-4031 U-COM01 23.png|RTENOTITLE]]
  
[[File:UIO-4031 U-COM01 23-Pin.png]]
+
[[File:UIO-4031 U-COM01 23-Pin.png|RTENOTITLE]]
 +
 
 +
=== '''Send and Receive Data''' ===
 +
 
 +
The following figure shows the connection mode.
 +
 
 +
[[File:UIO-4031 RS485.png]]
 +
 
 +
'''Taking COM1 as receiver and COM2 as sender :'''
 +
<pre># #---- COM1 as receiver ----# #
 +
# stty -F /dev/ttyUSB0 115200 cs8 -cstopb -parenb -crtscts
 +
# cat /dev/ttyUSB0 &
 +
 
 +
# #---- COM2 as sender ----# #
 +
# stty -F /dev/ttyUSB1 115200 cs8 -cstopb -parenb -crtscts
 +
# echo pass > /dev/ttyUSB1
 +
 
 +
# #----If no error, the receiver will receive “pass”----# #
 +
pass</pre>
 +
 
 +
[[File:UIO-4031 RS485 1.png]]
 +
 
 +
Note:
 +
 
 +
1、Receiver should run before sender.
 +
 
 +
2、The “serial port parameters” should be the same for sender and receiver.

Latest revision as of 02:34, 20 December 2024

RTENOTITLE

RTENOTITLE

Send and Receive Data

The following figure shows the connection mode.

UIO-4031 RS485.png

Taking COM1 as receiver and COM2 as sender :

# #---- COM1 as receiver ----# #
# stty -F /dev/ttyUSB0 115200 cs8 -cstopb -parenb -crtscts
# cat /dev/ttyUSB0 &

# #---- COM2 as sender ----# #
# stty -F /dev/ttyUSB1 115200 cs8 -cstopb -parenb -crtscts
# echo pass > /dev/ttyUSB1

# #----If no error, the receiver will receive “pass”----# #
pass

UIO-4031 RS485 1.png

Note:

1、Receiver should run before sender.

2、The “serial port parameters” should be the same for sender and receiver.