Can I Monitor COM Port Activity in Lookout or Lookout Protocol Drivers? Primary Software: LookoutPrimary Software Version: 3.8 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: How can I monitor serial port communication in Lookout or Lookout Protocol Drivers? Solution: Lookout 3.8b12 (Lookout Protocol Drivers 4.0) and later has capability to log all serial port communication into a text file. The log feature in 3.8 and 4.X versions is turned on by the DiagnosticFile entry in the Lookout.ini file. Lookout 5.0 has the log feature configuration available in its menu. Refer to the How Do I Log the Serial Port Data in Lookout 5? entry in the Related Links section for more information. For all previous versions, follow these steps to enable the logging: 1. Open Lookout.ini, located in the Lookout folder, in Notepad 2. Find the [COMn] section in the file (n is the number of the port), create it if it does not exist 3. Add DiagnosticFile=absolute_file_name on the next line, for example:
DiagnosticFile=c:\temp\diag1.txt Notes: 1) The c:\temp folder in the example has to exist. The diag1.txt file is created by Lookout if it does not exists, otherwise the logs are appended to the file. 2) The file is a text file and its structure consists of requests and replies, for example: Modbus1 -> [01][03][00][00][00][02][C4][0B] Modbus1 <- [01][03][04][00]A[00][00][AA]' The 1st line reads: "The Modbus1 object sent out (->) a message." The 2nd line is the sent-out message. The 3rd line reads: "The Modbus1 object received (<-) a message." The 4th line is the received message: 3) Any byte that can be represented by a printable character is display as the character (A and ' in the reply above). All non-printable bytes are represented by their hex codes enclosed in square brackets. The leading [01][03]... in the request means: byte 01h followed by 03h... If you prefer having all bytes in hex, add following entry to the respective COM section in the Lookout.ini file: DiagnosticAllHex=1 (only Lookout or Lookout Protocol Drivers 4.5 or later). 4) One of the observation you can make from the diagnostic file is missing reply. For example if the Modbus1 in the example above was not present or turned on the diagnostic file would read following sequence: Modbus1 -> [01][03][00][00][00][02][C4][0B] Modbus1 -> [01][03][00][00][00][02][C4][0B] Modbus1 -> [01][03][00][00][00][02][C4][0B] ... The repeat count is determined by the number of Retry attempts entered in the object properties. 5) Starting from Lookout 4.5 (not available for Lookout Protocol Drivers) it is possible to log timestamp for each message, which can help to pair the messages with alarms in the AlarmWindow that are also timestamped. Add DiagnosticTimeStamp=1 line in the Lookout.ini file to the COM section. The default daytime format is "mm/dd/yyyy hh:mm:ss", to change the format to "hh:mm:ss.s" add DiagnosticTimeStampDateFormat=73 to the COM section. Here is an example of the COM section with all available switches: [COM1] DiagnosticFile=c:\temp\diag1.txt DiagnosticAllHex=1 DiagnosticTimeStamp=1 DiagnosticTimeStampDateFormat=73 (You can use NumericFormat object to examine the full list of codes that are supported by the DiagnosticTimeStampDateFormat). 6) You can create separate diagnostic file for each COM port, if you specify a different file in the respective COM sections. If you use the same file name all messages from different COM ports will be streamed to the same file. Related Links: KnowledgeBase: How Do I Log the Serial Port Data in Lookout 5? Attachments:
Report Date: 04/09/2001 Last Updated: 06/11/2004 Document ID: 288F1DJ6 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
