11-06-2022 01:12 AM
Hello,
I am new to LabVIEW and now trying to make a VI about data collecting and measuring.
The output data from the previous VI is a double type data and what I want to do is to make a VI that can capture N times of this data and display it in a waveform graph (not a chart). After this, I want to sample the values from the waveform and output them in double type data, just like the data type from the previous VI.
Can anyone give me some advice and help?
Thank you very much!
Solved! Go to Solution.
11-06-2022 01:24 AM
How long does it take to collect the data? That determines if you need to see the data as it is generated or if you can wait for all data to arrive and only then display it.
Once you know N, you can use a FOR loop and either auto index at the output tunnel or build it in a shift register. The wire is the data, so just branch it to the graph and to the save tools. No need to "sample" from another indicator, whatever that means.
11-06-2022 01:40 AM
The time interval between two data is 100ms and the N I want to use is 1000.
What will be the difference if I use N as 100, 1000 and 10000? Does it slow down the waveform update speed?
11-06-2022 09:40 AM
No, 100ms is a very, very long time for a computer, sufficient to do almost anything. It also means that your recording is many second, so you might want to update the graph as it is acquired. Also 10000 is quite small.
From a memory handling standpoint, I would recommend to allocate the final size in a shift register with NaN, then replace with real data as it arrives. After the loop, you can save the data. (NaN will not show on a graph)
Here's how that could look like. At the end it saves it as one column.
(Notice that I am kind enough to show you the full code picture.)
11-06-2022 07:39 PM
Thank you for your advice and code!
I will try to write a VI myself and go test it.