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: 

Convert vector .blf file to ASCII format using LabVIEW

Solved!
Go to solution

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 8
(5,469 Views)

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.

0 Kudos
Message 2 of 8
(5,448 Views)

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 8
(5,441 Views)

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)

0 Kudos
Message 4 of 8
(5,429 Views)
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.

Message 5 of 8
(5,422 Views)

Thanks Altenbach. It worked!! 🙂

0 Kudos
Message 6 of 8
(5,386 Views)

it shows me that ZLIB Inflate_ogtk.vi is missing

 

vi-missing.png

0 Kudos
Message 7 of 8
(3,529 Views)

@alii001 wrote:

it shows me that ZLIB Inflate_ogtk.vi is missing


Open VIPM, search for the "OpenG LabVIEW ZIP Library" and install it!

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 8
(3,521 Views)