LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to combine two analog outputs into the same task?

Hi,
 
I'm using LabVIEW 7.1 (will buy a 8.2 soon) and PCI-6110.
 
In my application, I have a steel cantilever beam with two shakers contact it and a sensor at the tip of the beam. I wanna use the setup to do the following:
1. Sending out an analog output sinusoidal signal (A1, F1 and P1) to ONE shaker to generate the beam vibration and measuring the vibration of the beam at the sensor location by obtaining the analog input sinusoidal signal (A1', F1' and P1');
2. Sending out another output analog sinusoidal signal (A2, F2 and P2) to ANOTHER shaker with a corresponding amplitude, the same frequency (F2=F1') and a phase with fixed phase difference with the measured one, i.e., P1'. 
 
Now, I made a vi (please find the attachment) which has two analog outputs and one analog input. However, when I run it, I got "Error-50103 occurred at DAQmx Write". Now, I know the reason is that I am concurrently running two analog output tasks. Even though the tasks use different channels, this is still a conflict because they require use of the same multiplexer and sample clock. To resolve this issue, I should combine two analog outputs into the same task.
 
Could you please tell me how to do it?
 
Thank you very much!
 
Marlon
0 Kudos
Message 1 of 9
(8,392 Views)

what you describe should work.

but looking at your vi, on top of the style atrocities, you create two tasks for the same channel!! then of course, error 50103, reserved ressources Smiley Wink

btw, if you want you can use a single task to address both channels. in the channel list control just use AO0:1, to adress channels 0 and 1. then you will have to use DAqmx write Nchan Nsamp, and input an array of 2 waveforms.



Message Edited by Gabi1 on 01-07-2008 09:03 PM
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 2 of 9
(8,390 Views)

correction: you are right, two AO sould not be placed in separate tasks. so just make a single task for both AO channels, as explained above.

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 3 of 9
(8,382 Views)
Hi, Gabi1:
 
Sorry, but when I run it, I did choose different channels (one is Dev1/ao0 and the other is Dev1/ao1) from the Front Panel. The problem was there.
 
I'll try the way you told me to use a single task. 🙂
 
Thank you very much!
0 Kudos
Message 4 of 9
(8,381 Views)
BTW, do you know where I can find some examples to use a single task here?
 
Thank you!
0 Kudos
Message 5 of 9
(8,379 Views)

Here - look at this example, complete it (params for sin waveform, finish and stop) and run it.

tell me if it helps.

 

 



Message Edited by Gabi1 on 01-07-2008 11:45 PM
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 6 of 9
(8,371 Views)

This example is a good start, but I found that I needed to implement a wait until done to get it to run properly. The following works: http://digital.ni.com/public.nsf/allkb/0C1ADEF06A54AB2D862575040066FD51 , but is problematic because I can't control the timing with this, (i.e. the output ignores the time points in the waveform) and I needed to. Implementing a wait until done, I needed an extra sample for the wait until done:

 

http://digital.ni.com/public.nsf/allkb/EAA2CB9EC5236E3E862570D7008021F0

 

and ultimately, lead to the attached picture/file. The for loop isn't necessary, it just happens if there is a timing error. This works for me, and I really hope it helps someone else out... it was very surprising that labview doesn't have an example for this.

 

 

Download All
0 Kudos
Message 7 of 9
(6,993 Views)

LabVIEW does have examples for multiple channel output. I think all of the 2013 analog output examples work with multiple outputs.

0 Kudos
Message 8 of 9
(6,978 Views)

Thanks..

0 Kudos
Message 9 of 9
(6,353 Views)