- 1 HJ3200/HJ6300MODBUS channel usage
- 2 MODBUS/RTU serial port configuration
- 3 MODBUS/RTU Channel Configuration
- 4 MODBUS Register Address Problem
- 5 Check if the MODBUS channel is normal
- 6 Connecting to slow RTU device need to pay attention to the sampling time
- 7 PROFINETRTU write channel (real-time write) description
- 8 PROFINETRTUPN online POLL 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
- Device ID: The address of the MODBUS-RTU device
- MODBUS commands: support standard MODBUS commands 01/02/03/04/05/06/0F/10
- Register address: the register address inside the MODBUS device, 16-bit data, 2 bytes.
- 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.
|Corresponding to the register address filled in by HJ3200/HJ6300
|Coil (DO) address
|Coil (DI) address
|Input register (AI) address
|Input register (AO) address
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
- Check the serial port baud rate, data bits, stop bits and check mode of RS485
- Check whether the A/B line of RS485 is correct, you can exchange A/B and try
- 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
- Check if the RTU device supports the MODBUS command of the channel
- Check if the MODBUS register address is out of the address range of the RTU device
- 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.