LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform chart clears randomly

I am collecting data from a serial device and am displaying it on a waveform chart. In order to get a nice timeline on my x-axis, I collect 50 ms worth of data at a time (in a While Loop), create a waveform data type with the current time, and then push that onto the chart. It works pretty well; however, occasionally (seemingly at random), the chart clears itself and then continues to draw my data. I've saved the stream to disk to check it and nothing is dropped but the random clearing of the display is very annoying from the user's perspective.

Any ideas how to make the chart stop clearing itself? I can post code if necessary.

Using LabVIEW 6.1

Thanks-
-dennis.
Message 1 of 15
(4,581 Views)
Here's an example of the strange behavior I am seeing.

-dennis.
0 Kudos
Message 2 of 15
(4,571 Views)
Well Dennis, I played around with your VI in 7.1.1 and it acted just as you described. I have no idea how to make it quit doing that and I agree it's annoying.

If it were me, I'd punt the whole waveform data type and work it out with a regular float array to chart or an XY graph. I suspect it's related to the waveform time stamp somehow.

Randy
0 Kudos
Message 3 of 15
(4,560 Views)
Thanks, Randy. I thought about going back to my usual use of straight float arrays but I as hoping to make use of the timestamp in the waveform data to sync two different input streams (one AI, one serial). I still have time left to play with it and maybe change the way I graph and save data though.
0 Kudos
Message 4 of 15
(4,547 Views)
Hello cviuser167,

I downloaded your VI and was able to find out what is going on. Every time the chart clears itself, it is because the timestamp of the first element of the current waveform is earlier than the timestamp of the last element of the previous waveform. The chart cannot plot backwards in time, so it clears the buffer and starts anew. Because the timestamp information relies on the while loop delay, increasing the delay insures that the aforementioned condition is never met. If you do not wish to incerase the delay, decreasing the value of dt should also resolve the issue.

I hope this helps,
E.Lee
Applications Engineer
National Instruments
Eric
DE For Life!
Message 5 of 15
(4,527 Views)
That's what I figured was going on the more I looked into it. In my real application, the data is coming in via a serial connection that is streaming the data at 75 Hz, so I can't change dt. I have also increased the delay but still see occasional resets in the display; this also results in the data being displayed in a very choppy manner. If looks like it is all there but my end user wants to have a nice, scrolling display.

Thanks again.
-dennis.
0 Kudos
Message 6 of 15
(4,491 Views)
Hello Dennis,

Based on the VI you posted, I cannot think of an easy workaround to this issue but I do have one suggestion. If the data is streaming in at 75 Hz, I'm guessing that you only need the timestamp for the first data point. I would initialize the first data set based on the timestamp. However, after that first timestamp, we know that the dt will stay constant for the rest of the samples. We do not need to grab the timestamp for every 5 samples we plot. Instead, you can just check the timestamp of the last element in the array and add dt to it. I've modified your example and attached the fix. I'm not sure if this will work in your final application but I hope it helps.

Take Care,
E.Lee
Applications Engineer
National Instruments
Eric
DE For Life!
0 Kudos
Message 7 of 15
(4,473 Views)
Thanks for the idea. I believe I tried something like that early on but I may not have update the chart correctly. Would you mind reposting your example in a format that is compatible with 6.1?
0 Kudos
Message 8 of 15
(4,468 Views)
0 Kudos
Message 9 of 15
(4,461 Views)
Thanks, Randy. I'll try that approach in my actual app.

One interesting thing is that this example app crashes in 6.1. It draws a sample data set and then pops up the attached error message.
0 Kudos
Message 10 of 15
(4,456 Views)