Switching Modes of Serial Ports on IGT-20 to RS-232, RS-422 and RS-485

Designed as an industrial gateway for IoT, IIoT, Industry 4.0 and automation applications, IGT-20 has two serial ports enabling the connection to various sensors and devices. And among the sensors and devices, serial communication, i.e. RS-232, RS-422 and RS-485, is a very common interface. This article shows you how to switch modes of serial ports on IGT-20 to RS-232, RS-422 and RS-485.

Identify the Serial Port on IGT-20

IGT-20 supports two serial ports, located on the top side of it. It’s the first step to ensure that wiring is correct. The following figure shows the mapping between devices in OS and devices on the connector.

Device and connector mapping of Serial Ports on IGT-20

The figure shows only the whole groups of pins. The detail pin-out definition is revealed in the manual of IGT-20.

Switch the Mode of Serial Ports on IGT-20

The two serial ports on IGT-20 are configurable. It’s possible to switch the mode among RS-232, RS-422 and RS-485. A sample script can be found in /usr/bin/igt20 to accomplish several on-board functionalities, such as access DI/O’s, user buttons, user LEDs. Simply typing igt20 in CLI will show you the usage of this script. And of course, you can read the source code in detail if you’d like to.

Syntax of IGT-20 sample script

As the help message shows, it supports also switching modes of serial ports. We can switch ttyS1 to RS-485 the using the following command:

igt20 ttys1 485

 

Here’s the snap shot of screen.

Switching ttyS1 to RS-485 Mode

Upon you seeing this, IGT-20 is ready to run RS-485 over ttyS1. By using the same approach, it’s also possible to switch the mode of serial ports on IGT-20 to RS-232 and RS-422. Have fun!

Comments are closed.