Get Log Command
The Get Log subcode is used to retrieve log data from the unit. The format of the
command is as follows:
GL,logfilename,datetime,recordID,numbytes
•
The logfilename can be used to return log entries of specific types. The available
types are
data, events
, and
all
.
•
The datetime value must be in the following format: MM/DD/YYYY
HH:MM:SS.
•
The numbytes value refers to the number of data bytes from the log entry to
include in the response, not the number of bytes to store in the return packet.
Since the master station or transport medium may be limited in the number of
bytes that can be handled in a single packet, the numbytes value should be sized
small enough to allow for header and CRC information, as well as translation to
ASCII if that is the selected protocol (the ASCII protocol uses two bytes to
represent every data byte). If numbytes is *, the all log records found will be
returned. Regardless of the requested numbytes, only complete log records are
returned.
The format of the reply is as follows:
GLR,status,recordID,numbytes,data[numbytes,data]
The value of status can be any of the following values:
Value Description
0 Ok.
1
File not found.
6
Record not found.
7 Command
format
error
The datetime value in the response message is the datetime of the returned record and,
therefore, may be different from the datetime in the GetLog command statement.
The data to the end of the file can be read by leaving datetime at the desired starting point
and incrementing recordID until the status indicates record not found. The
[numbytes,data] represents an additional record of data if there is room in the message.
73