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 #191 background imageLoading...
Page #191 background image
Part 1: Programming
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 191 of 909
GOTO(label) and GOSUB(label) may be used where label can be a variable, a specific number
or a single operand such as a+b, x-5, etc.
NOTE: Nested parenthesis are not permittedfor example, GOTO(IN(3)).
WHILE 1
x=IN(W,0,15) 'precalculate to prevent parenthesis in GOSUB()
IF y!=x
y=x
GOSUB(15-x) 'simple single operand math only
ENDIF
LOOP
SWITCH, CASE, BREAK, ENDS Examples
The following code shows the proper use of the SWITCH, CASE, BREAK and ENDS commands.
For more details on these commands, see SWITCH, CASE, DEFAULT, BREAK, ENDS on page
186.
C500
#define FiveValues INA(V1,3)/1000
#define CheckPot 501
WHILE 1
IF x!=FiveValues
GOSUB(CheckPot)
ENDIF
LOOP
RETURN
C501 'CheckPot (Check Potentiometer)
y=FiveValues
SWITCH FiveValues
CASE 0 PRINT("Value ",y,#13) BREAK 'Note: Defines not allowed in PRINTs
CASE 1 PRINT("Value ",y,#13) BREAK
CASE 2 PRINT("Value ",y,#13) BREAK
CASE 3 PRINT("Value ",y,#13) BREAK
CASE 4 PRINT("Value ",y,#13) BREAK
ENDS
x=FiveValues
RETURN
Part 1: Programming: SWITCH, CASE, BREAK, ENDS Examples

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