ReliaGATE 10-12 User manual Rev. 2-1
12.9
How to manage the COM ports
The ReliaGATE 10-12 exposes the COM ports as follows:
COM port 0 (RS-422/485):
l
COM port 1 (RS-232/485):
l
You need to configure the serial ports mode before they will work.
12.9.1
How to set the termination resistors for COM 0 in RS-485 mode
The termination resistors are controlled with the "gpio_utility".
For more information see:
To enable the termination resistors, enter the following command:
gpio_utility GPIO2_3 1 &>/dev/null
To disable the termination resistors, enter the following command:
gpio_utility GPIO2_3 0 &>/dev/null
12.9.2
How to set the RS-422/485 modes for COM 0
You can configure the serial port mode in the following ways, A or B:
A. Using the ethsetserial utility
B. Implementing the ioctl in the source code
12.9.2.1
How to use the ethsetserial utility to configure the COM ports
To set COM port 0 to RS-422 mode, enter the following command:
ethsetserial -p ttyO4 -m422 -r1 -s1 -b0 -a0
To set COM port 0 to RS-485 mode, enter the following command:
ethsetserial -p ttyO4 -m485 -r0 -s1 -b100 -a100
To see all the available options, enter the following command:
ethsetserial –h
/dev/ttyO4 (available on the front side)
/dev/ttyO3 (available on the front side)
"How to drive the GPIOs: the GPIO Utility" on
12 How to manage interfaces in Linux
page 71.
77 / 118