Instruction manual
SECTION 8. FILES, PROTOCOLS, AND UTILITIES
8-6
Send Ack − The send acknowledgment action
is done in response to the Record Rdy event,
after the record is secured. In Send Ack the
client forms an acknowledgment record from
information taken from the data record and
sends it to the server.
Stop − It is important to note that the Stop event
could occur at any time. If it occurs while in the
Session Open state then the pipe or socket
should be closed (Close Session) before
program termination.
SERVER STATE DIAGRAM:
Wait For Record Available − In this state the
server is waiting for the next record to become
available from the server's data record source.
Wait For Ack − In this state the server is waiting
for the client to acknowledge that it has secured
the record. If an acknowledgment for the wrong
record comes in, the server will just continue to
wait. After waiting for a minute, the server will re-
issue the data record and wait again.
Advanced Rec − The advance record action is
executed after the server receives a valid
acknowledgment record from the client while in
the Wait For Ack Record state. This is the
point at which the server makes a note of the
fact that the client has secured a record and the
server relinquishes responsibility for the well
being of that record. The server moves on to
the next record.
Stop − Note that in the Session Open and
Server Registered states there are "exit"
actions that need executed on the Stop event.
Communication between the client and server is
conducted using ASCII records where each
record is terminated by a Carriage Return - Line
Feed (CRLF) pair. Record length varies quite a
bit. For each datalogger record there is exactly
one ASCII record. Because of the Block Mode
Protocol used to communicate with dataloggers,
the maximum size datalogger record is limited
to something less than 1024 field values.
Figuring 6 characters per value, 13 characters
per field name, and 6 characters per field type
designation, a single ASCII record could come
out to be a little longer than 25K characters.
Typical datalogger programming will produce
record sizes of about 150 characters. It would
not be unusual to see records that contain one
or two hundred values that would come out to a
length of 2 to 3K characters in ASCII.
To express the format of ASCII records used for
communication between the client and server,
we will use Extended Backus Naur−Formalism
(EBNF), a notation used to express syntax.
This notation was adopted from Wirth
3
, and
extended here a little more by adding a
repetition count preceding some brackets.
EBNF is summarized in the following table
where A, B and C are syntactic entities of the
language being described. Where one of these
entities is a literal string it is enclosed in
quotations.
TABLE 8.5-1. ASCII Record Format
Expression Means
A = BC The construct A consists of B followed by C.
A = B | C A consists of B or C.
A = [B] A consists of B or nothing.
A = {B} A consists of any number of B's including none
( ) Brackets used to group sections of an expression
The EBNF description of LDEP syntax is as follows:
Record = (DataRecord | AckRecord) CRLF.
DataRecord = StationName "," TableName " ("FieldSpecs ") VALUES (" FieldValues ")".
AckRecord = StationName "," TableName "," RecordNumber.
FieldSpecs = FieldName " " FieldType {"," FieldName " " FieldType}.
FieldValues = FieldValue {"," FieldValue}.
StationName = Label.
TableName = Label.
FieldName = Label.
Label = Letter { Letter | Digit }.
FieldType = ( "TIMESTAMP" | Decimal | "FLOAT" | "INTEGER" | VarChar ).