10ć11, 3 case – Rockwell Automation 1775-S4B,D17756.5.3 User Manual SCANNER/MSG HND User Manual
Page 114
Using Commands in Report Generation
Chapter 10
10Ć11
Definition: To call for a procedure to execute based on the value of an
expression.
Abbreviation: CA
Format: CA (
Description: The case command allows you to call one of several
procedures depending on the value of an expression. The expression must
generate values from zero to one less than the number of procedure names
on the case command line. For example, if the number of procedure names
is 5, then the allowed values from the expression are 0 to 4. Negative
numbers and values greater than 4 generate errors. When the expression
returns a value, the corresponding procedure executes. For example, if the
expression returns a 1, the second procedure on the case command line
executes. Remember, if the expression returns a 0, the first procedure after
the case command expression executes.
NOTE: Your list of procedures must be on the case command line.
Examples using the case command:
If you enter:
CA (A+@HR-57) @I @J @K
In the procedure above, the case command line returns a value between 0
and 2 for the expression A+@HR-57.
If the expression returns:
Then the 1775ĆS4B scanner executes:
0
1
2
@I
@J
@K
If you enter:
CA ($I:12/010) @OFF @ON
The 1775-S4B scanner tests bit I:12/010, and returns 0 or 1.
If the expression returns:
Then the 1775ĆS4B scanner executes:
0
1
@OFF
@ON
10.3.3
Case