LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get accurate timing information in a waveform chart?

I am currently using a waveform chart to plot 4 different plots, each with it's own axis. The data for the chart is being generated by a while loop, which is gathering data from two different GPIB devices. The reason I use a chart is because I need to see the plotting being done real time. The problem is, I have no way of knowing how fast the while loop is running (or will be running), and thus no way to set an x-scale multiplier that provides accurate time. Is there a way around this? I would use the waveform data type, as it includes timing information, but that requires me to limit how fast the while loop can run, and I need it to be running as fast as possible, and also from what I understand, doesn't support multiple plots. Thanks for any help!

Geoff
0 Kudos
Message 1 of 3
(2,497 Views)
Hi Geoff,

The big problem here is that Windows is not a deterministic operating system and therefore you will not know in advance how fast the while loop will run. You can run your while loop without a wait which will acquire as fast as Windows will let it, however you are still not guaranteed a fixed interval between iterations and you will most likely eat all your processor time on this one application. One option for you is to get a timestamp in every iteration of the loop and construct a 2D array. One column for the time values and another for the retrieved values. You can then plot this information on a XY graph. Best of luck!

Regards,
Chris J
0 Kudos
Message 2 of 3
(2,475 Views)
Thanks Chris, after much frustration, that is more or less what I ended up doing. I just wish I'd known that earlier!
0 Kudos
Message 3 of 3
(2,463 Views)