EasyManuals Logo

Moog SmartMotor User Manual

Moog SmartMotor
909 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #423 background imageLoading...
Page #423 background image
Part 2: Commands
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 423 of 909
ELSEIF formula
IF-Structure Command Flow Element
APPLICATION: Program execution and flow control
DESCRIPTION: Alternate evaluation of IF...ENDIF control block
EXECUTION: Immediate
CONDITIONAL TO: Value of formula and previous IF formula or ELSEIF formula
LIMITATIONS: Must reside with IF formula...ENDIF program control block; can
be executed only from within 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:
An IF formula's control block may optionally include any number of ELSEIF formulas to
perform multiple evaluations in a specified order. For example, ELSEIF would be used when
you want the SmartMotor™ to do one thing if the variable g=43, another if g=43000, and
another if g=-2.
For more detail about valid formulas that can be used, see IF formula on page 475.
EXAMPLE:
IF g==43
PRINT("Gee...43!",#13)
ELSEIF g==43000
PRINT("43 grand for me.",#13)
ELSEIF g==-2
PRINT("2?",#13)
ENDIF
The first line checks to see if g is equal to 43. If so, the string "Gee...43!" is sent out the
primary serial port and the IF control block terminates. If g is not 43, the program goes on to
test if g is 43000. If it is, then "43 grand for me." is sent out the primary serial port and the IF
control block terminates. Similarly, if g is not 43000, then the program goes on to test if g is -
2. If it is, then "-2?" is sent out the primary serial port and the IF control block terminates.
An IF control block can have multiple ELSEIF statements. If such an ELSEIF clause exists and
the language interpreter evaluates the IF formula to be false (zero), then the program will
branch immediately to first ELSEIF formula.
Part 2: Commands: ELSEIF formula

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Moog SmartMotor and is the answer not in the manual?

Moog SmartMotor Specifications

General IconGeneral
BrandMoog
ModelSmartMotor
CategoryServo Drives
LanguageEnglish

Related product manuals