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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET Read database of multiple frames and signals

Hello everyone,

 

I am trying to understand the communication flow of the XNET plugin for LV. I created a databse with two frames

  • Frame1: 3 Signals
  • Frame2: 3 Signals

After reading the bus using 'Frame CAN' I trying to decode the frame according to their signals (see picture). How does LV choose which frame to decode? The frame array holds 2 frames and only the last entry will be analyzed. And even this entry is decoded wrong, since only the second signal ('xxx') has the correct value. The signal 'Pre' is always '0,00'. 

 

can_frame.png

 

How can I decode all read frames efficiently?

 

My idea is to loop over the 'Dataframe' cluster and check for each signal (in a nested loop). But this is not the best solution since the CAN controller can decode this information much faster than the nested loops in LV.

0 Kudos
Message 1 of 4
(3,787 Views)

You will have a better chance getting a hint if you post XNET related issues on the Automotive and Embedded Networks board.

Lucian
CLA
0 Kudos
Message 2 of 4
(2,842 Views)

Sorry for the late reply -> Holidays.

 

Thanks for the tip

0 Kudos
Message 3 of 4
(2,421 Views)

So XNet has the ability to do the converting and the reading on the hardware.  There are several shipped examples that show how to do this.  I wrote a series of CAN Blog posts over here, with a few posts focusing on XNet and the various session types it supports.  If you do want to read the raw frame values and do the conversion you can use the XNet API which will do the conversion in software calling external libraries, or you might want to look into my custom API completely written in G.  It's faster, gives you more control, and can be used with non-XNet hardware.  But if you do have XNet hardware it is probably best to have the conversion done on the hardware using the Signal session type.

 

You probably want Signal In Single Point which will just return to you the value of the signals in the scaled engineering units defined in the database.  Oh and there are several examples in Help >> Find Examples if you search for XNet.  And in the future as LucianM said the other forum is probably a better place for XNet related questions in the future.

0 Kudos
Message 4 of 4
(2,412 Views)