LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's the difference between DAQmx create task and DAQmx create virtual channel?

Hi, 

 

In an example(attached), the DAQmx create task funtion is connected with DAQmx create virtual channel function, but no task was created in the DAQmx create task function because no virtual channel is selected. Rather a task or line is created in the DAQmx create virtual channel function. 

 

Two questions,

What's the purpose of using DAQmx create task, to me it seems useless here. 

 

It seems both function can create task, what will happened if selected a different line in the DAQmx create task function, say line 2 in this case?

0 Kudos
Message 1 of 2
(2,059 Views)

The DAQmx Create Virtual Channel adds a channel to a task.  If a task does not exist, it creates one.

 

The DAQmx Create Task is useful when you want to add many channels to the task.  The main situation I have ran into is when I'm creating a data logger with many AI channels.  I have the settings for the AI channels in an array and then I can just use a FOR loop to add each desired channel to the task.  The DAQmx Create Task is needed in order to iniitalize the task and pass the task into the shift register on the FOR loop as the channels are added.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 2 of 2
(2,034 Views)