P
ar
t
1: P
rog
ra
m
ming
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 196 of 909
Introduction
Variables are data holders that can be set and changed within the program or over one of the
communication channels. Although most of the variables are 32-bit signed integers, there are
also eight floating-point variables. All variables are represented by lower-case text.
Variables are stored in volatile memory, meaning that they are lost when power is removed,
and they default to zero on power-up. If they need to be saved, you must store them in the
EEPROM (nonvolatile memory) using the VST (Variable Store) command. For more details,
see Variable Commands on page 196.
There are three sets of integer variables, each containing twenty-six, 32-bit signed integers
and referenced by:
l
a,b,c,…,x,y,z
l
aa,bb,cc,…,xx,yy,zz
l
aaa,bbb,ccc,…,xxx,yyy,zzz
There is an additional set of fifty-one, 32-bit signed integers in array form, al[i],i=0…50.
The eight floating-point variables are also in array form and referenced by af[i],i=0…7.
a = #
Set variable a to a numerical value
a = formula
Set variable a to value of a variable or formula
For more details on array variables, see Array Variables on page 198.
Variable Commands
The following commands are used to load and store variables. For more details, see Part 2:
SmartMotor Command Reference on page 238.
EPTR=formula
Set EEPROM Pointer in Bytes, 0-32767
To read or write into this memory space, it is necessary to properly locate the pointer. This is
accomplished by setting EPTR equal to the offset in bytes. EEPROM locations above EPTR equal
to 32767 contain important motor information and are read-only.
VST(variable,number)
Store Variables
Use the VST command to store a series of variables starting at the pointer. In the "variable"
space of the command, put the name of the variable; in the "number" space, put the total
number of sequential variables that need to be stored. Enter a one if just the variable
specified needs to be stored. The actual sizes of the variables are recognized automatically.
Do not put the VST command in a tight program loop or you will likely exceed the 1M write-
cycle limit, which will damage the EEPROM.
NOTE:
Keep the VST command out of tight loops to avoid exceeding the 1M write-
cycle limit of the EEPROM.
Part 1: Programming: Introduction
Содержание SmartMotor
Страница 1: ...Developer s Guide Class 5 Later SmartMotor Technology with TM ...
Страница 909: ...PN SC80100003 002 Rev L ...