[PR]
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
]
Modbus Gateway - Simple Protocol Conversion
In the previous article, we have introduced several main types of Modbus gateways in detail. Today, let us introduce the process of simple protocol conversion among them.
Simple protocol conversion is the most conventional and common Modbus gateway function, and it is also the Modbus gateway mode with the highest data processing efficiency. It only extracts the key fields in the data, and then encodes the extracted data with another protocol (Modbus RTUM, Modbus TCP) and sends it .
Demo Request & Data Analysis
In order to display the Modbus data frame correctly and visually, use the standard Modbus debugging tool to test. Modbus Poll and Modbus Slave are not free software, but they can be used for free for 30 days. If you need to use them for a long time, please purchase genuine ones.
The device adopts NS1-TB and configures the parameters as shown in the figure below:
Open the Modbus Poll software, click Connection to connect to the serial port server and configure the communication protocol, as shown in the figure below:
Turn off automatic reading, which is convenient for analyzing data frames. If you configure the host request first, it will cause the device request to time out. Don’t worry about it. After the slave simulation is completed, there will be no response timeout.
ModBus RTU protocol and ModBus TCP protocol
Open Modbus Slave, click Connection to connect to the serial port server and configure the communication protocol. The master has already used the network connection, and the slave needs to use the serial port connection, as shown in the figure below:
Open the data monitoring serial port, the method of Poll and Slave is the same as shown in the figure:
Click to read a register, 10 registers cannot be directly displayed in the debug window, reducing the number of read registers;
Configure the number of reads:
It can be seen from the figure below that the "simple protocol conversion" of the serial port server caches the message identifier "00 0D" of the received TCP data frame, adds Modbus CRC check to 01 03 00 00 00 02, and then outputs the data frame from the serial port. The slave machine receives the command and returns the Modbus RTU response data frame, and the serial server calculates the frame length after receiving the data, and then encodes the cached message identifier and frame length into the data frame and sends it through the network port.
Although "simple protocol conversion" has high processing efficiency, it cannot handle multi-host requests, so there are "multi-host mode and storage gateway". We will introduce the multi-host mode and storage gateway working mode in detail next time.
COMMENT
COMMENT FORM