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 #243 background imageLoading...
Page #243 background image
Part 2: Commands
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 243 of 909
It is also possible to use these variables in certain array index operations:
EXAMPLE:
a=10
Raw[a]
Raw[a+1]
The following are other restrictions:
l
If a+b exceeds 32 signed bits, the operation c=a+b will abort, and an error flag is set.
l
If a-b exceeds 32 signed bits, the operation c=a-b will abort, and an error flag is set.
l
If a*b exceeds 32 signed bits, the operation c=a*b will abort, and an error flag is set.
The system flag, Bs, is set. Note that many different types of command errors will also
set the Bs bit. The RERRC command can be used to retrieve the last command error. For
a math overflow, that is error code 23. For details on the RERRC command, see ERRC on
page 441.
If one of these variables is used with a variable of another type, it will be appropriately
converted (the variable will be "type cast").
For example, assigning the variable aw[27]=yy directly stores the 16 least-significant bits of
yy to aw[27]. The sign bit of yy is not considered, the sign is determined based on bit 15 of yy.
The higher bits of variable yy are ignored.
Similarly, if the left-hand variable is an 8-bit one, such as ab[167], only the lowest 8 bits are
preserved. The sign is determined by bit 7 of the value on the right-side of the equals sign.
Conversely, if the left-hand value is a 32-bit variable and the right-hand side contains 16-bit
variables, the 16-bit variables will be "upgraded" to 32 bits. The sign is preserved when
casting to a longer format. For example, in the equation cc=ab[4]-aw[7], both ab[4] and aw
[7] are converted into 32-bit numbers before the subtraction occurs.
In the SmartMotor language, all user variables are written as lowercase letters, while
functions and commands have at least one uppercase character. The term "a" is a
general-purpose variable, while "A" is the acceleration function. As previously described, any
user variable can be assigned a value through an equation.
EXAMPLE:
c=123 'Assign the value of 123 to "c".
d=345 'Assign the value of 345 to "d".
e=-599 'Assign the value of -599 to "e".
f=346 'Assign the value of 346 to "f".
g=678678 'Assign the value of 678678 to "g".
All user variables are initialized to the value 0 at power up or on execution of the Z
system-reset command. Other than by direct assignment, this is the only way the SmartMotor
sets all of the user variables to 0. Issuing a RUN command does not perform this automatic
initialization. For this reason, it is better to test a program, whether it is auto-execution or
not, by power cycling the SmartMotor or issuing the Z system-reset command.
NOTE: To understand the relationship between user assigned letter variables a-z,
aa-zz and aaa-zzz, and variable arrays ab[], al[] and aw[], see Array Variable
Memory Map on page 858. The arrays and the letter variables do not overlap in the
Class 5 motor.
RELATED COMMANDS:
R
ab[index]=formula Array Byte [index] (see page 245)
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