From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can LabWindows libraries call legacy Read Datalog File function?

Solved!
Go to solution

We are in the process of updating some old software written in LabVIEW 6.0.3 to Java. One of the features of the original software is to create data files using the "Write Datalog" function and also to recall those databases later using "Read Datalog".  To maintain backward compatibility with users' old data we want the new software to also be able to read in and display the old datalogs.  I've read several posts on here about how the only way to get data out of datalogs is using the "Read Datalog" function from the same version of LabVIEW used to write the log in the first place. I have the original LabVIEW code so I know the structure of the data that was written.

 

I want to know if the same function exists in the libraries for LabWindows.  Specifically is there is any support for a 6.0.3 version of the Read Datalog function to support interfacing with a call from java?

 

To knock out one possible solution, this software is shared with customers.  We want to avoid the path of compiling a separate LabVIEW executable to be distrubuted with the main Java software that batch processes all of the old data files by reading them in with the old LabVIEW function and spitting out files into a new format.  We'd prefer for the old files to be transparently opened from within the new software.

 

Disclaimer:  I've been using LabVIEW since dark days before the invention of the Undo button, but never touched LabWindows/CVI. Please type slowly so I will understand 🙂

 

Thanks to all!

0 Kudos
Message 1 of 4
(3,666 Views)
Solution
Accepted by topic author I_Break_Things

I suppose there isn't a built-in library that can read LabVIEW datalog files simply because they don't have a fixed format... Even in LV you need to pass the data structure to the open function in order to read back data.

 

Searching the forum I have found this discussion that can give you useful elements to start with.

Apparently you will need to detect the start of the data section of the file after initial "DTLG" and rest of header (which is the undocumented part). After that point, reading the file should be simple if you know the data structure the writer program has used. The Data >> Storage section of LabVIEW help can give you informations on the memory content of each data type used.

 

A simple test I made writing clusters with a string and an int shows that: 1. Data section starts at offset 0x22F; 2. The cluster is dumped to the file preceded by an int with the string lenght; 3. Records may have variable lenght depending on string lenght; 4. There are no padding bytes between cluster elements; 5. Records are packed consecutively in the file.

I made this test using LabVIEW2009: it's possible that older LV files are structured differently.

 

 

An alternative to all this is to build a DLL in LabVIEW that reads your datalog files and passes their content to the caller. Since you are experienced in LV you are for sure more confortable than me in doing this.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,648 Views)

Slow thanks, but that response was very helpful.  Project got shelved for a while, but up and running well now based on the guidance. 

0 Kudos
Message 3 of 4
(3,511 Views)

Happy to have helped you.

Just out of curiosity: did you succeed in reading datalog files with CVI native functions or did you choose to write a LV DLL to read them?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(3,507 Views)