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
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
Solved! Go to Solution.
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.
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.
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)
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.