Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 849 of 909
PRINT("SmartMotor acting as encoder: starting motion.",#13)
MV VT=100000 ADT=50 G ' A simple constant motion.
' Follow motor is already started and will follow exactly.
PRINT("SmartMotor acting as encoder: ") PRINT("running for 10 seconds.",#13)
WAIT=10000
PRINT("SmartMotor acting as encoder: freewheel.",#13)
BRKRLS OFF
ENDIF
END
C10 ' Check for CAN error and display
e=CAN(4)
IF e!=0
PRINT(#13,"Communication Error: ")
ELSE
' PRINT("ok",#13) ' For debugging, to see what commands passed and failed.
RETURN
ENDIF
SWITCH e
' NOTE: Any error number < 0 is Animatics specific to the SDORD, SDOWR,
' and NMT commands.
CASE -1
PRINT(" Timeout, no response from remote device.")
BREAK
CASE -2
PRINT(" Multiple SDO commands simultaneously.")
BREAK
CASE -3
PRINT(" Master mode not enabled, see CANCTL command.")
BREAK
CASE -4
PRINT(" Protocol not supported.")
BREAK
CASE -5
PRINT(" Transmission failure, check cable, Baud rate.")
BREAK
CASE -6
PRINT(" Data size returned not expected size.")
BREAK
CASE -20
PRINT(" Invalid destination address.")
BREAK
CASE -21
PRINT(" Data size not supported.")
BREAK
CASE -22
PRINT(" Invalid object index.")
BREAK
CASE -23
PRINT(" Invalid object sub-index.")
BREAK
CASE -24
PRINT(" Invalid NMT command value.")
Part 3: Examples: CAN Bus - Time Sync Follow Encoder