How to test communication through Modbus?

How to test communication through Modbus?

Using  Modpoll freeware ( VP recommendation)

       
  1. Download it from the links below
or

  1. Unzip the file, open command line (cmd), and change the directory to the folder  which contains modpoll.exe

example: “cd /d  c:\modpoll’’

Notes
for Linux you need to add a binary specified for your CPU architecture to the path. Example for ARM platforms like Raspberry Pi:
export PATH=$PWD/modpoll/linux_arm-eabihf:$PATH

  1. Enter your command
 
Example (direct to VPFlowScope and direct connected to the Daisychain)
modpoll -m rtu -a 9 -r73 -t4:float -b38400 -p none COM4
 
Example (trough Enternet connection to  the Daisychain)
modpoll -m enc -a 9 -r73 -t4:float -p502 [ipaddress]
 
Example (trough Enternet direct to VPFlowScope M)
modpoll -m tcp  -a9 -r205 -t4:float -p502 [ipaddress]

SERIALPORT Serial port when using Modbus ASCII or Modbus RTU protocol
COM1, COM2 ... on Windows
/dev/ttyS0, /dev/ttyS1 ... on Linux
HOST Host name or dotted IP address when using MODBUS/TCP protocol

-m ascii Modbus ASCII protocol
-m rtu Modbus RTU protocol (default if SERIALPORT contains /, \\ or COM)
-m tcp MODBUS/TCP protocol (default otherwise)
-m udp MODBUS UDP
-m enc Encapsulated Modbus RTU over TCP
-a # Slave address (1-255 for serial, 0-255 for TCP, 1 is default)\n
-r # Start reference (1-65536, 1 is default)
-c # Number of values to read (1-125, 1 is default), optional for writing (use -c -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
-e Use Daniel/Enron single register 32-bit mode
-0 First reference is 0 (PDU addressing) instead 1
-1 Poll only once only, otherwise every poll rate interval
-l Poll rate in ms, (1000 is default)
-o # Time-out in seconds (0.01 - 10.0, 1.0 s is default)
Options for MODBUS/TCP, UDP and RTU over TCP:
-p # IP protocol port number (502 is default)
Options for Modbus ASCII and Modbus RTU:
-b # Baudrate (e.g. 9600, 19200, ...) (19200 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


 
Warning
  1. Pay attention to prominent factors: type of connection, port, Modbus address, format type, Modbus setting
  2. Submit required register after -r, always consider adding +1 if you didn’t get the proper number.
  3. In order to write a value like diameter add it to the end of the line after COM
 

Using Modbus Poll Software


  1. Download and install the software from the link below

It is a trial mode and only usable for 30 days

 
  1. From connection menu select connect
Select required connection type. For the serial connection, setting check the port from the device manager and other parameters from the flowmeter or VPStudio.
The mode is always RTU. Default numbers for Response timeout and delay between polls are both  1000 ms.
For other types of connection enter the IP address from the flowmeter. Port is always 502.
  1. With F8 you’ll have a read/write definition menu
The slave id is the modbus address. For the function, select 03 Read Holding Registers(4x). After that, add your required holding register.
Alert
Please note that selecting PLC addresses will change your rtu and it might result to get no response.

Be careful about PLC Addresses (Base 1)/ Protocol Addresses (Base 0)



  1. The format that you should use in order to have correct numbers is 32 Bit Float – Little Endian Bite Swap  (check the display menu)
  2. You can simply change a parameter (like diameter) by writing a new value on its cell after reading it


    • Related Articles

    • RS485 Communication for VPFlowScope M

      RS485 Communication Real time value of Temperature in Celsius (204-205) [RTU] Tx: 09 03 00 CC 00 02 05 7C Slave Address: 09 Function Code: 03 Starting Address: 00 CC Quantity of Registers: 00 02 CRC: 05 7C [RTU] Rx: 09 03 04 1C 20 41 CD 84 6C Slave ...
    • Site visit preparation checklist

      SECURITY CHECK Check safety and personal protection gear. ALWAYS. Eye protection Ear protection Hard Hat Safety Boots Reflective vest Required Permits, Diplomas, Certification for work Equipment list Flowmeters: FlowScope dP with display FlowScope M ...
    • Standard checklist - flow meter support

      This list of questions is essential to provide the right support. It helps us to be of quicker assistance, as we have a complete picture of the situation. Process: Inner Diameter of the pipe Upstream length Downstream length Average pressure in the ...