Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 848 of 909
SDOWR(eee,x1A01,0,1,1) GOSUB10 ' set Transmit map number of
' entries x01
SDOWR(eee,x1801,1,4,1073742209) GOSUB10 ' set Transmit Com Parameter
' COB-ID x4000 0181
ENDIF
SDOWR(fff,x1400,1,4,-2147483263) GOSUB10 ' set Receive Com Parameter start
' x8000 0181
SDOWR(fff,x1600,0,1,0) GOSUB10 ' set Receive Map number of
' entries x00
SDOWR(fff,x1600,1,4,570950432) GOSUB10 ' set Receive Map x2208 03 20
SDOWR(fff,x1600,0,1,1) GOSUB10 ' set Receive Map number of
' entries x01
SDOWR(fff,x1400,1,4,385) GOSUB10 ' set Receive Com Parameter
' COB-ID x0000 0181
' Mapping complete.
' Set other objects in follow motor relating to follow mode.
SDOWR(fff,x2207,0,4,rrr) GOSUB10 ' set encoder modulo limit
SDOWR(fff,x2209,0,2,0) GOSUB10 ' set follow control to nominal state.
SDOWR(fff,x220A,0,2,100) GOSUB10 ' set MFMUL
SDOWR(fff,x220B,0,2,100) GOSUB10 ' set MFDIV
SDOWR(fff,x220C,0,4,20000) GOSUB10 ' set MFA control word x2209
' determines if master or slave units.
SDOWR(fff,x220D,0,4,10000) GOSUB10 ' set MFD control word x2209
' determines if master or slave units.
NMT(0,1) GOSUB10 ' Broadcast to whole network to go
' to operational state.
SDOWR(fff,x6060,0,1,-11) GOSUB10 ' set Trajectory Mode to Mixed FOLLOW
SDOWR(fff,x6040,0,2,6) GOSUB10 ' set Control word in Motor 2
SDOWR(fff,x6040,0,2,7) GOSUB10 ' set Control word in Motor 2
SDOWR(fff,x6040,0,2,15) GOSUB10 ' set Control word in Motor 2
PRINT("Setup complete",#13)
IF CADDR==fff
' If the network master happens to be the follow motor (which is expected
' in this demo by default).
WAIT=3000
PRINT("Follow motor: stopping X.",#13)
X(2) ' Stop following
WAIT=1000
PRINT("Follow motor: re-starting X.",#13)
G(2) ' Restart following
ELSE
' Some other motor is the follow motor.
' ...
ENDIF
ELSEIF CADDR==eee
' We are a motor pretending to be the encoder.
WAIT=500
Part 3: Examples: CAN Bus - Time Sync Follow Encoder