LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Outputting to two different channels simultaneously

Solved!
Go to solution

Hi Guys,

 

I am having trouble with sending out two simultanous outputs (to two different channels) once a case conidition is on true. Here is a picture of the program (program attached as well):

 

As you can see, I am having the write command output to two different channels as when the case is true, the output is supposed to light up two leds. The message error that I recieve with this is:

Resource required by this task has already been reserved by a different task" after Labview highlights the write command box for the error. Any suggestions would help!

 

Thanks!

0 Kudos
Message 1 of 10
(4,251 Views)
BTW: the DAQ  card for the output is a NI 9263
0 Kudos
Message 2 of 10
(4,250 Views)
Also, on the diagram I have both channels listed as ao0. This is wrong! The bottom one is supposed to be ao1. I don't have the DAQ with me at the moment so can't change it! When both are different channels, I still get the error! Thanks!
0 Kudos
Message 3 of 10
(4,249 Views)

You would have to group both outputs in the same task before outputting, that's what the error says.

 

Use  DAQmx Create Virtual Channel to configure them. You can either configure them both in one call by adding both channel names to the physical channel list or make two calls to the VI and wire the task out of the first call to task in of the second, then thein"Daqmx Write.vi" select "Analog>Multiple channels->whatever you want".

 

Channels can be listed in a string constant and wired directly to the physical channels input (automatic coersion), e.g.  "Dev0/ao0, Dev0/ao1"

Regards,
André (CLA, CLED)
Message 4 of 10
(4,230 Views)
Solution
Accepted by topic author M3GAPL3X

That looks familar.

 

Look at the VI fix posted in response to this question:

http://forums.ni.com/ni/board/message?board.id=250&thread.id=44243

Message 5 of 10
(4,228 Views)

Thanks guys. I'll try the following out from Andre:

"Channels can be listed in a string constant and wired directly to the physical channels input (automatic coersion), e.g.  "Dev0/ao0, Dev0/ao1" "

and tell you guys if it works or not!

 

Thanks again.

 

0 Kudos
Message 6 of 10
(4,193 Views)

Hi Andre,

 

When I do , the write channel wants an array of input. It seems like I have to make a 1-D array of index 0 = 2, index 1 =0 , index 2 = 0 if I want to turn on LED one. Is that true?

 

This was just a test program to see if it even outputs correctly.

However, this doesn't seem to work. I am inputting something wrong into the write statement? Is the array that I built incorrect? Any insight on this would help!

 

Thanks

0 Kudos
Message 7 of 10
(4,179 Views)

BTW: I know that the two 0's on the input array are not wired. They were wired when I tested the program but when I took the screenshot I Was still working on the program.

 

0 Kudos
Message 8 of 10
(4,178 Views)
Nevermind guys, figured it out. Thanks for all the help!
0 Kudos
Message 9 of 10
(4,172 Views)
Please don't post images that are hosted at some other site. I for one, am blocked from there. Just attach them to your post.
0 Kudos
Message 10 of 10
(4,169 Views)