LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change CAN Frame Data Length Parameter

Solved!
Go to solution

The issue is that there is no clear way of supplying the DLC within the Cluster. 

0 Kudos
Message 11 of 22
(1,749 Views)

What about using the Bundle/Unbunlde Cluster functions? 

 

Have you worked with clusters before? 

0 Kudos
Message 12 of 22
(1,745 Views)

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. 

0 Kudos
Message 13 of 22
(1,742 Views)

Hi yousif,

 

I'm working with CAN modules in a cRIO and use the FPGA to exchange CAN messages.

The driver for CAN modules within FPGA provides all fields as needed:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 22
(1,730 Views)

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:

check.png

(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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 22
(1,725 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 16 of 22
(1,724 Views)

Oh and sorry to leave you hanging.  It was almost midnight local time.  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 17 of 22
(1,721 Views)

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:

CAN-Frame.PNG

0 Kudos
Message 18 of 22
(1,708 Views)
Solution
Accepted by yousifd

@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:

CAN-Frame.PNG


I'm guessing you can bundle your payload as an array of three bytes?  (Or however many you actually need.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 19 of 22
(1,701 Views)

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. 

0 Kudos
Message 20 of 22
(1,668 Views)