![background image](http://html1.mh-extra.com/html/omron/cs1-h-series/cs1-h-series_operation-manual_742526164.webp)
149
Structured Text (ST Language) Specifications
Appendix B
Processing Flow Chart
Usage
Use the CASE statement to execute different operations depending on specified integer values.
Description
If the
integer_equation
matches
integer_equation_value_n
,
expression_n
is executed.
if the
integer_equation
does not match any of
integer_equation_value_n
,
expression_m
is executed.
Precautions
• CASE must be used together with END_CASE.
• The result of the
integer_equation
must be in integer format (INT, DINT, LINT, UINT, UDINT, or ULINT).
• Statements that can be used in
expression_
@
are assignment statements, IF, CASE, FOR, WHILE, or
REPEAT.
• Multiple statements can be executed in
expression_
@
. Be sure to use a semicolon (;) delimiter between
multiple statements in an
expression
.
• Variables in integer format (INT, DINT, LINT, UINT, UDINT, or ULINT), or equations that return integer val-
ues can be specified in the
integer_equation
.
• When OR logic is used for multiple integers in the
integer_equation_value_n
, separate the numerical value
using a comma delimiter. To specify a sequence of integers, use two periods (..) as delimiters between the
first and last integers.
Examples
Example 1: If variable A is 1, variable X is substituted with numerical value 1. If variable A is 2, variable X is
substituted with numerical value 2. If variable A is 3, variable X is substituted with numerical value 3. If neither
of these cases matches, variable Y will be substituted with 0.
CASE A OF
1:X:=1;
2:X:=2;
3:X:=3;
ELSE Y:=0;
END_CASE;
Yes
Yes
Yes
No
No
No
Expression m
Expression n
Expression 2
Expression 1
Same as
selected
value 1?
Same as
selected
value 2?
Same as
selected
value n?
Содержание CS1-H Series
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ...viii TABLE OF CONTENTS...
Страница 15: ...xvi Application Precautions 4...
Страница 151: ...136 Procedures Section 3 2...
Страница 153: ...138 Data Types Appendix A...
Страница 177: ...162 External Variables Appendix C...
Страница 181: ...166 Revision History...