Preface:

The E870-EG01 is a visually programmable edge computing gateway independently developed by Chengdu Ebate Electronic Technology Co., Ltd. The previous article mentioned that this device supports two unique nodes: the logic conversion node and the cache queue node. This article will continue to introduce other unique nodes: the Modbus request node and the Modbus parsing node. These two nodes are usually used together. Simply put, the request node is responsible for generating user-defined Modbus data, while the parsing node is used to parse the messages returned by the Modbus device, extract the data, and output it in the debug window.

Featured Nodes:

1. Modbus Request Node

The function of this node is quite easy to understand. It configures the slave address, function code, register address, quantity, and type for each instruction.

For example, if we want this node to generate an instruction to "read the third coil at slave address 5," then we need to configure the slave address as 5, the function code as 1, the register address as 2 (register addresses generally start from 0), the quantity as 1, and the type as bit. Ultimately, the node will generate an instruction like this: 05 01 00 02 00 01 5D 8E (the parity bit for this instruction will be automatically calculated by the node).

Having understood its function and principle, we can use the serial port node to send the commands output by this node to the Modbus device connected to the EG01, allowing users to remotely control the Modbus device through this node. This node can also generate multiple commands by adding register configurations. To read coils 2 and 3 simultaneously, add a configuration entry below with register address 3. This will cause the node to output the two Modbus commands sequentially according to the order they were added.

2. Modbus Parsing Node

The parsing node is mainly used to interpret the messages returned by the Modbus device and output them in the debug window, such as the read coil status and internal register data.

In practical applications, it is generally used in conjunction with the request node to facilitate real-time reading of returned messages. To ensure the parsing node correctly parses messages, the correct attributes must be filled in within the node. Enter the function code corresponding to the type of message to be parsed.

For example, we use these two nodes to read and parse the five coils at slave address 5. This means we need to parse the five returned messages sequentially, so we need to add five parsing nodes and configure them correctly, as shown in the diagram below:

Of course, if users do not need to use our request node but want to parse their own Modbus messages, that's fine too. They just need to input the reply message into the node and connect a debug node after the node to output the parsed data.

Based on the examples above, the writing method for registers is basically the same. If you still have questions, you can click on any node with the mouse and then see the detailed information of the node in the help window on the right. Below it, there will be a "Click for details" link. After clicking, you will enter a more detailed introduction to the node and a large number of node examples that we have prepared for users. Users can use the official ready-made solutions by importing them.