Sutron Corporation X-Link Operations & Maintenance Manual, Rev 1.63 5/24/2016 pg. 175
The data portion of a packet carrying the Sutron function code (function code 65,
or 0x41) contains a subcode and associated parameters to define the particular
function to perform. The subcode and its parameters are expressed using ASCII
characters. The functions that each sub-code performs are defined to be
stateless, and the burden of the transport is on the master station.
The following text defines the subcode functions, parameters, and responses.
18.4.1.
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
o
data
o
events
o
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. X-Link will never return more than 255 data bytes. 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 *, up to 255 bytes will be
returned. Regardless of the requested numbytes, only complete log records
are returned. Do not set numbytes to less than 64. Ideally, use * or 255.
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.
2
Get beyond file end.
6
Record not found.
7
Command format error