Issue
Need to analyze Modbus RTU communication packets for SpaceLogic controllers.
Product Line
EcoStruxure Building Operation
Environment
- Building Operation Automation Server
- Building Operation Multi-purpose Controller (MPC)
- Building Operation Room Controller (RPC)
Cause
MP and RP controllers do not support packet logging or viewing on their modbus serial ports. Additionally, RP controllers lack transmit/receive LEDs for Modbus, making diagnostics more difficult.
For differences between Automation Server and MP/RP controller Modbus operations, refer to the article: Modbus in the MP and RP Controller Introduction
Resolution
Wireshark Installation
- Install the latest Wireshark application from: Wireshark • Go Deep | Download
- Click on the "download" icon and select your operating system
- Launch the downloaded setup file to install Wireshark. The default installation options can typically be used, unless the user has a specific reason to select others.
Modbus RTU capture extension for Wireshark
- The Github project can be found at: GitHub - jzhvymetal/WiresharkSerialAdapter: Wireshark Serial Adapter for Windows
- Navigate to the latest version and download WireSharkSerialAdapter.exe
- With this file downloaded, navigate to the Wireshark application folder and locate the following subfolder. If it does not exist, create it. Copy WireSharkSerialAdapter.exe into this folder. NOTE: This is not an executable to be launched by the user. Wireshark will execute it as an additional capture option.
USB-to-RS485 communications adapter
- Install the USB-to-RS485 adapter to PC.
- Wire the RS-485 adapter to the SpaceLogic RS-485 port to be captured.
- Check Device Manager -> Ports to determine the COM port number it is using.
Wireshark Configuration
- Launch the Wireshark application. The initial start-up screen will list the available capture ports. This list will be different for each user’s computer, depending on its configuration. Below is an example of what this screen looks like:
- In this list, Serial Port Adapter (WireSharkSerialAdapter.exe) should be an option. Click on the settings icon
to the left to bring up the setup options:
- Launch Windows Device Manager to confirm the COM port assigned to the connected USB-485 adapter
- Select this COM port and set the baud rate, byte size, parity and stop bits of the Modbus RTU channel to be monitored.
- Use the Interframe settings shown in the screenshot above.
- Select User DLT 147 as the Wireshark DLT.
- Save these settings.
- Returning to the main screen, select Preferences from the Edit pull-down menu and navigate to Protocols:
- Expand Protocols and select DLT_User. Click on Edit to add an entry to the Encapsulation Tables. Click the “+” button to add a DLT
- Select User 0 (DLT = 147) and manually edit the Payload dissector to be mbrtu:
- Click OK and return to the main screen
Wireshark Capturing
- With the COM port properly configured, a traffic capture is initiated by double-clicking the selected COM port. The content of the capture will depend on the connected devices. The following is an example of the active window panes:
- The main pane is an overall summary of the Modbus RTU traffic, with a brief description of each message type. When a frame is selected in this pane, the lower-left pane contains a breakdown of the packet content by field-type, and the lower-right packet is the packet content in hexadecimal format.
- The selected frame number is displayed in the packet details frame on the lower left, as well as the contents of the Modbus message. In this example, the results of the Modbus Read Holding Request for 6 registers is shown.
- The Wireshark capture is stopped by clicking on the red square, second from the left