Modbus Analyzer
The Modbus Analyzer plugin makes Modbus communication easy to understand and test. By parsing and decoding Modbus RTU, Modbus ASCII, and Modbus TCP frames, it presents clear, human-readable insights alongside raw data. The plugin also lets you craft and send custom Modbus packets effortlessly, enabling precise control over read/write operations.
Capabilities
Required
|
Modbus Analyzer is a layer. Attaching layers to sessions or logs
requires the Layers capability. |
Recommended
|
Modbus RTU & Modbus ASCII are typically used over serial links. The Serial Links capability enables the Serial Terminal which can be used to talk to serial devices, monitor half-duplex RS485 links, send custom Modbus packets, and more. |
|
Modbus RTU & Modbus ASCII are typically used over serial links. The Device Monitoring capability enables the Serial Monitor which can be used to sniff applications on the user’s PC talking to serial devices. |
Optional
|
The In-App Scripting capability allows you to programmatically prepare and transmit packets; this can be very useful when debugging Modbus communications. |
|
The Packet Library capability helps you organize commonly used packets, give them mnemonic names, and quickly send them to the wire. It also enables the recent packet history list; useful when talking to Modbus devices. |
Half-Duplex Setup
Half-duplex Modbus communications are not easy to parse due to the packet format specifics. Alas, the Modbus protocol doesn’t define any structural differences in headers of requests and replies – request and replies start with exactly the same sequence of bytes (which in case of a reply usually followed by extra data bytes). In full-duplex links, it doesn’t impose a problem – TX data always contains Master requests, RX – Slave replies. But in half-duplex everything is mixed into a single stream of bytes. Therefore, some heuristics is needed to split this single byte stream into two.
- Go to “Settings”
- Set “Stream roles” to “Half-duplex (RX)” or “Half-duplex (TX)”, so that Modbus Analyzer knows that Modbus requests and Modbus replies are all contained in the single stream (RX or TX)
- Set the “Half-duplex mode” based on your needs (see “Settings” section below for details)
We also have a dedicated Knowledge Base page explaining this.
Modbus Sniffing
After basic setup is complete, you can begin to sniff Modbus communications.
Packet Generation
- In the “Packet Template” pane, select either request or reply and RTU, TCP or ASCII
- Edit property values, e.g. “Function” or “Count”
- Click the “Refresh dynamic layout” button to generate the Modbus binary
- Click the “Send” button and watch as you get human-readable Modbus responses
Settings
Setting |
Description |
Default |
Protocol |
Specify the Modbus flavor. See available options. |
Modbus RTU |
Stream roles |
Assign Master/Slave roles to captured data streams. See available options. |
TX - Master; RX - Slave |
Half-duplex mode |
Half-duplex Modbus is tricky to decode. This setting allows you to choose a proper heuristic for the Modbus decoder. See available options. |
Alternate Master/Slave |
Half-duplex timeout |
When Half-duplex mode is set to Alternate Master/Slave, this setting defines a timeout (in milliseconds) after which the decoder decides there was no reply from a Slave and switches back to Master. |
2 sec |
Modbus Sub-protocols
Protocol |
Description |
Modbus RTU |
The most commonly used version of Modbus over Serial links. |
Modbus ASCII |
Closely resembles Modbus RTU but uses only ASCII characters for communication, thus making it possible to transfer over 7-bit links (and somewhat easier to debug). |
Modbus TCP |
A version of Modbus used over TCP connections. |
Stream Roles
Role |
Description |
TX - Master; RX - Slave |
Master and Slave(s) use different data streams. The Master’s commands are in the TX stream; the Slave(s)’ replies are in the RX stream. |
RX - Master; TX - Slave |
Master and Slave(s) use different data streams. The Master’s commands are in the TX stream; the Slave(s)’ replies are in the RX stream. |
Half-duplex (TX) |
Master and Slave(s) use the same data stream – TX. |
Half-duplex (RX) |
Master and Slave(s) use the same data stream – RX. |
Half-duplex Modes
Mode |
Description |
Alternate Master/Slave |
The analyzer alternates the roles dynamically based on the traffic. |
RTS ON - Master, else Slave |
When the RTS signal is ON (active), the analyzer treats the packet as originating from the Master. If RTS is OFF, the packet is treated as originating from the Slave. |
RTS ON - Slave, else Master |
When the RTS signal is ON (active), the analyzer treats the packet as originating from the Slave. If RTS is OFF, the packet is treated as originating from the Master. |
CTS ON - Master, else Slave |
When the CTS signal is ON (active), the analyzer treats the packet as originating from the Master. If CTS is OFF, the packet is treated as originating from the Slave. |
CTS ON - Slave, else Master |
When the CTS signal is ON (active), the analyzer treats the packet as originating from the Slave. If CTS is OFF, the packet is treated as originating from the Master. |