Basic Troubleshooting Options
After configuring Lookout to communicate with your device, there may be times when you need to monitor or troubleshoot the communications. Lookout includes tools to help you investigate performance or unexpected behavior with Modbus communication.
Modbus Protocol Statistics
The Modbus driver monitors Modbus Protocol Statistics. This data is held within readable data members of the Modbus object and you can see them in the Modbus Protocol Statistics dialog box. To view the dialog box, select
Option»Modbus and click
Statistics.
Note: The
Options»Modbus option is only visible in the
Options menu if a Modbus object exists in your Lookout application.
The following dialog appears.
- Valid response frames: The number of good messages received from the polled device.
- Bad CRC or LRC: Number of responses from device whose message failed the cyclic redundancy check (CRC) or the longitudinal redundancy check (LRC).
- Response too short: The number of responses from the device whose message length was too short.
- No response: The number of polls generated by the driver not responded to by the device.
- Garbled: The number of responses from the device whose message was unintelligible to the driver.
- Exceptions: The number of responses from the device whose message was understandable to the driver but included an error code indication from the device.
The
Count column contains the accumulated number of messages received from the selected device that fall into each respective category since the last time the
Reset button was clicked. The
percent column (%) indicates the percentage of messages received that fall into each respective category since the last time the
Reset button was clicked.
Refer to the Lookout support page and tutorial linked at the end of this section for more information on troubleshooting related issues.
Alarms Window
After you have created a Modbus object and attempted to make a connection, any issue that occurs with the communications generates an alarm for that driver. The alarm information often coincides with data seen in the Protocol Statistics dialog.
Refer to the Lookout support page linked at the end of this section for the most common alarms and an explanation of the potential causes.
Monitoring Modbus Communications
If you have received alarms related to garbled communication or any other of the protocol statistics, you might want to view the actual serial data sent to and from the device. To record this serial communication, configure Lookout to log the data to file by selecting
Options»Serial Ports and enabling the diagnostic file settings. Also check the options for
Timestamp Enable and
Value in HEX to make the file more readable and useful for troubleshooting.
Note: Make sure that you are configuring the proper serial port for the Modbus device.
If you are communicating with a device via Modbus Ethernet, refer to the KnowledgeBase linked at the end of this section for information on logging the communications.
The example below shows Modbus data captured on the serial port. By analyzing this data and comparing it to the protocol format and the data that the device should be sending/receiving, you can troubleshoot where an issue may be occurring. For more information on the Modbus protocol and how to interpret the data, refer to the Modbus Organization web site link at the end of this section.
From the sample shown above, you will notice that the first message was generated at 15:44:24.5 (3:44pm, 24.5s). The arrow pointing to the right denotes that the communications is TO the device. If a response is received FROM the device, the arrow points left. First, the message is sent in RTU format; the default. Because the device did not respond, the message was sent in ASCII format. There is still no response from the device therefore the message continues to repeat while a “No Response from Modbus Secondary” alarm is generated.
Modbus Slave
There may be times when you are developing a Lookout application, but you do not have access to the device to which the Modbus driver will communicate. In this case, you might want to simulate the device so that the application can be tested. In this situation, a Modbus slave object can be used to simulate the device.
In order to simulate the device, configure the
ModbusSlave object and set up the local computer as follows:
1. Connect a NULL serial cable between two COM ports on your computer.
2. Create a ModbusSlave object in Lookout for one of your COM ports.
3. Create a Modbus object for your other COM port with matching baud rate settings.
Note: The ModbusSlave can also be set up and accessed from another computer. The other computer would also need a server version of Lookout to accomplish this configuration.
Advanced Settings
In certain situations, you might need to apply more advanced settings to your Modbus communications for proper and efficient functionality. You can access advanced Modbus options from the
Create Modbus Secondary dialog.
For more detailed information on the advanced settings, refer to the Lookout Help.