LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update waveform and analog output without stopping and running the VI again.

Hello all!

I am just starting to learn LabView - sorry if I missed something, but some intensive Googling and trying didn't help unfortunately...

We want to send a square wave through a NI DAQ device (BNC-2090) to the oscilloscope. However each time we enter a new frequency or amplitude (manually or with increment and decrement buttons), it doesn't update the waveform. We have to stop the program and run it again to see the changes. 

 

To simplify the problem, I tried just a simple program like this and the frequency and amplitude values are updated and the graph each time is replotted without the need to stop and start.

gandg_0-1652453183977.png

 

However when I try to include DAQ writing in the loop, it doesn't work or stops updating. I tried multiple variations of this:

gandg_2-1652453334442.png

I have also tried opening the Example VI for continuous analog output (from Help-> find examples) and put everything in a while loop and that didn't work either. 

 

In some similar looking questions this is suggested as the solution: Update Multiple Analog Output DAQmx Channels On-The-Fly - NI Community , however, when I download the example VIs they don't seem to work - no wave is plotted. 

gandg_3-1652453439494.png

gandg_4-1652453465614.png

 

Any suggestions on why the above don't work would be greatly appreciated!

Thank you!

0 Kudos
Message 1 of 2
(987 Views)

You definitely don't want to call "stop task" immediately after starting the task. You also do not want the task creation and clearing inside the loop. The last block diagram looks closer to what you want, but I would add a wait in there so it takes a break between all the DAQmx writes.

 

Are you reading any errors? That might explain why your waveform graph is empty. Also check that autoscaling is turned on.

 

You mention a BNC device, but that's actually just a breakout board. Are you using a PCI-6110 card, as your last block diagram suggests?

0 Kudos
Message 2 of 2
(969 Views)