LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can ai ports be accessed by different tasks on USB-6221?

My program creates task1 and reads volts on ai0. Works great. I tried to create task2 to read volts on ai1. But when I start task2 I get error -50103 with text message saying "specfied reource is reserved". Does this mean that the eight ai ports (ai0-ai7) can only be accessed by a single task? Should I stop the first task before starting the second? In other words, start task 1, read ai0, stop task1, start task2, read ai1?

 

The reason I want two tasks is because ai0 and ai1 represent two logically different quantities. For example, I'd like to call the first task "temperatureTask" and the second task "pressureTask".

 

Further information: I'm using "one sample on demand" for the first task and "N samples at a time" on the second task. Is timing the issue?

 

thanks!

 

 

0 Kudos
Message 1 of 2
(3,229 Views)

The problem is most likely that the two tasks are trying to concurrently access the same resource, mainly the analog to digital converter and/or sample clock. This will happen regardless of whether the tasks utilize the same channels or not. Try combining the two analog inputs into the same task. This link walks through what I’m talking about:

 

http://digital.ni.com/public.nsf/allkb/485201B647950BF886257537006CEB89

Ross S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(3,184 Views)