LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Waveform Data in C

Dear community,

I am looking for a way to read waveform data file with external software like C or Java.

The Data Acquisition, very simple code, is written and run in LabVIEW 2009SP1.

(see attachment)

 

Is an prepared header for data struct, open(), read(), close() this file format?

Anybody an idea? I didnt find anything here.

 

Regards,

esod

0 Kudos
Message 1 of 3
(2,454 Views)

Hi esod,

 

see this:

check.png

I'm saving an array with just one waveform in it. The resulting file contains:

0000 0001 - array size (one waveform in the array)

0000 0000 D156 9847 5451 8000 0000 0000 - timestamp of first waveform

3FF0 0000 0000 0000 - dt value (1)

0000 0003 - array size of Y component

0000 0000 0000 0000  - first sample (0)

3FF0 0000 0000 0000 - 2nd sample (1)

4000 0000 0000 0000 - 3rd sample (2)

remaining stuff: the variant containing no attributes (?) in this example.

 

Timestamps use 128 bits in LabVIEW. Samples and dt use DBL datatype. Arrays have their size prepended as I32. Variant is a monster of it's own…

 

Forgot to mention in the first place: Those are internal representations of LabVIEW datatypes. They might change with each LabVIEW version (as happened to the timestamp long time ago), but I guess it is unlikely for the current waveform datatype…

Best regards,
GerdW


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

And an extra tidbit: the data is default saved in network byte order (big endian). Your C code will normally use the CPU default byte order which is little endian on x86/x64 platforms. So don't forget to swap the bytes and words when reading LabVIEW data into C.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,402 Views)