LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read a certain range from binary file

Hi CSUEB,

      Sorry for the long delay to reply - combination of being sick and heavy work-load...


1. How did you get the number 20004?
2. YOu set the time to be 333 ms. What does this do? Is it making the iteration be executed every 333 ms?

1. I don't remember how I fished this number out!  However it's probably not a coincidence that if you multiply your sample-size (2500) by the number of bytes per sample (8 (for Double-Precision numbers)) and add 4 to store number of samples, the result is 20004.  I wouldn't be surprised if there is a cleaner way to read-back these wave-forms.  Feeding the File Read the exact byte offset, but having "Count" in terms of waveforms just seems wrong.  This coding approach is fragil, since it will "break" if sample-count varies from waveform to waveform.

2. The short answer is yes!  LV6i didn't have event structures -  a more efficient way to respond to user-events - so the loop has to "poll" a control to see whether it's value changed.  333ms is a guess at what's as slow as possible, without introducing a delay the user will notice.  In an application like this, many programmers would just let the loop "free-run" (no delay) but that's a bad habit to get into! 

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 11 of 13
(729 Views)

Er... slight correction Smiley Tongue

Your application is plotting 2500 points, two SGLs per point! (not 1 DBL per point (my brain was in CHART mode...))

Anyway, 2500 x (4 + 4) + 4 = 20004

Hey, it happens I'm loading/saving plots off a Network Analyzer.  If I figure-out clean waveform File-handling, I'll post again. Smiley Happy

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 12 of 13
(723 Views)
hey
thanks million
Sorry for being late, for we're moving the lab to another room.
By the way, I'm planning to develop another VI that should ready from the BIN file and fit the waveforms into Non-linear fitting module, that's been built in LabVIEW.
My idea is to use a FOR loop which will iterate, say, 5000 times to read all the "plot index" from the binary file. When the file is done reading, it should be returning error. At that point, I will terminate the program?
Do you think it's a good way to do it??
 
Thank you very much
0 Kudos
Message 13 of 13
(694 Views)