05-04-2015 01:09 AM
Hi all,
I would like to create an array of 10 waveform datatype constants to pass into a structure. Once passed in, 9 of these elements will be extracted and then another added after which the new 10 will be graphed. Hopefully this will effectively create a continuously updating graph of my data.
I was wondering if anyone knows how to create a 10 element array using waveform datatypes.
I look forward to the great help I have received so far.
05-04-2015 01:19 AM
Whay does it have to be a waveform? You could just use a 1D array and keep x0 and dx seperately.
05-04-2015 01:24 AM
HI,
Thanks for that. The reason for the waveform datatype is that I would like to graph the data on a waveform graph with the time of each reading on the x axis and the value on the y axis. Would there be another way to do it?
05-04-2015 01:29 AM - edited 05-04-2015 01:30 AM
Why not just use a chart with a chart history set to 10? What else do you need to do with the history data?
Can you explain in more general terms what the program needs to do?
05-04-2015 01:39 AM
Hi,
The charts are a bit limiting as I would like to see the grid lines so that values can be directly read from the graph. What I am trying to do is to acquire some data from a liquid nitrogen tank we have and then display it on a graph so that we can see the last four days usage. This is important for us as if we run out our experiments will fail.
The only way I can think of doing this is to create a 10 element array and feed it through a shift register into a while loop. Inside the loop the array will be cut to 9 elements using the subset array function and then the new data point that is acquired will be added to the array. This would make the new array one point different each time. Each time the array is appended it would be redrawn effectively showing a continuously acquiring graph. The obviously the shift register would feed the new array back into the beginning and it would update again.
I have tried many iterations but there always seems to be a problem.
05-04-2015 01:48 AM - edited 05-04-2015 01:49 AM
Hi doljam,
using a PtByPt-DataQueue makes this a very easy VI:
so that we can see the last four days usage
What is your sample rate? How many samples do you want to display?
Depending on the answer to these questions you should think about "decimation"…
05-04-2015 06:59 PM
Hi,
Thanks for that. I do have a couple of questions. I haven't recreated the VI yet but it looks like it might not attach an individual time stamp to each point in the data queue as the data going into the data queue function is not waveform type. Would it end up just being a number of points with the same time stamp.
05-05-2015 01:01 AM - edited 05-05-2015 01:03 AM
Hi doljam,
as long as you have a constant dt you only need a timestamp for the very first sample - that's the whole point of a waveform!
And I used a constant wait in the loop to read the next sample, you might use WaitForNextMultiple too…
One correction to the image above: As the queue will only hold 1000 samples the t0 is wrong once the queue is filled the first time. You might need to correct t0 from that moment on…
05-05-2015 01:16 AM
Excellent. Thanks for clarifying the waveform datatype. Is there a need to specify a dt or can that just be done using a Wait For function in the loop as you mentioned.
05-05-2015 01:17 AM