Reverse DMX Channel Byte Order Example
Moog Animatics Class 5 SmartMotor™ DMX Guide, Rev. C
Page 42 of 46
' ( ab[43]=0)
ELSEIF
n==3
' 24-bit (unsigned) reverse order:
ab[40]=aw[12]
ab[41]=aw[11]
ab[42]=aw[10]
' ( ab[43]=0)
ELSEIF
n==4
' 32-bit reverse order:
ab[40]=aw[13]
ab[41]=aw[12]
ab[42]=aw[11]
ab[43]=aw[10]
ENDIF
p=al[10]
'Set p equal to al[10], which covers ab[40]-ab[43]
PT
=p*m
'Position target is total for data collected.
G
'Start moving.
ENDIF
LOOP
END
'End main program.
'===================================================================
'Error routine code (place here):
C0
END
RETURNI
'===================================================================
'Home to hard stop:
C100
'Parameter settings (edit as required)
rr=-1
'Homing direction
vv=10000
'Homing speed
aa=1000
'Homing acceleration
ee=100
'Homing error limit
tt=3000
'Homing torque limit
hh=4000
'Homing offset
AMPS
=512
'Reduce the motor power. MAX = 1023 (default)
VT
=vv*rr
'Set home velocity
ADT
=aa
'Set home accel.
MV
'Set to Velocity mode.
ZS
'Clear previous errors.
T
=tt*rr
'Preset torque values.
G
'Begin move toward hard stop.
WHILE
ABS
(
EA
)<ee
LOOP
'Loop while position error is within limit.
MTB
'Mode Torque Break to stop.
MT
'Switch to Torque mode in case of bounce off hard stop.
G
'Start motion.
WAIT
=50
'Wait 50 milliseconds.
O
=hh*rr
'Set origin to home offset.
AMPS
=1023
'Set power back to max.
MP PT
=0
G TWAIT
'Set motor to zero.
RETURN