Copyright (c) 2016 - 2017 Keith Cullen
$ cd test_mb_pdu
$ make
$ ./test_mb_pdu
$ cd test_mb_rtu_adu
$ make
$ ./test_mb_rtu_adu
$ cd test_mb_tcp_adu
$ make
$ ./test_mb_tcp_adu
$ cd test_mb_ip_auth
$ make
$ ./test_mb_ip_auth
$ socat -d -d pty,raw,echo=0 pty,raw,echo=0
(In a different terminal)
$ cd test_mb_rtu_slave
$ make
$ ./test_mb_rtu_slave /dev/pts/2
(In a different terminal)
$ cd test_mb_rtu_master
$ make
$ ./test_mb_rtu_master /dev/pts/3
$ cd test_mb_tcp_server
$ make
$ ./test_mb_tcp_server
(In a different terminal)
$ cd test_mb_tcp_client
$ make
$ ./test_mb_tcp_client
Protocol Version | Supported |
---|---|
Modbus TCP | yes |
Modbus RTU | yes |
Modbus ASCII | no |
Function Code | Supported |
---|---|
(0x01) Read Coils | yes |
(0x02) Read Discrete Inputs | yes |
(0x03) Read Holding Registers | yes |
(0x04) Read Input Registers | yes |
(0x05) Write Single Coil | yes |
(0x06) Write Single Register | yes |
(0x07) Read Exception Status (Serial Line Only) | yes |
(0x08) Diagnostics (Serial Line Only) | yes |
(0x0b) Get Comm Event Counter (Serial Line Only) | yes |
(0x0c) Get Comm Event Log (Serial Line Only) | yes |
(0x0f) Write Multiple Coils | yes |
(0x10) Write Multiple Registers | yes |
(0x11) Report Server ID (Serial Line Only) | yes |
(0x14) Read File Record | yes |
(0x15) Write File Record | yes |
(0x16) Mask Write Register | yes |
(0x17) Read/Write Multiple Registers | yes |
(0x18) Read FIFO Queue | yes |
(0x2b) Encapsulated Interface Transport | yes |
Debian 9.1
Linux beaglebone 4.4.88-ti-r125 #1 SMP Thu Sep 21 19:23:24 UTC 2017 armv7l GNU/Linux
Ubuntu 16.04
Linux HighCreekLinux 4.13.0-38-generic #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux