Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Difficult to understand the concept of task, physical channels and lines

Hi all, I am still new to MAX and DAQmx 8.5.
I have been using labview 7.1 for a long time.

There are somethings i do not undetstand about task.
I created a simple program to acquire the input voltage.
In the MAX, I created task, in this task I used physical channel for this task.

However, while I do the program, i found it puzzling. pls see the pic below:
Look at the red boxes. Even though I have  created task in the MAX, why does the error list still ask for physical channel?

Your help would be greatly appreciated.

 
0 Kudos
Message 1 of 9
(3,912 Views)

The reason is you are mixing and matching tasks with the create channel.  If you want to use the tasks you have created in MAX then just wire it into the start.  You have already created the channel so there is no need to call the create channel VI.  The reason you might want to use the task in the way you have it is to add additional channels into the task.  Then you need to additionally wire in some physical channels.  Hope this helps.

 

StuartG

0 Kudos
Message 2 of 9
(3,903 Views)
Hi Stuart,
Oh no wonder! . thanks for your help
0 Kudos
Message 3 of 9
(3,871 Views)
Hi astro, hope you don't mind i pop a couple of my own questions.

Stuart,  lets say i've configured AI0 to do something as a task in MAX. Let say somewhere in the VI instead of calling the task i use the physical channel AI0, it would still perform the same operation in the task right?
0 Kudos
Message 4 of 9
(3,754 Views)
You would have to explain further what you are trying to do.  There are things you can do with the physical channel, but those are pretty advanced.  What is your real use case?
0 Kudos
Message 5 of 9
(3,744 Views)
Hi ATMA,

Thank you for posting on the National Instruments forums.

If you use the Task in a DAQmx Read or DAQmx Write, then the resource will be reserved for that task.  Now if you try to access the same channel, you will have to create a task with the DAQmx Create Channel.vi which creates a new task with that channel.  If you then try to do a DAQmx Read or DAQmx Write, you will get an error message saying that the specified resource is reserved.  If you are using the task and trying to access the channel in this way, then it will not work for you.

If you just have a task created in the Measurement and Automation Explorer and are not using that task in your application, then you can access the channel without any errors. 

I hope this answers your question and please let me know if you are not using the task and channel in one of these ways.

Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 6 of 9
(3,690 Views)
Hi Nick and Stuart.

Let me see it i got it.

1) If i've created a task in MAX (say it uses ai0) but i do not use that task anywhere in my VI, i'm still able to use ai0 in my VI by using the Create Channel VI?
2) If 1 is true what happens if that task in MAX is a TEDS configured sensor (say ai1)? How would it affect my VI if i call the physical channel (ai1) but do not call the TEDS task anywhere in the VI?
2) However, if i do use that task or i've created a physical channel (which in turn creates a virtual task) somewhere in my VI, that resource would be reserved correct?
0 Kudos
Message 7 of 9
(3,687 Views)
ATMA  I think you have a pretty good understanding.  Let me explain a little more.   Tasks and any physical channels contained in that task get "reserved" when DAQmx Start is called.  If you just wire a DAQmx task into a read, then at that point under-the-hood we call start which reserves the task.  As long as the task in question isn't reserved then you can use the same physical channel in another task or create channel.  Also, if it is important once a task is reserved, you can call DAQmx stop or DAQmx unreserve which will unreserve the task (including the physical channel), and you can use another task.
 
If you need more clarification let me know
 
StuartG
0 Kudos
Message 8 of 9
(3,682 Views)
Thanks Stuart, that's pretty clear for now.
0 Kudos
Message 9 of 9
(3,647 Views)