I am writing my own CANOpen stack, and I want to implement the SDO server using C. The CiA CANOpen Application Layer Document specified that the SDO Request and Confirm Frames look as follows:
And some explanation provided as follows:
Based on my decoding of this picture, I gather that I am supposed to send 8 bytes in a SDO confirmation frame, but the 7 bytes will contain simply 0.
Is this correct?
PS: Sorry for the images if they are not clear.
Almost correct. An SDO CAN frame always contains 8 bytes, where the unused bytes are 0.
The confirmation frame, however, has 4 non-zero bytes. The first byte is the command specifier (0x60 in this case). The next three are the "multiplexer": two bytes for the object index (little-endian) and one byte for the sub-index.