LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to output variable names and units used in binary file

Solved!
Go to solution

My colleague will be giving me binary files (*.dat) generated from within LabView. There are over 60 variables (columns) in the binary output file. I need to know the variable names and units, which I believe he already has set up in LabView. Is there a way for him to output a file containing the variable name and unit, so that I'll know what the binary file contains? He can create an equivalent ASCII file with a header listing the variable name, but it doesn't list the units of each variable.

As you can tell I am not a LabView user so I apologize if this question makes no sense.

0 Kudos
Message 1 of 4
(3,144 Views)

Hi KE,

 

yes, he can!

 

Either:

- he provides an ASCII file with names and units as header data (it's up to the programmer to save all needed information)!

or

- he gives you a detailed spec for his "binary data" file

or

- he uses tdms with all it's functionality

 

The point is: it's not LabVIEWs fault when the programmer saves only part of the needed data...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,135 Views)

Can you please fill in the following blank, which will help me ask him to do it,

"Dear colleague, could you please generate an ASCII file containing the column names and units of all the variables in the binary file? This can be done in LabView using xx function"

0 Kudos
Message 3 of 4
(3,128 Views)
Solution
Accepted by topic author KE1590

Hi KE,

 

an ASCII file (probably csv formatted) is just text - and contains all data that is (intentially) written to. There is no special function to include units or whatever!

Your collegue has to save those information the same way he saves the names and the values...

 

(When writing text files he could use WriteTextFile, FormatIntoFile, WriteToSpreadsheetFile, even WriteBinaryFile could be used...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(3,120 Views)