LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the datalogs be in plain text format?

Hey Guys,

 

I see that LV does datalogging but the logs seem to be in some other format. Can the datalogs be in plain text format? 

 

Thanks guys,

 

-- Michael

 

0 Kudos
Message 1 of 4
(2,882 Views)
0 Kudos
Message 2 of 4
(2,873 Views)

Per the suggestion of Corby_b, I posted the question here. I know about writing to a file as a spreadsheet or text, but my question specifically asks about the datalog format. I am thinking that this might be more robust since it's a VI specifically for that. I need it to create a datalog in PLAIN TEXT format for reading. Is this simply not possible?

 

-- Michael

0 Kudos
Message 3 of 4
(2,862 Views)

The datalog functions are typically used to write binary files and I think the only difference between the datalog and regular binary file writes is that the datalog functions use some sort of predefined header. There is no 'format' for datalog files except what you would define by the data you write. You could in theory define the file type as strings, convert all of your data to strings, and format it (i.e. add comma or tab separators) before doing a write but then you would be just duplicating what you would have to do with the equally low level Write to Text File function. I don't beleive there is anything more robust about them. Not too long along, there was just a single File Write function. This was flexible and simple but along the way, NI added separate functions for text file, binary file, and datalog file so that new users would be less confused is my guess. I suspect that all of these low level functions are pretty much the same code. You are certainly use the existing Write To Text File and give it a .log extension.

 

In terms of efficiency, the least efficent way to save data is with the Write to Measurement File Express VI. Better is the Write to Spreadsheet File but while that converts numerics to text and adds the delimiters for you, it opens and closes the file each time it is called. Best is to open and close the file once (at the beginning and end), format the data yourself with something like Array to Spreadsheet String, and then call Write to Text File.

0 Kudos
Message 4 of 4
(2,844 Views)