P
ar
t
2: C
omman
d
s
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 435 of 909
ENDS
End SWITCH Structure
APPLICATION:
Program execution and flow control
DESCRIPTION:
SWITCH formula...ENDS control block terminator
EXECUTION:
N/A
CONDITIONAL TO:
N/A
LIMITATIONS:
Requires corresponding SWITCH formula; can be executed only
from within a user program
READ/REPORT:
N/A
WRITE:
N/A
LANGUAGE ACCESS:
N/A
UNITS:
N/A
RANGE OF VALUES:
N/A
TYPICAL VALUES:
N/A
DEFAULT VALUE:
N/A
FIRMWARE VERSION:
5.x and later
COMBITRONIC:
N/A
DETAILED DESCRIPTION:
Each SWITCH formula must have a corresponding ENDS block exit statement. Regardless of
the execution path through the control block at run time, any program statement immediately
following ENDS is the common exit point branched to when processing the SWITCH...ENDS
control block.
NOTE:
There can only be one ENDS statement for each SWITCH statement.
The common exit point following ENDS is branched to when:
l
Encountering a BREAK
l
Encountering ENDS
l
The SWITCH formula value is not equal to any CASE number value, and there is no
DEFAULT statement label for the control block
ENDS is not a valid terminal command; it is only valid within a user program.
EXAMPLE:
SWITCH
x
CASE
1
("x=1",#13)
BREAK
CASE
2
("x=2",#13)
BREAK
CASE
3
("x=3",#13)
BREAK
ENDS
'This is the exit point for SWITCH...ENDS code block
Part 2: Commands: ENDS