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 #242 background imageLoading...
Page #242 background image
Part 2: Commands
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 242 of 909
NOTE: The following examples and descriptions use the single-character variables.
However, you can substitute the double- or triple-character variables, if desired.
EXAMPLE:
g=123 'Assign the value of 123 to "g".
Rg 'Report the value of g to the primary serial port.
PRINT("g=",g,#13) 'Print to the primary serial port.
PRINT1("g=",g,#13) 'Print to the secondary serial port.
END
Program output is:
123
g=123
These variables are 32-bit signed integers, so they are limited to whole numbers from
-2147483648 to 2147483647. Math operations that result in digits after the decimal point are
truncated toward zero. Therefore, the value 2.9 becomes 2, and the value -2.9 becomes -2.
If you assign or perform an operation that normally results in a value outside this range, the
Bs bit indicates an overflow and the operation aborts before assigning the value to the left of
the equal sign.
For modulo behavior, the operation must be promoted to a float and use the modulo operator
"%".
EXAMPLE:
c=123 'Sets initial value of c to 123.
Rc 'Reports 123; initial value of c.
RBs 'Reports 0; no error stored.
b=70000
c=b*b 'This will overflow.
Rc 'Reports 123; the value of c is unchanged.
RBs 'Reports 1; error is indicated.
Zs 'Clears error bit.
RBs 'Reports 0; no error stored.
a=-2147483648 'Used as modulo range.
c=((b*1.0)*b)%a 'Equation that promotes to a float internally
'and modulo divides.
Rc 'Reports 605032704; this is what is expected if
'the original value 'wrapped' on 32-bit boundaries.
RBs 'Reports 0; this does not cause an error.
Program output is:
123
0
123
1
0
605032704
0
Part 2: Commands: aaa...zzz

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