Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 782 of 909
EXAMPLE: (Storing and retrieving five consecutive 32-bit standard variables)
a=10 'Assign values to the variables "a" thru "e"
b=11
c=12
d=13
e=14
EPTR=100 'Set EEPROM pointer to 100
VST(a,5) 'EPTR will increment to 100+(4*5)=120
'(4 bytes x 5 stored)
EPTR=100 'Set EEPROM to 100 again
VLD(v,5) 'Load from location 100 into the variable "b"
Rv 'Will report 10
Rw 'Will report 11
Rx 'Will report 12
Ry 'Will report 13
Rz 'Will report 14
EXAMPLE: (Storing seven 16-bit numbers into EEPROM)
i=10 'Using the variable "i" as index to an array variable
j=7 'Using the variable "j" as the number of sequential
'variables you wish to store
aw[i]=1111
aw[i+1]=2222
aw[i+2]=3333
aw[i+3]=4444
aw[i+4]=-1111
aw[i+5]=-2222
aw[i+6]=-3333
EPTR=3200 'Set EEPROM memory pointer location to 3200
VST(aw[i],j) 'Starting at address 3200, store "j" or seven
'sequential variables beginning with aw[i]
'into EEPROM
NOTE: The EEPROM value automatically increments for each value stored or read.
The EPTR value after the above execution will be set to 3200+(7 variable * 2 bytes
each) or 3214.
Part 2: Commands: VLD(variable,number)