LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging only specific CAN frames using LabVIEW example "CAN Input Stream to TDMS Logfile.VI"

Hello LabVIEW Community, 

I am writing about a problem which I am not able to figure out on my own.

 

I am logging my data over CAN and I have designed my VI similar to CAN Input Stream to TDMS Logfile.VI (Example VI) but this logs the full CAN traffic coming on the bus which makes my TDMS file very big. I would like be able to only log a certain CAN frames and skip the other.

Example VI Snip below:

Happy96_0-1717606781767.png

 

The reason I need a smaller file is because later I take my TDMS file which has all raw CAN frames and then run a signal conversion scrip which ten takes hours to run. Example: A 95 mb TDMS file did not finish conversion in 2 hour of running the attached VI. Below is the snip (also attached: tdms2txt_DynoV3) of my signal conversion scrip which only convert specific CAN frames based on message ID and save the signals in txt file.

Happy96_1-1717607180318.png

 

I need help in optimizing this code to:

1. Log only required CAN messages in TDMS file. 

2. Help in optimizing my attached VI on how can I make this process faster. I believe the longest lead time sub vi used in the attached VI is "CAN frame to table.VI"

0 Kudos
Message 1 of 2
(248 Views)

Hi Happy,

 


@Happy96 wrote:

1. Log only required CAN messages in TDMS file. 

2. Help in optimizing my attached VI on how can I make this process faster. I believe the longest lead time sub vi used in the attached VI is "CAN frame to table.VI"


  1. As can be seen in your image there is a comment on using a database: once you define your database of CAN messages you can easily filter to the messages of interest!
  2. There are some obscure code constructs: why do you need to convert the CAN frame in the FOR to an array of frames? Why do you need to convert that array to a cluster (twice)? Why do you need to build an array of strings just to convert the string array into a "SaveString" (instead of using FormtIntoString with 3 inputs)? Why do you need to convert a path to a string just to build a longer path (instead of using BuildPath)?
    Cleanup the VI…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(211 Views)