Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 465 of 909
GOTO(label)
Branch Program Flow to a Label
APPLICATION: Program execution and flow control
DESCRIPTION: Branch program execution to statement C{number}
EXECUTION: Immediate
CONDITIONAL TO: C{number} previously defined
LIMITATIONS: N/A
READ/REPORT: N/A
WRITE: N/A
LANGUAGE ACCESS: N/A
UNITS: N/A
RANGE OF VALUES: Input: 0–999
TYPICAL VALUES: Input: 0–999
DEFAULT VALUE: N/A
FIRMWARE VERSION: 5.x and later
COMBITRONIC: GOTO(0):3
where ":3" is the motor address — use the actual address or a
variable
DETAILED DESCRIPTION:
CAUTION: Extensive use of IF statements and GOTO branches can quickly
make your programs impossible to read or debug. Learn to organize your code
with one main loop using a GOTO and write the rest of the program with
subroutines (GOSUB). For details, see GOSUB(label) on page 463.
The GOTO{number} command unconditionally redirects program execution control to another
part of the program marked by the label C{number}.
NOTE: If a GOTO jump is attempted to a label that does not exist, the GOTO is
ignored and the next program line is executed. This can create problems because it
would likely not be the correct command order. Therefore, be certain that every
GOTO has a corresponding label.
The GOTO{number} command is valid for both serial channels and within a user program.
However, take care not to issue a GOTO{number} command unless the corresponding C
{number} label exists within the stored program.
Part 2: Commands: GOTO(label)