LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update waveform chart one point at a time instead of multiple points?

Hi,

 

I'm newbie to labview and have a problem with chart, namely with how to draw acquired analogous signal point by point instead of multiple points?

 

I'm using LW 7.1, card is USB 6259 M. I'm reading continuous samples (voltage) at 10000 1/s, and would like to see the signal drawn as in oscilloscope. If I wire waveform chart directly to DAQmx read output, the signal is drawn multiple points at a time, and that's not what I want. I've searched the forums, examples and tutorials, but I haven't figured out how to accomplish this, or am I just missing something? I've seen some solutions that seem to address my problem, but since they are created in LW 8.* I can't open them (sigh).

 

In my application I'm generating anologous voltage signal (in parallel loop) and want to monitor this generated signal, thus the channel '_ao3_vs_aognd', instead of e.g. ai1. I attach modified code for my acquisition loop.

 

I wonder if it's too difficult to implement this feature directly in labview, like a property that user can select to draw 1 point or multiple points and/or how many points at a time. Just a thought.

 

Any help you provide is appreciated, I'm quite lost with this one.

 

 

0 Kudos
Message 1 of 6
(4,600 Views)

If you use a chart, you can change the mode to update like a scope:

 

 

 

chart-scope.PNG

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 6
(4,582 Views)

You could use a queue and a parallel loop to make the update more smooth.  If you add a small delay before the first chart update, then the chart loop will always be slightly behind the DAQ loop, but it should update smoothly.

 

chart3.PNG

Message Edited by vt92 on 09-11-2009 08:32 AM
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 3 of 6
(4,571 Views)

I just can't make it work. In generate.vi I have simplified code of what I'm trying to do. It works fine except that I would like the signal to be drawn smoothly i.e. point by point. And since generation and aqcuisition are not synchronized, the half sine is drawn 'incomplete' (I intend to synch them, but this update issue has kept me busy). If I add the queue structure you suggested, I get error: "Error 1 occured at Enqueu Element in generate.vi. Possible reasons: LabVIEW: An input parameter is invalid. NI-488: Command requires GPIB controller to be controller in charge."

 

In chart mod.vi the queue is added. When I run that (without any signal generation) the vi won't stop when stop button is pressed once, when pressed second time the vi will stop, but only after a while (several to tens of seconds depending how long I let the vi run) and stop button is left in 'on' state. So the problem isn't just my generation loop.

 

I don't understand why it's not working, feel like banging my head against wall. Keep wondering why there isn't any simple way to do this. Hopefully someone can help me to get this right.

 

 

 

Download All
0 Kudos
Message 4 of 6
(4,548 Views)

First, a scope does not update one point at a time unless you have it set for very, very slow acquisition rate. If you want o display one point at a time, acquire one point at a time. Personally, I don't think that makes much sense.

 

What you should do is set your chart's history buffer to some reasonable size. Right now it's only 1000 points and you are certainly acquiring more than that with each iteration.

0 Kudos
Message 5 of 6
(4,533 Views)

The 1000 is copied from generate.vi where waveforms are wired to chart, then the chart history length is 1000 waveforms, whereas when doubles are wired it's 1000 points. I've fiddled with history length and I can change it to more points, but it doesn't change the fact that the code doesn't work. I'm so inexperienced with LW that I can't figure it out Smiley Sad. Oh well, if it can't be done it can't be done. I go back to LW examples and see if I can make XY chart.vi and XY chart buffer.vi work for me. It's confusing when you think that continuous acquisition of analog signals is so basic function and one would expect to also draw the signal smoothly instead of chunks of points - makes you wonder why do it in LW at all.

 

Thank you all anyway for your comments.

0 Kudos
Message 6 of 6
(4,519 Views)