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: 

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
(4,219 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
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 2
(4,194 Views)