LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert vector .blf file to ASCII format using LabVIEW

Solved!
Go to solution
Highlighted

Hi all,

 

I have a requirement to convert a .BLF generated by Vector CANalyzer to ASCII(.asc) with the help of LabVIEW.

I have used below Hoovah library to read BLF file, but I am not sure how to write a code to parse the data read and save it in ASCII format in .asc file

https://forums.ni.com/t5/Example-Code/Read-and-Write-BLF-Files/ta-p/3549766?profile.language=en 

 

I have been searching a lot on the discussion forums, but there is nothing that is helping me out.

Can anyone post sample code here?

It would be really helpful

0 Kudos
Message 1 of 6
(113 Views)
Highlighted

ASCII is just a convention that assigns characters to bytes. 

 

What kind of output do you want, just human readable formatted and delimited text? You can give any extension you want to it. If other software later needs to be able to read the file, you need to know what it expects.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 6
(92 Views)
Highlighted

Hi Altenbach,

 

After reading a BLF file using Hoovah library I get a data in array of clusters format as shown in Screenshot1. I need to write that data in an .asc file in a format as shown in Screenshot2. 

I am using write to text file function to achieve this . But I am not getting how can I write all the data row-wise in to a single file . Please find my VI attached herewith wherein I can just write the payload in the file. But along with that I need to write timestamp, ID, etc also column wise as shown in screenshot2. My VI is in LV2020.

Kindly guide.

Download All
0 Kudos
Message 3 of 6
(85 Views)
Highlighted

You did not include your type definitions.

 

All you probably need to do is open the output file before the loop, format each array element into a row, and append to the file. Close the file once the loop is done.

 

(btw: your array to path makes no sense. Typical filename inputs are just strings, so wire it directly)


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 6
(73 Views)
Highlighted
Solution
Accepted by topic author SuLAB

I really don't know how all your cluster element relate to each field in the output string, so here's a quick draft as a starting point. Just add all your other fields to the formatting operation as required. Should be trivial.

 

You can use "format into file" to append.inside the loop.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 5 of 6
(66 Views)
Highlighted

Thanks Altenbach. It worked!! 🙂

0 Kudos
Message 6 of 6
(30 Views)