A yet another gateway for MODBUS TCP to RTU (Limited Edition especialy for LAB240 (tm) Team)
This project is developed and maintained by the NAPI Lab team and is primarily tested on NAPI industrial single-board computers based on Rockchip SoCs.
If you are looking for a reliable hardware platform to run modbus_slave in production, check out the NAPI board lineup:
Welcome to NAPI Wolrd (https://github.com/napilab/napi-boards) for more information!
Right now is available:
- NAPI2 — RK3568J, RS-485 onboard, Armbian
- NAPI-C — RK3308, compact, industrial grade
A simple TCP-to-RTU gateway for MODBUS protocol is supposed to be used as a tutorial for:
- a development of programming skills
- a programming for I/O on RS323 and RS-485 ports
- basic checking of work of MODBUS-capable devices
- build two-directionional gateways for TCP-to-RTU and RTU-to-TCP (not implemetde yet)
- support of RS-232 and RS-485 specific signaling
- single process with multithreaded architecure for high performance
- coordinating access between multiple TCP-clients is connected to single serial bus\device
- robust error handling ad recognising serial-line garbage
$ git clone https://gitlab.com/SysMan-One/mbus-gw-t2r
$ cd mbus-gw-t2r
$ git submodule update --init
$ mkdir build
$ cd build
$ cmake ../CMakeLists.txt -B ./
or
$ cmake ../CMakeLists.txt -DCMAKE_BUILD_TYPE=Debug -B ./
$ make -s
./build/mbusgw-t2r <CLI options> --settings=<network-n-serials-settings.fil>
./build/mbusgw-t2r --trace --settings=modbus-t2r-settins.conf
| Option | Description |
|---|---|
| trace | Enable extensible diagnostic output. Useful for for debug and troubleshouting purpose. |
| logfile=<fpsec> | Set a file name to accept logging output |
| logsize=<number> | Limit size of log file. |
| settings=<fspec> | Provide a rin-time configuration for network stuff and serial devices |
Check an example of settings file for reference of parameters and rules of configurations
Developer: Ruslan (AKA : The BadAss SysMan) Laishev VAX/VMS bigot, BMF.