Model 574 Programmable Counting System (PCS)
134 - GSE Scale Systems
format line contains only one parameter, a match has not
occurred, and the macro is not executed.
Multiple Matches
The input specifications are checked in order from one to
eight. If the received data could match more than one
input specification, the first one checked that generates a
match has priority. Once a match occurs, the comparison
stops. The other input specifications are not checked.
Disabling the Input Interpreter
When enabled, the input interpreter software intercepts
all received data, except for the following circumstances:
Input interpreter is disabled in the setup mode, parameter
100 and above. To download a new setup to the scale
while input interpreter is enabled, you must enter the
setup mode manually by entering
"100<select>23640<id><enter>" from the scale's
keypad.
The macro commands %G, %W and %Y suspend the
input interpreter while waiting for operator input.
The input interpreter is suspended during database
unloads.
Under these conditions, received data is accepted directly
into the scale's command/entry buffer.
Using an I.D. as a Parameter
When I.D.s (parameter 21 through 26) are used as
parameters, spaces in the received data are treated
different than other characters. Leading spaces in the
received data are ignored. The first non-space character
is the first character stored in the I.D.. Data will continue
to be stored into the I.D. until the next space, the end of
the received data, or the maximum size of the I.D. is
reached.
Advanced concepts
This section is included for use by programmers
knowledgeable in the "C" programming language. If this
does not include you, feel free to skip this section. An
understanding of the concepts presented here is not
necessary to using the input interpreter. It will however,
allow a higher degree of flexibility in your custom
applications.
For Programmers Only!
As you read the previous Trailing Data Section, you
probably thought to yourself, "That %5s looks like a
format string from a C language printf or scanf
function!". You're right! A derivative of scanf is the
heart of the line type input interpreter specification with
parameters. This knowledge can be useful, as we'll see
below.
There are three components used by the input interpreter:
the input string, the format string and a parameter
address list. The input string consists of the data up to but
not including the terminating character.
The format string is derived from the format line which
is input in the setup mode and stored in EEPROM. At
power-up or when exiting the setup mode (when the
display says "Doing Setup") the format line is scanned
and all parameters are replaced by format codes
appropriate to their type. The address list is also built so
that scanf will know where to store the data for each
parameter. One additional address is added to the end of
the list, that of the dummy parameter for the trailing data
previously discussed.
The format code for most parameters is "%f", for floating
point data. The ID parameters are strings whose length is
programmable through the setup mode, so their format
code is "%Xs", where X is the programmed length, (i.e.
"%20s" for a string length of 20). The time/date
parameters, 50 through 54 are unsigned long type data,
so their format code is "%lu".
It is possible to override these format codes by inserting
a "%" immediately before the parameter in the format
line. Then you can enter your own format code ahead of
the "%". If you have multiple parameters you have to
insert your format codes ahead of the first overridden
parameter's format code.
This can be useful for parsing fixed-width data that
contains no delimiters, because the maximum field width
can be specified. For example, "%5f%6f%<pa=VAR1>
%<pa=VAR2>" will store the first 5 characters of data in
floating point format into VAR1, and the next 6
characters in floating point format into VAR2.
An interesting but not very useful application is to
override the format for an unsigned long parameter, 50
through 54, with "%lx". This will interpret the incoming
data as hex! "%lo" will interpret it in octal!
Back to more worthwhile things now, an asterisk
immediately following the percent sign will cause a field
to be scanned but not stored. So if you know that there is
a floating number in the incoming data that you want to
ignore, use "%*f" to skip over it, or to skip a single
character use "%*c".