LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use both analog outputs of USB 6251 concurrently in same block diagram

Hi:
 
I would like to create a square wave for AO 0 and a DC voltage of 5V or -5 V for AO 1. I wrote two while loops, which are running perfectly independent.
But when I copy the one while loop to the same block diagram of the other while loop, it says that the one device is reserved?? Does anybody know why? I have no idea: (
 
THAMKS...
0 Kudos
Message 1 of 6
(3,030 Views)
Hi!

If you select the 2 different output Channels for example Dev1/ao0 and Dev1/ao1 there shouldn't be any problem. You can just try it if you using the the "Cont Gen Voltage Wfm-Int Clk.vi" and copy the code from the examleple "Gen Voltage Update" into it. Move the DAQmx Write VI from this task into the while loop, rewire it and do a errorhanding in the right way, by using also the status in the while loop and mege the two clusters at the end. It sould work fine, on the first channel the sind wave is generated, on the other you can select a voltage.

Best Regards
Tobias Lange
0 Kudos
Message 2 of 6
(3,013 Views)
See if this example vi helps you
0 Kudos
Message 3 of 6
(3,002 Views)

Thanks Tobias and Dev!

You helped a lot! But I still have little issues. I want to run several loops concurrently, so the square waveform mustn't start before the loops start. I tried to put the DAQmx write of the square waveform in the loop, too (and set the autostart to true), but then there is a warning 200015:

Warnung 200015 ist bei DAQmx Write (Analog Wfm 1Chan NSamp).vi:1 aufgetreten

 

Do you know how I can get rid of this?

THANK YOU!!!!

0 Kudos
Message 4 of 6
(2,997 Views)
Hi!

Don't use the autostart, bult a little case structure in your loop and place the DAQmx Start vi in the true case, nothing in the false case. As the condition use the "first call?" from the synchronisation palette.
0 Kudos
Message 5 of 6
(2,992 Views)

THANK YOU SOO MUCH, it's working: )

Maybe you can explain another time (no hurries) why I use the first call? I don't know why the error or warning is gone now. But it's gone and that's good so far: )

 

THANKS!!!

Steffi

0 Kudos
Message 6 of 6
(2,987 Views)