LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-XNET and logging CAN messages to TDMS file

Trying to follow the documentation trail provided by NI and feel like I am going round in circles.

 

I thought logging CAN messages to a TDMS file would be a bit straight forward! Our issue is we don't yet have .dbc files so want to log the CAN messages anyway (undecoded if you like) and decode them later when we do get the dbc.

 

From what I can gather you set up the NI 9862 module in MAX and you can assign alias's and things and then you refer back to this set up from the VI you make.

 

In the VI do you go for creating a session (so Frame Input Stream mode session) and then wire that on through to the XNET Read.vi (CAN Frame). That, according to the manual, would look like it would spit out an array with msg ID, time stamp, message payload etc. Is that easy enough then to feed into a TDMS writer?

 

Would Frame Input Single-Point mode be better so I could sample all CAN messages at a set interval (instead of just having them come as and when, obviously on a vehicle CAN messages are transmitted at different rates, usually dependent on how important the message is). 

 

Many thanks in advance for any advice proffered. 

0 Kudos
Message 1 of 4
(4,696 Views)

Hello Alex, 

 

I found an old forum in which they talk about how to take the frame data and parse it easily into a TDMS XNET Cluster to Raw Frame.I think that forum could help answer your following questions:

 


 Is that easy enough then to feed into a TDMS writer?

Now regarding your other question: 

 


Would Frame Input Single-Point mode be better so I could sample all CAN messages at a set interval (instead of just having them come as and when, obviously on a vehicle CAN messages are transmitted at different rates, usually dependent on how important the message is). 


If you want to take all the traffic I would use an: Frame Input Stream Mode: Reads all frames received from the network using a single stream. This mode typically is used for analyzing and/or logging all frame traffic in the network. (source Getting Started with the NI-XNET API for LabVIEW).

 

Have you consider using the XNET Bus Monitor logging option: 

Log Bus Traffic with NI-XNET Bus Monitor While Running NI-XNET Application

 

This would be way easier and you won't need LabVIEW, meaning that you do not have to parse the data.

 

Let me know if this helps.

Randy @Rscd27@
0 Kudos
Message 2 of 4
(4,658 Views)

Hello! Thanks for your input

 

We eventually got to the bottom of it. Using NI's example VI for CAN to TDMS logging using X-NET kit works just fine. We struggled for ages to actually get the data back out of the TDMS in DIADEM. Turns out we just needed more money. More money to upgrade to the advanced version from the basic version to enable access to the bus log converter. Works like a charm now!

0 Kudos
Message 3 of 4
(4,641 Views)

I am glad that now is working fine.

Randy @Rscd27@
0 Kudos
Message 4 of 4
(4,632 Views)