GSE Scale Systems - 133
Chapter 15 Communications Technical Reference Manual
directly. When the name of the parameter you want is
displayed, pressing <ENTER> will insert it into the
format line at the edit position.
Control codes are inserted by entering ".XXX", when
XXX is the decimal code for the control code. For
example, ".013" <ENTER> inserts a carriage return at
the edit position.
Use caution when using a "%" in the format line. In
order to match a "%" in the received data, the format line
must contain two percent signs, or "%%". To enter two
percent signs in the setup mode requires that 4 percent
signs be sent to the scale. A single percent sign has a
special meaning for the input interpreter, which is
discussed in the section For Programmers Only.
Input Specification Macro Number
The macro number is programmed at Parameter 9X2,
(where X is the input specification number, 1 through 8).
Here you select the number of the macro you want to
initiate when a match is found. The choices are 0
through 15 (macro number) and 16 (no macro). Enter the
number of your selection followed by the <ENTER>
key to select a specific selection or press <ENTER> by
itself to scroll through the selections.
Operation
There are a few aspects of the Input Interpreter which
deserve to be highlighted. Failure to fully understand
these concepts may result in unacceptable operation of
the Input Interpreter.
Termination Character
How you handle your terminating character is very
important! Let's assume that you want the 574 to execute
a macro when it receives the word "START" through it's
serial port. So you set up the input specification #1 to be
line type, the format line to "START" and the macro
number to 0. The terminating character is set to 13,
which is a carriage return.
This setup will work fine if what is sent to the scale is
"START" followed by a carriage return. But if a line
feed is sent following the carriage return, this will only
work the first time, because the linefeed will remain in
the buffer and be taken as the first character of the next
transmission.
There are two ways around this. First, if you know the
transmissions will always include a linefeed, then set the
terminating character to 10 (linefeed) and insert the
carriage return at the end of the format line.
Alternately, you could set up another input specification
to be character type, with a linefeed as the format line,
and no macro. This way, the linefeed will simply clear
the buffer, which was already done by the carriage
return, so in effect the linefeed is ignored. This would
allow all line type input specifications to handle
transmissions with or without a linefeed.
Multiple Parameters
Any Line type input specification may contain several
parameters. Suppose you want the scale to receive and
interpret the following transmission:
T1.234,PWT.05<CR>
The objective is to store "1.234" into the TARE register,
".05" as the PIECE-WEIGHT, and execute a macro when
done. This can be accomplished by setting up an input
specification as line type, with a format line of
"T<pa=TARE>,PWT<pa=APW>", macro number set to
0, and the terminating character set to 13 (carriage
return). Here <pa=TARE> means to insert the parameter
TARE at that point in the format line.
If we receive an incomplete transmission, for example:
T1.234,PW<cr> the data "1.234" will be stored in the
TARE register, however nothing will be stored in the
PIECE-WEIGHT register. The macro will not be
executed, because a match occurs only when data is
stored into all the parameters in the format line.
In some applications, you may not want the value in the
parameters to change unless a match has occurred. This
can be accomplished by setting up the input specification
to store the data into a unused variable (VAR), and have
the macro copy the value into the desired parameter
(TARE, QUANTITY, etc...) using the "%C" macro
command.
Trailing Data
In an input specification with at least one parameter, any
data following the last parameter's data but preceding the
terminating character will be ignored. For example: a
format line of "T<pa=TARE>" will match received data
of "T1.234" and "T1.234 hello there".
To prevent this, "%5s" may be appended to the end of
the format line, as in "T<pa=TARE>%5s". What this
does is tell the input interpreter to store up to five
characters of trailing data in a dummy parameter. If the
received data contains trailing data, data will be stored
into two parameters, TARE and the dummy. Since the
SECTION - 15.9