1. under the hood

2. wifi

3. test

nc -z -v -w 5 sol010.d01.net 502
Ncat: Version 7.40 ( https://nmap.org/ncat )
Ncat: Connected to 10.1.2.10:502.
Ncat: 0 bytes sent, 0 bytes received in 0.03 seconds.

4. modpoll

wget http://www.modbusdriver.com/downloads/modpoll.3.4.zip
mkdir modpoll
unzip modpoll.3.4.zip -d modpoll/
chmod +x modpoll/linux/modpoll
modpoll/linux/modpoll -m tcp -p 502 -t 4 -r 40001 -c 16 -1 10.1.2.10
modpoll 3.4 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2013 proconX Pty Ltd
Visit http://www.modbusdriver.com for Modbus libraries and tools.

Protocol configuration: MODBUS/TCP
Slave configuration...: address = 1, start reference = 40001, count = 16
Communication.........: 10.1.2.10, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave...
[40001]: -1
[40002]: -1
[40003]: -1
[40004]: 255
[40005]: -3
[40006]: 255
[40007]: -3
[40008]: 255
[40009]: -3
[40010]: 255
[40011]: -3
[40012]: 255
[40013]: -3
[40014]: 255
[40015]: -3
[40016]: -32768
modpoll/linux/modpoll -m tcp -p 502 -a 126 -r 200 -t 4 -c 2 10.1.2.10
  • poll from modbus tcp server (-m tcp)

  • portnumber (-p 502)

  • with unit id 126 (-a 126)

  • starting from register 200 (-r 200, 1 based index, i.e. corresponding to 40200)

  • two registers -c 2

  • holding registers (-t 4)

    modpoll -m tcp -p 502 -t4 -r 4100 -c 55 -10 10.1.2.10 |grep 4114|awk '{ print $2/10,"Volts DC"}'
    modpoll -m tcp -p 502 -a 126 -t4 -r 40180 -c 100 -10 10.1.2.10

5. mbpoll

git clone https://github.com/epsilonrt/mbpoll.git
mkdir -p mbpoll/build
cd mbpoll/build/
cmake ..
-- The C compiler identification is GNU 7.1.1
-- The CXX compiler identification is GNU 7.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alain/mbpoll/build
make
Scanning dependencies of target mbpoll
[ 12%] Building C object CMakeFiles/mbpoll.dir/src/mbpoll.c.o
[ 25%] Building C object CMakeFiles/mbpoll.dir/3rdparty/modbus/modbus.c.o
[ 37%] Building C object CMakeFiles/mbpoll.dir/3rdparty/modbus/modbus-data.c.o
[ 50%] Building C object CMakeFiles/mbpoll.dir/3rdparty/modbus/modbus-tcp.c.o
[ 62%] Building C object CMakeFiles/mbpoll.dir/3rdparty/modbus/modbus-rtu.c.o
[ 75%] Building C object CMakeFiles/mbpoll.dir/3rdparty/sysio/delay.c.o
[ 87%] Building C object CMakeFiles/mbpoll.dir/3rdparty/sysio/serial.c.o
[100%] Linking C executable mbpoll
[100%] Built target mbpoll
cd
mbpoll/build/mbpoll -m tcp -p 502 -t 4 -r 40001 -c 16 -1 10.1.2.10
mbpoll 0.1-23 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2015 epsilonRT, All rights reserved.
This software is governed by the CeCILL license <http://www.cecill.info>

Protocol configuration: Modbus TCP
Slave configuration...: address = [1]
                        start reference = 40001, count = 16
Communication.........: 10.1.2.10, port 502, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave 1...
[40001]:        65535 (-1)
[40002]:        65535 (-1)
[40003]:        65535 (-1)
[40004]:        255
[40005]:        65533 (-3)
[40006]:        255
[40007]:        65533 (-3)
[40008]:        255
[40009]:        65533 (-3)
[40010]:        255
[40011]:        65533 (-3)
[40012]:        255
[40013]:        65533 (-3)
[40014]:        255
[40015]:        65533 (-3)
[40016]:        32768 (-32768)

6. yasdi

8. references