LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

txt file in real time

Hi all,

I have a txt file with 7 signals and is tab delimited.
I am able to load the file but I have all the waveform at once.
I would like to play the wakeform in real time.
I know that I had a sampling frequency of 2K so each of my points is 1/2000 seconds.
Any ideas or examples will be helpful!

Thanks
0 Kudos
Message 1 of 8
(3,210 Views)
Ok, but why you can not just read all the waveform at once and then supply values sequentally at a given rate (using delays, or, better, wait for multiple function)? Or, If the waveform is huge and you don't want to load it at once you can read your text file line by line, converting each line to waveform data and, as earlier, suppling this data to the graph at the given rate? (But beware, that in this case you will be much more dependent of your OS reading file speed, and, may be, not able to achieve given rate).
Message 2 of 8
(3,210 Views)
Now I am reading all the waveform at one the problem is that the file is like 100megs and is about 2 minutes of real time so I want to see the power spectrum in real time.
I was also trying to do it with delays but the wait for next milisecond function accepts 1 as the smallest input so my sample frequency is smaller that 1ms.
I know that it won't be really accurate becasuse it will depend on the processor adn the time it takes to do the calculations.
Do you have an example with a single little file on how to read it line by line?
Thanks a lot
0 Kudos
Message 3 of 8
(3,210 Views)
Ops... Yes, you are right, the sample rate is a little bit too high. If you want to display at rates higher then odrer of 1K then may be you can try to update your graph with a number of points greater then 1 at a time (suppliing a portion of waveform)...
Here is the line-by-line table reader you requested.
0 Kudos
Message 4 of 8
(3,210 Views)
And about high playback sampling rates... I must admit, that LabVIEW just simply not fast enough 😞
The wait functions are also limited by OS time-quants.
0 Kudos
Message 5 of 8
(3,210 Views)
Thanks for your vi.
I will try to pass then a set of points at once and then play them.
It is a shame that you don't have the ability to play the waveforms as they were aquired.
Merci!
0 Kudos
Message 6 of 8
(3,210 Views)
Yes, but when you acquire waveform it usually uses some kind of harware buffering. And this is not the case when you analyse or display them on a graph...
0 Kudos
Message 7 of 8
(3,210 Views)
> I will try to pass then a set of points at once and then play them.
> It is a shame that you don't have the ability to play the waveforms as
> they were aquired.

On recent versions of LV running on OSes with threading, controls and
indicators automatically do buffering, to update at a rate that makes
sense for the human eye, and letting the diagram run at the rate that it
wants to. So, that means the real problem is that you want a .5ms
delay, and that just isn't supported by the OSes LV runs on. maybe this
will change, but you can approximate this for a combination of 0's and
1's. So one way of doing this is to measure how many ms have elapsed
since your loop began, compare this to the computed data timestamp an
d
wait the difference, or zero if behind. This will work about as well as
anything does since you aren't going to see 2,000 distinct pictures in
one second anyway.

Greg McKaskle
0 Kudos
Message 8 of 8
(3,210 Views)