Description
The CASE
instruction consists of an INT
data
type expression (the "selector") and a list of instruction groups.
Each group is provided with a tag which consists of one or several
whole numbers (INT
, DINT
, UINT
, UDINT
) or ranges of whole number
values. The first group is executed by instructions, whose tag contains
the calculated value of the selector. Otherwise none of the instructions
will be executed.
The OF
instruction indicates
the start of the tag.
An ELSE
instruction may
be carried out within the CASE
instruction, whose
instructions are executed if no tag contains the selector value.
The END_CASE
instruction marks the end of the
instruction(s).
Example CASE...OF...END_CASE
ExampleCASE...OF...END_CASE
