LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number of records in a waveform file

Solved!
Go to solution

I am looking for a way to determine the number of records in a waveform file. I have looked through the waveform palette but can't find anything that seems to help. 

 

This is related to my Playing back a waveform thread but I thought I would start a new one to keep the question and answers separate. 

 

In general I want to use a horizontal slider to move between records in the waveform file. So the user can pause playback, move to a new starting point and resume playback. To do this I need to know how many records are in the file so I can set the maximum record number on the slider.

 

So far I have come up with this:

MaxRec.png

But I really think there has to be a better way...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 3
(2,332 Views)
Solution
Accepted by topic author RTSLVU

Try something like this.

 

Dlog.png

 

If I remember correctly these are datalog files with 1d array of waveform as the record type.

 

0xDEAD

 

 

Message 2 of 3
(2,321 Views)

I was about to suggest something similar, but as my knowledge base is less than 57005's, my approach is "experimental".  Read one record, figure out its size in bytes (you could "brute force" it with a typecast to array of u8), get the size (in bytes) of the file, and divide ... .

 

Bob Schor

Message 3 of 3
(2,315 Views)