Completion Code 5040005 When Using NI-Industrial Communications for CANOpen Block Read Function

Updated Jun 15, 2023

Reported In

Driver

  • NI-Industrial Communications for CANopen

Issue Details

I'm trying to perform a read from my CANOpen device using the CANOpen SDO Block Read VI from the  NI-Industrial Communications for CANOpen driver in LabVIEW, but I am receiving the following error completion code upon trying to execute my read:
 
Completion code error reported by CANOpen communication with  NI-Industrial Communications for CANOpen driver.

 

Solution

This error is often caused by trying to read data larger than 64 bytes from your CANOpen device. The maximum transfer size for a CANOpen SDO block read or write is 64 bytes, and if a read of a larger amount of data is attempted, an out of memory completion code will be returned. There are two primary methods for addressing this error:
  • If possible, split your read into smaller parts that are each below 64 bytes in size. To do this, you will need to be able to modify the CANOpen command you're sending to read a smaller amount of data from your device's memory.
  • If you are unable to split your read into smaller parts, you can try and read the data from your device using the CANOpen CAN Frame Read VI, as a CAN frame will be able to read a larger amount of data in a single transfer. In order to do this, the CANOpen device you're communicating with will need to have a CAN frame specified which reads from the SDO you're trying to communicate with. This will change based on the device you're using - consult your device manufacturer for more information on if this is possible.

Additional Information

Performing an SDO Block Write larger than 64 bytes will also produce an error, namely an invalid input error (-2147136895). This error can also be resolved by breaking your written data into sections smaller than 64 bytes.