Model 574 Programmable Counting System (PCS)
174 - GSE Scale Systems
the occurrence of an ENDIF (%E) or an ELSE (%N)
MACRO command. Execution of the macro commands
will resume after either of these commands.
If an ELSE or ENDIF command does not exist in the
remainder of the macro, then the remainder of the macro
is skipped and the macro terminates in the normal
manner. Specifically, if the macro was called from
another macro, then macro execution will resume in the
calling macro after the point where the 2nd macro was
called.
If an ELSE command is used, the ENDIF has no effect
except to define the point in the macro whereafter
commands will be executed regardless of the last IF
commands effects.
While this capability is quite powerful, there are some
limitations. The nesting of 'IF' statements is allowed,
however only one 'ENDIF' (%E) is required. All
previous 'IF' statements are considered completed at the
occurrence of an 'ENDIF'. Also, all ELSE statements
apply equally to all previous IF statements which have
not yet been followed by an ENDIF.
If nested IF statements are required for an application,
the nested IF may occur within a called macro, since that
macro will not be called if the condition to call it did not
occur.
Refer to the following example:
Simple Branching Example:
12%O Test if setpoint 12 is active...
-OK!-%P If so, display "OK" message for one
second.
%N ELSE (otherwise)
OutOfSpec!%W Display "OutOf Spec!" warning
until a key is pressed.
%E End of IF statement.
In the preceding IF example, IF setpoint 12 was active
then the prompt "-OK-" is displayed for one second. If
setpoint 12 was deactive, the prompt "Out Of Spec!" is
displayed until the operator presses any key.
A More Complex Branching Example:
1%O IF Setpoint #1 is activated...
2%O IF Setpoint #2 is activated...
3%O IF Setpoint #3 is activated...
The next two statements would be executed only if
setpoints 1, 2, and 3 were activated:
5%t set tare wt to 5#.
7%A ACTIVATE SETPOINT #7.
%N ELSE
These next two statements would be executed only if
setpoints 1, 2, or 3 were de-activated:
10%t set tare wt to 10#.
8%A ACTIVATE SETPOINT #8.
%E End if statement.
The next statements would always be executed,
regardless of setpoints 1, 2, and 3's status.
4%s Select gross total mode.
0%e Clear gross total.
16.14 Macro Debug: P64200
The Macro Debug feature records steps and branches that
are taken during macro execution. If the expected results
are not achieved during the execution of a macro, this
info mode may be accessed to determine exactly which
branches were taken. This is often very helpful during
initial macro debug of complex macro operations.
The recorded macro steps may either be viewed on the
display or sent out on of the serial ports to a computer or
printer. The macro debug mode operates as follows:
a) When first accessing the Macro Debug mode,
the display will momentarily show P64200
"Macro Debug". Then after one second, if
there is any macro execution history in
memory, then the last executed macro
command will be shown. Please note that the
entire history buffer is cleared whenever a
macro is changed and every time the unit
performs its setup (display reads "Doing
Setup") which happens upon power-up and
when saving changes.
b) The last two digits of the main numeric display
indicates the macro number where the macro
command was executed.
c) The top line on the dot matrix display shows
the offset counter which indicates the distance
from the beginning of the macro where the
command is located.
d) The bottom line shows the one single element
of the macro at the current position in the
history buffer, such as "%G", "1", or "A".