06-12-2013 02:57 PM
Hello,
I am creating an application in LabVIEW 2012 using an X Series USB-6341 DAQ and DAQmx 9.5.5. I am a little unclear on the issue of task handling. Here is what I want to do:
The LabVIEW program will automate a study which will involve a series of trials.
Each trial will start with the press of a button.
Once the trial starts I want to continuously sample from three analog input channels on the DAQ.
A specified number of seconds after the trial starts, I want to send a signal to one of the DAQ analog output channels which will communicate with a stimulator.
Then the trial will end with the press of another button and the task(s) will be closed.
This is what I am unclear on: It is my understanding that only one Analog input or output task can communicate with a DAQ at a time, when I try to run more than 1 task I get error 50103. However it is alo my understanding that all channels involved in a task must be of the same IO type.
So my question is: is it possible for me to continually sample during my trials and also output a signal during the trial and if so, how should I set up the tasks? I have attached a VI with what I have created so far. It only runs the input part. If anyone could help me include the output, I would be very grateful.
Thanks,
Quinn
Solved! Go to Solution.
06-12-2013 04:20 PM - edited 06-12-2013 04:24 PM
How are you setting up your tasks?
You could set up one input task with all 16 AI lines and read them all back as an array of values. Or you could set up 16 tasks one line each. You could also set up one output task with the 2 AO lines.
You can't mix the input line with the output lines in the same task, but you can create seperate tasks for them. The same goes for the DIO lines.
Error 50103
NI Platform Services: The specified resource is reserved. The operation was completed by ignoring or overriding the specified resource.
I think you are assigning the same input or output line to different task.
Is the problem with re-assigning the clocks? There are four counter/timers, but only one clock (I think?) so both the input and output use the same clock. That might be the resource that is reserved.
But you should be able to read input lines at the same time you are writing to the output lines.
Post how you are setting up your tasks.
06-13-2013 09:10 AM
Thanks for the response.
Sorry, I ment to attach my VI, it should be attached now.
I am not getting error 50103 anymore.
I only need to read from 3 AI lines and I have that set up already. I just need to add in writing to one AO channel part way through the trial.
You are saying that I can set it up as a new task while I still have the AI task running?
How would I re-assign the clock and still keep the AI task running?
Quinn
06-13-2013 09:12 AM - edited 06-13-2013 09:18 AM
The attachment is not working for me for some reason. Here is a screen shot.
06-14-2013 08:05 AM - edited 06-14-2013 08:05 AM
Hi Quinn,
You can set up a separate Analog Output Task with it's own clock source. On X-series devices, Analog Input and Analog Output tasks have their own internal timing engines on that you can use.
06-19-2013 11:41 AM
Thank you for clearing that up for me! 😃