Modbus Testing
Modbus Testing
Modbus Testing
Baseblock
ComTest Pro for Modbus Devices is one viable option. You can download this (free)
program at www.baseblock.com/PRODUCTS/comtestpro.htm. ComTest Pro allows
users to test and troubleshoot Modbus RTU or Modbus TCP communication. The
software offers comprehensive data-logging, data-formatting and error checking features.
It is available for Windows, OS X, iOS and Android.
In the following example we show how to use this program to make sure SLATE
Modbus communication is enabled and working properly over Modbus/TCP.
Please keep in mind that SLATE is a Modbus “slave” and thus requires a Modbus
“master” be present on the bus for Modbus communication to be successful.
The SLATE Base Module is now Modbus TCP/IP enabled and ready to test.
Now that the SLATE Base Module is ready to test, the next step is to access a register set to use.
We used the Demo Case (DSP3983/U) program registers. You can use other programs you may
have available.
Following are the steps to get to the registers for your SLATE Device:
In Niagara AX, open your SLATE Device. Make sure this device has been built so the registers
are visible in the report. Also make sure to unhide any (internal) registers you may want to
access using the “Network Visibility” button.
NOTE: All SLATE registers’ default state is “hidden”. All Designer registers (inputs and outputs
created in the wire sheet using “NetworkInput” blocks) are visible.
In Niagara AX having already accessed your SLATE Device…
Example:
Register 1: OpSetpoint (writeable)
Register 35: SensorOutput
Open ComTest Pro:
Select the Ethernet tab. Make sure the IP address is set correctly and the port is the
same as the SLATE port. The Device value is unused when connecting to SLATE via
Ethernet.
In the initial test we will change the burner set-point from its current value to 150F. If the
current value is already 150F, select another set-point value to insure Modbus
communication is functioning.
From the register list we can see the set-point register is register 1-2 (OpSetpoint). Set
the ComTest Pro utility is to display in Hexadecimal. Next we want to convert the
OPSetpoint of 150.0 to its floating point hexadecimal representation. For this we can use
a conversion calculator. We downloaded IEEE Calc. to convert floats to Hexadecimal.
https://sourceforge.net/projects/ieeecalc/files/latest/download.
This calculator allows us to convert float data types to Hexadecimal.
150 is a float that we need converted to its floating point hexadecimal representation.
Look up the appropriate register showing the “Setpoint” value. From the Modbus
report we see the register with the “Setpoint” value is register 1-2 (OpSetpoint).
Type in the Hexadecimal value of the new set-point in the first register field
followed by “h” representing Hexadecimal.
Verify that the ”Setpoint” on the Main page now shows 150.
Next, we will read the sensor value from the Main page of the demo.
Look up the appropriate register showing the “Sensor” value. From the Modbus
report we see the register with the “Sensor” value is register 35 (Sensor_Output).
Record the register readings and plug them in the IEEE calculator. As this value
is a Hexadecimal value, select the “Hex” option radial button in the calculator.
Under Float, the decimal conversion is shown which should match the reading on
the Main Demo page.
Repeat these steps to receive and transmit other values if desired.
NOTE: Integer based registers such as Booleans or Enums (see Data Type column of the
Modbus Interface Report) require simple Hex to Decimal conversion, not the IEEE
calculator used for converting float data types.