Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 845 of 909
' master. But you can make it a 3rd-party
eee=2 ' encoders address
EIGN(W,0) ' Turn off hardware limits!!!!!
ZS ' Clear faults.
O=0
WAIT=100
a=ADDR+128
PRINT(#a) ' Send our own address char to make sure downstream motors
' don't interpret program output as commands.
IF CADDR==mmm
' We are the master, take over the show.
CANCTL(17,3) ' Enable SDO and NMT commands.
PRINT("Checking for encoder ready: ",#13)
t=0
WHILE 1
vvv=SDORD(eee,x1000,0,4) ' Read device type from encoder.
IF CAN(4)==0 ' Check error for a successful read. A timeout is very
' likely until remote device is ready.
IF (vvv&65535)==406 ' Check lower 16-bits for profile type of device.
PRINT("Found encoder",#13)
SWITCH vvv/65536 ' We want to look at the upper 16-bits.
CASE 1
PRINT("Single-turn absolute rotary encoder.",#13)
t=1
BREAK
CASE 2
PRINT("Multi-turn absolute rotary encoder.",#13)
t=1
BREAK
CASE 3
PRINT("Single-turn absolute rotary encoder ")
PRINT("with electronic turn-count.",#13)
t=1
BREAK
CASE 4
PRINT("Incremental rotary encoder.",#13)
t=1
BREAK
CASE 5
PRINT("Incremental rotary encoder with electronic counting.",#13)
t=1
BREAK
CASE 6
PRINT("Incremental linear encoder.",#13)
t=1
BREAK
Part 3: Examples: CAN Bus - Time Sync Follow Encoder