From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

concurrent input and output

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(2,831 Views)

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.

Omar
0 Kudos
Message 2 of 6
(2,817 Views)

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

 

 

0 Kudos
Message 3 of 6
(2,795 Views)

The attachment is not working for me for some reason. Here is a screen shot.

LabVIEW_SCRN.png

0 Kudos
Message 4 of 6
(2,794 Views)
Solution
Accepted by topic author UResearch_Student

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.

Josh B
Applications Engineer
National Instruments
0 Kudos
Message 5 of 6
(2,767 Views)

Thank you for clearing that up for me! 😃

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