11-24-2016 02:41 AM
The issue is that there is no clear way of supplying the DLC within the Cluster.
11-24-2016 02:50 AM
What about using the Bundle/Unbunlde Cluster functions?
Have you worked with clusters before?
11-24-2016 02:53 AM
The CAN Frame cluster used within the NI embedded CAN for RIO only provides 4 controls. They are Identifier, Extended?, Type and payload. None of these controls correspond to the DLC field.
11-24-2016 04:55 AM
11-24-2016 08:06 AM
Edit to my last post:
The CAN modules can use an array of 6 U32 values to transmit a CAN message. In the next image you see how the CAN cluster converts to this U32 array:
(The byte ordering stuff is added by me as I use an U64 instead of an U8 array to hold the CAN message data.)
The main point here is the way how IsRemote? and DLC are packed into one U32 value…
11-24-2016 09:06 AM
@yousifd wrote:The CAN Frame cluster used within the NI embedded CAN for RIO only provides 4 controls. They are Identifier, Extended?, Type and payload. None of these controls correspond to the DLC field.
Have you even tried communicating with the equipment yet, or has this all been a theoretical discussion about what may or may not work?
Now would be an excellent time to upload the equipment user's manual. DLC will not be exposed to the user when sending because it is a calculated value. Just like you won't find CRC exposed either, because it's calculated when you send the message.
I think you're all hung up on the data size. The data cannot be MORE than 8 bytes but it can even be zero. Just try sending the message itself without worrying about DLC and see if it works. I'm (reasonably) sure it will.
11-24-2016 09:11 AM
Oh and sorry to leave you hanging. It was almost midnight local time. 😄
11-24-2016 11:21 AM
I am not using the regular NI-CAN library. I am using the NI embedded CAN for RIO because my board, the sbRIO 9651, is not supported by NI-CAN. The only access to a CAN Frame is through the provided cluster:
11-24-2016 12:03 PM - edited 11-24-2016 12:04 PM
@yousifd wrote:I am not using the regular NI-CAN library. I am using the NI embedded CAN for RIO because my board, the sbRIO 9651, is not supported by NI-CAN. The only access to a CAN Frame is through the provided cluster:
I'm guessing you can bundle your payload as an array of three bytes? (Or however many you actually need.)
11-29-2016 09:29 PM
Thank You Bill. Your method worked. I just wasn't sure of how to change the array size in the cluster but I figured out that you can delete array elements from the front panel and that would change the array size.