Severity: Notice
Message: Undefined index: HTTP_ACCEPT_LANGUAGE
Filename: front/Model_main.php
Line Number: 34
Backtrace:
File: /var/www/html/application/models/front/Model_main.php
Line: 34
Function: _error_handler
File: /var/www/html/application/controllers/Home.php
Line: 1328
Function: init
File: /var/www/html/index.php
Line: 315
Function: require_once
This article will tell you how to run a modbus RTU example on NX8MM-35.
We used libmodbus to utilize the modbus function via 2x RS485 (1 modbus server & 1 modbus client on the same SBC) on NX8MM-35 under Yocto in this tips.
First, boot up the board, and plug in a USB disk which contains the modbus test tool sample code file and open the terminal.
$ gcc modbus_test_v2.c -o modbus_test_v2 -lmodbus
$ mv modbus_test_v2 /modbustest $ cd /modbustest
Use the command below to check the function description:
$ /.modbus_test_v2 Usage: ./modbus_test_v2 [-s|-c] [-r gpio_index] serial_port -s : server -c : client -r : rts-gpios : dm446c rts-gpios numbers: ttymxc0=128, ttymxc3=9
We use COM1 (ttymxc0/GPIO128) and COM4 (ttymxc3/GPIO9) on the NX8MM-35 for RS-485 communication, performing point-to-point Modbus RTU testing between the two ports.
(Be sure to short J39 to switch the COM port to RS485 mode.)
./modbus_test_v2 -s -r 9 /dev/ttymxc3
./modbus_test_v2 -c -r 128 /dev/ttymxc0
After executing the command above, the server (COM4) successfully receives the Modbus RTU signal from the client (COM1), marking the completion of the test.
For more info and sample request, please write to info@icop.com.tw, call your nearest ICOP Branch, or contact our Worldwide Official Distributor.