Moxa V2426A-C2-W7E [24/88] Checking the current serial settings

Moxa V2426A-C2-T [24/88] Checking the current serial settings
V2400A Series Expansion Modules Software Installation and Programming Guide
4-4
root@Moxa:~# setinterface
Usage: setinterface device-node [interface-no]
device-node - /dev/ttyM*
interface-no - following:
none - to view now setting
0 - set to RS232 interface
1 - set to RS485-2WIRES interface
2 - set to RS422 interface
3 - set to RS485-4WIRES interface
root@Moxa:~#
Checking the Current Serial Settings
To check the current interface setting, type the following. The system should display a response as below.
root@Moxa: ~# setinterface /dev/ttyM0
Now setting is RS485-2WIRES interface.
In the example above, port 1 on card 1 is configured as a 2-wire RS-485 interface. After entering the lines of
code below, port 1 gets reset as an RS-422 interface.
root@Moxa: ~# setinterface /dev/ttyM0 2
root@Moxa: ~# setinterface /dev/ttyM0
Now setting is RS422 interface.
ATTENTION
Seria
l interfaces will shift device node identifiers depending upon the location and number of cards
mounted in the platform
. E.g.,
if there are originally two cards mounted in the machine, and card number 1 is
removed, then the second card’s
node identifier will change from /dev/ttyM8 and /dev/ttyM9 to
/dev/ttyM
0 and /dev/ttyM1.
If
you
want to configure the machine for fixed serial interface device node identifiers, you can create a UDEV
rule in
/etc/udev/rules.d/. For help with this, consult the UDEV manual fi
les, another Linux manual, or Moxa
technical support for more details.
The system default for EPM-3032 interfaces is RS-232. By editing the device manager’s rule scripts, it is
possible to set all serial ports to one of the serial protocols (RS-485 or RS-422) instead. The steps below
describe how to do so.
1. Edit Moxa’s custom rules file for the device manager, which can be found at
/etc/udev/rules.d/96-moxa.rules. Add the following command to 96-moxa.rules:
# Set the device, EPM-3032, 0x1393:0x1022 default as 232 mode interface
DRIVERS=="mxser", ATTRS{vendor}=="0x1393", ATTRS{device}=="0x1022",
RUN+="/bin/setinterface /dev/ttyM%n 0"
"96-moxa.rules"
ATTENTION
The
VendorID for the EPM-3032 is 0x1393m, and the DeviceID is 0x1022.

Содержание

Похожие устройства

Скачать