Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 695 of 909
The function will pause (not proceed) a user program until a confirmation is received or a
timeout occurs. Refer to the following section on error handling.
Note that user interrupt events, ITR(…), can occur when waiting for an SDO operation to
complete. However, do not call an SDO operation from multiple interrupt levels concurrently.
For example, if an SDOWR command is called in the main loop of a program, then do not call
an SDORD or SDOWR in an interrupt routine.
ERROR HANDLING:
Errors are handled as follows:
l
Errors during a read or write to CANopen objects through SDO may not specifically
cause a CAN error bit in status word 2. RCAN(4) command should always be inspected
to verify success of the SDORD, SDOWR, and NMT commands.
l
After each SDO read or write or NMT the specific code returned from the device will be
readable using command RCAN(4)
l
In the case of successful SDO read or write or NMT command, then the RCAN(4) shall
report 0 immediately after such command. The user should always inspect for value 0
to know that an operation was successful.
l
The user program is responsible for implementing any strategy for retry and/or giving
up after a certain number of tries. The firmware simply reports the status of each
attempt and will not automatically retry.
EXAMPLE: Write an SDO
a=1234
SDOWR(1,9029,0,4,a) ' Write 4 bytes to address 1,
IF CAN(4)==0 ' Confirm the status of the most recent SDO operation.
' Success
GOSUB(4) ' Some routine to take action when the write succeeds.
ELSE
GOSUB(9) ' Go do something to deal with error when write fails.
ENDIF
RELATED COMMANDS:
R
CAN, CAN(arg) CAN Bus Status (see page 352)
CANCTL(function,value) CANControl (see page 354)
NMT Send NMTState (see page 595)
SDORD(...) SDORead (see page 692)
Part 2: Commands: SDOWR(...)