GSE Scale Systems - 173
Chapter 16 Macro Programming Operations Technical Reference Manual
to store the initial data:
0,80%C Copy gross wt to var #0.
11,51%C Copy current time to alarm 1.
then later on:
0,80%- Subtract current gross wt from
previously saved gross wt.
11,51%- Subtract previously saved time from
current time.
51,81%C Copy elaplsed time, in hours, to var
#1. (Note that math cannot be
performed on a mix of variable types,
ie a time type and a regular number.)
3600;81%/ Divide time difference by the number
of seconds per hour. Note that division
was performed after copying to the var
in order to maintain the fractional
portion of an hour!
80,81%/ Divide weight difference by elapsed
time to get change in weight per hour.
Also, the alarms may be selected as a
parameter in a custom transmit setup.
16.12 Prompting Commands
A few of the commands listed in Table 28 include in
their description a reference to an "optional (message)".
This means that if a message is included in the macro just
before one of these commands, then that message will be
displayed to the operator while that macro command is
being executed and until something different is
displayed. When these prompting commands are
displaying their prompt, the weight conversion process is
being performed.
16.13 Branching Commands
There are two methods of branching within a macro.
Both are described below
TAG and JUMP commands
This pair of commands is normally used when a set of
macro commands must be executed multiple times. The
TAG (%T) command is inserted into the macro point in
the macro where the execution is to resume after a JUMP
(%J) command. The %J command is inserted in the
macro at the point where execution is to loop back to the
TAG command. Normally a JUMP is located within an
IF statement in order to prevent a never ending loop.
However there are several other methods of achieving
this goal.
Basic looping example:
%T Tag this position in the macro in order
to jump back to this point later on.
Fill-ing..%I Perform weight conversion process
once, while displaying prompt.
1%O If setpoint 1 is activated...
%J Jump to the tagged spot in this macro.
%E End of the "IF" statement.
%S SOUND beeper.
DONE%P Display "DONE" message for one
second.
The preceding example shows how a branch can be used
to indicate to the operator the current state of a process
control application. While the setpoint is active, the
filling is occurring. The JUMP command keeps looping
back and re-displaying the message until the setpoint
becomes deactivated. When it does, the message
"DONE" is displayed for one second.
Note that this same effect could be achieved if the point
to be branched to was at the beginning of a macro by
simply using the GOTO command, #%^. However many
times more efficient use of the macros can be achieved
by looping back into the middle of a macro.
However, be aware that the TAG and JUMP commands
cannot be used to loop between different macros. Both
the TAG and JUMP must occur within the same macro.
IF Statements
The IF type MACRO commands can be quite useful in
order to allow varying conditions to affect which
MACRO commands are executed and which are skipped.
The operation of these commands are fairly simple. The
rules are listed below:
a. If the tested condition is found to be TRUE then:
The subsequent commands in the MACRO are executed
up until an ELSE (%N) command is encountered.
If an ELSE (%N) command is encountered before an
ENDIF, the macro will skip subsequent commands
between the ELSE and the ENDIF.
Once an ENDIF is encountered, the IF statement is
completed. Any subsequent ELSE or ENDIF commands
would have no effect unless they follow another IF
statement.
b. If the tested condition is found to be FALSE then:
The subsequent commands in the macro are skipped until
SECTION - 16.11