Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 846 of 909
CASE 7
PRINT("Incremental linear encoder with electronic counting.",#13)
t=1
BREAK
CASE 8
PRINT("Absolute linear encoder.",#13)
t=1
BREAK
CASE 9
PRINT("Absolute linear encoder with cyclic coding.",#13)
t=1
BREAK
CASE 10
PRINT("Multi-sensor encoder interface.",#13)
t=0 ' not supported here at this time.
BREAK
DEFAULT
PRINT("Unknown type of encoder",#13)
BREAK
ENDS
BREAK ' Remote device has booted to the point of responding.
ENDIF
IF (vvv&65535)==402 ' Check lower 16-bits for profile type of device.
PRINT("Motor ",eee," acting as an encoder.",#13)
' A motor acting as an encoder.
t=2
BREAK
ENDIF
ENDIF
WAIT=500 ' Wait 1/2 second.
PRINT(".")
LOOP
PRINT(#13)
rrr=0 ' Resolution
IF t==1
rrr=SDORD(eee,x6002,0,4) GOSUB10
rrr=rrr-1 ' We want the max value, not the number of steps.
IF CAN(4)!=0
PRINT("Failed to read encoder range.",#13)
OFF END
ENDIF
ENDIF
IF t==2
rrr=-1 ' Smartmotor, which is the range 0x00000000 to 0xffffffff.
ENDIF
IF t==0
PRINT("This type not supported, ending now.",#13)
OFF
END
ENDIF
Part 3: Examples: CAN Bus - Time Sync Follow Encoder