From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN channel to frame conversion

Hello,

 

I'm trying to write my first CAN application and need to convert some frames into channels but I really don't know how.

I'm using a cRIO 9004 controller with a 9852 module. cRIO returns me a cluster with with 8 data bytes, identifier,  timestamps, info A and B and data length.

 

I want to get the following frames and convert it:

ID = 554hex;  Byte-Nr. 7;  8 Bit long

 

ID = 255hex;  Byte-Nr. 6 and 7;  16 Bit long

 

What is the best way to extract that from the cluster?

 

Any help would be helpfull

 

kind regards

miko 

 

0 Kudos
Message 1 of 3
(6,328 Views)

The FPGA CAN I/O node has a second data type available. If you right click the node and choose properties you can have a 6 U32 data type. That type makes it easier to manipulate the data bytes. U32 number 4 and 5 are holding the 8 data bytes.

There are VIs shipping with NI -CAN, installed within the labview examples>>NI-CAN>> logfile.llb showing the details of accessing the U32 values.

Hope that helps.

 

DirkW

0 Kudos
Message 2 of 3
(6,297 Views)

 

It's working now. I'm using 6 U32 data values as you adviced.

 

Thank you for your advice.

0 Kudos
Message 3 of 3
(6,275 Views)