MODBUS/RTU Configuration

HJ32XX-HJ63XX MODBUS/RTU Configuration

HJ3200/HJ6300MODBUS channel usage

HJ3200/HJ6300 has one or more RS485 serial ports, these RS485 serial ports can be used to connect MODBUS/RTU devices to PROFINET network, and directly map the registers of MODBUS-RTU devices to PLC IW/QW, saving space.

Reading the IW space is actually equivalent to reading data from the input register of the MODBUS-RTU device, and writing data to the QW space is equivalent to writing data to the MODBUS-RTU output register, eliminating the need for MODBUS/RTU programming and debugging.

MODBUS/RTU serial port configuration

The serial port parameters of the MODBUS-RTU device need to be correctly configured into the serial port configuration data of the HJ3200/HJ6300.

The baud rate/data bit/stop bit/parity bit of the serial port must be consistent with the serial port parameters of the RTU device.

The communication mode is divided into master mode Master and slave mode Slave. Generally, MODBUS-RTU devices are slave station Slave mode, so configure HJ3200/HJ6300 device as Master mode.

If the RS485 serial port of HJ3200/HJ6300 is connected to the MODBUS master station, then the communication mode needs to be configured as Slave mode.

MODBUS/RTU Channel Configuration

Add “RTU” to HJ3200/HJ6300 through “Add” command

RTU Channel Parameters

Parameter meaning:

  1. Device ID: The address of the MODBUS-RTU device
  2. MODBUS commands: support standard MODBUS commands 01/02/03/04/05/06/0F/10
  3. Register address: the register address inside the MODBUS device, 16-bit data, 2 bytes.
  4. Quantity: Starting from the configured register address, the number of registers or coils that are continuously read/written.


Write MODBUS-RTU register

MODBUS Register Address Problem

The register addresses of the HJ3200/HJ6300 device configuration software are all in decimal. If it is in hexadecimal, it needs to be converted into decimal and then input into the configuration software.

Some RTU devices add prefixes to register numbers (Siemens RTU registers are generally prefixed).
Nameindex addressCorresponding to the register address filled in by HJ3200/HJ6300
Coil (DO) address00001~099990~9998(minus 00001)
Coil (DI) address10001~199990~9998(minus 10001)
Input register (AI) address30001~399990~9998(minus 30001)
Input register (AO) address40001~499990~9998(minus 40001)

Check if the MODBUS channel is normal

The RTU channel is configured, but it is possible that the RTU channel cannot work normally. You can check whether the RTU channel works normally by checking the debugging information.

“Show device debugging information” via the right-click menu

From the content of the data frame, it can be seen that the MODBUS address 02 read command (03) register address (00 64==100 in decimal) has timed out.

These MODBUS channel errors will not occur if all channels are OK.

Enter the enmodbusdug command in the debug window to view the data information of MODBUS-RTU communication, and enter “dismodbusdug” to close the output of communication data information.

The configuration of the new version adds command buttons: “Open RTU Debugging Information” and “Close RTU Debugging Information”

If the following data frame timeout occurs, you need to check the following parameters:

Modbus COM1 chnl-0 send overtimer
02 03 00 02 00 02 65 F8

  1. Check the serial port baud rate, data bits, stop bits and check mode of RS485
  2. Check whether the A/B line of RS485 is correct, you can exchange A/B and try
  3. Check if the station number (MODBUS address) is correct

When a data timeout occurs, there is no need to check register addresses, read and write commands, and quantities.

If the following data frame error occurs, you need to check the following parameters:

Modbus COM1 chnl-0 overtimer
02 03 00 65 00 02 D4 27

Modbus recv not for send
02 83 02 30 F1

  1. Check if the RTU device supports the MODBUS command of the channel
  2. Check if the MODBUS register address is out of the address range of the RTU device
  3. Check whether the quantity parameter exceeds the access space of the RTU device

When all RTU channels are working properly, there is no error message in the debug window

If you need to view the data exchange of MODBUS, enter “enmodbusdug”

Restart the HJ3200/HJ6300 device, or enter “dismodbusdug” in the debug information window to close the debug information

Connecting to slow RTU device need to pay attention to the sampling time

Some slow RTU devices use fast query speed, which will cause RTU reading failure, especially if multiple RTUs are connected together, it may happen that the RTU device of station 1 can work, but the following RTU cannot work.

Increasing the sampling interval can solve this problem.

PROFINETRTU write channel (real-time write) description

In order to save the bandwidth of the RS485 bus, the HJ3200/HJ6300 device defaults to receiving the write command from the PLC, and starts the write operation to the RTU device. If the write is successful, it will not write to the RTU device, but wait for the PLC Start the next write operation after writing the changed data again.
However, in some cases, real-time write operation is required. Regardless of whether the data written by the PLC changes, the HJ3200/HJ6300 device writes to the RTU device in real time according to the set sampling interval. The advantage of this operation is that the RTU device is restarted after power failure, and it can also synchronize with the PLC data.

PROFINETRTUPN online POLL configuration

Some applications require MODBUS/RTU commands to occur when Profinet is online. If the PN is offline, stop sending MODBUS/RTU commands.

If the RTU channel is set to Enable, the HJ3200/HJ6300 series devices will stop sending MODBUS/RTU commands after the PN is disconnected.

Leave a Comment