Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 7 months ago.
modbus: modpoll
Hi all,
I'm not sure if this is the right place to ask this question.
I wonder if anyone has ever used the "modpoll" tool before as a Modbus master polling tool? http://www.modbusdriver.com/modpoll.html
I'm testing it on my Modbus slave device whose address is based on PDU addressing. (Starting address is 0)
In the modpoll setup, we can use "-0" to set the first reference as 0 instead of 1.
However, the start reference parameter ("-r") is defined between 1-65536.
In this case, I couldn't get the value at register 0.
I tried to set the "-r" parameter 0 but it's invalid.
I tried to contact the modpoll website service but haven't got any reply from them.
Hope someone here could help. Thanks!
FYI:
Usage: modpoll [options] serialport|host Arguments: serialport Serial port when using Modbus ASCII or Modbus RTU protocol COM1, COM2 ... on Windows /dev/ttyS0, /dev/ttyS1 ... on Linux /dev/ser1, /dev/ser2 ... on QNX host Host name or dotted ip address when using MODBUS/TCP protocol General options: -m ascii Modbus ASCII protocol -m rtu Modbus RTU protocol (default) -m tcp MODBUS/TCP protocol -m enc Encapsulated Modbus RTU over TCP -a # Slave address (1-255, 1 is default) -r # Start reference (1-65536, 100 is default) -c # Number of values to poll (1-100, 1 is default) -t 0 Discrete output (coil) data type -t 1 Discrete input data type -t 3 16-bit input register data type -t 3:hex 16-bit input register data type with hex display -t 3:int 32-bit integer data type in input register table -t 3:mod 32-bit module 10000 data type in input register table -t 3:float 32-bit float data type in input register table -t 4 16-bit output (holding) register data type (default) -t 4:hex 16-bit output (holding) register data type with hex display -t 4:int 32-bit integer data type in output (holding) register table -t 4:mod 32-bit module 10000 type in output (holding) register table -t 4:float 32-bit float data type in output (holding) register table -i Slave operates on big-endian 32-bit integers -f Slave operates on big-endian 32-bit floats -1 Poll only once, otherwise poll every second -e Use Daniel/Enron single register 32-bit mode -0 First reference is 0 (PDU addressing) instead 1 Options for MODBUS/TCP: -p # TCP port number (502 is default) Options for Modbus ASCII and Modbus RTU: -b # Baudrate (e.g. 9600, 19200, ...) (9600 is default) -d # Databits (7 or 8 for ASCII protocol, 8 for RTU) -s # Stopbits (1 or 2, 1 is default) -p none No parity -p even Even parity (default) -p odd Odd parity -4 # RS-485 mode, RTS on while transmitting and another # ms after -o # Time-out in seconds (0.01 - 10.0, 1.0 s is default)