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 #383 background imageLoading...
Page #383 background image
Part 2: Commands
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 383 of 909
The first line, SWITCH x, tells the SmartMotor™ that it is checking the value of the variable x.
The second line, CASE 1, begins the section of code that tells the SmartMotor what to do if x is
equal to 1. Similarly, the eighth line, CASE 3, tells what to do if x=3. Finally, DEFAULT tells
what to do if none of the CASEs match the value of x.
EXAMPLE:
a=20
WHILE a
SWITCH a-12
CASE -4 PRINT("-4 ") BREAK
CASE -3 PRINT("-3 ") BREAK
CASE -2 PRINT("-2 ") BREAK
CASE -1 PRINT("-1 ") BREAK
CASE 0 BREAK
CASE 1 PRINT("+1 ") BREAK
CASE 2 PRINT("+2 ") BREAK
CASE 3 PRINT("+3 ") BREAK
CASE 4 PRINT("+4 ") BREAK
DEFAULT PRINT("D ")
ENDS
a=a-1
LOOP
Program output is:
D D D D +4 +3 +2 +1 -1 -2 -3 -4 D D D D D D D
RELATED COMMANDS:
BREAK Break from CASE or WHILE Loop (see page 326)
CASE formula Case Label for SWITCH Block (see page 355)
ENDS End SWITCH Structure (see page 435)
SWITCH formula Switch, Program Flow Control (see page 727)
Part 2: Commands: DEFAULT

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