Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Querying DAQmx channel types in LabVIEW

I want to have my LabVIEW application look through all the DAQmx tasks defined on the computer and display to the user a list of only analog input tasks.  I tried to do this by:
  1. Use the DAQmx System property node to retrieve a list of all tasks.
  2. For each tasks, use the DAQmx Task property node to retrieve a list of all channels.
  3. For each channel, use the DAQmx Channel property node to query its ChanType.
  4. If all ChanTypes turn out to be Analog Input, then I admit the task into the list.
The problem is that I have tasks that I know are analog output tasks, but the DAQmx Channel property node still return "Analog Input" as their ChanType.  Am I seeing things, or is this a bona fide problem?  Is there a better way to get a list of the tasks I'm interested in?
0 Kudos
Message 1 of 4
(2,886 Views)
Hello,
 
That is strange.  I built a VI which queries the DAQmx Task Types like you describe, and it works correctly for me.  If all channels in a task are analog input (by the way, this is a little redundant as all channels in a task must be of the same type), then the task name is passed to an array.  Otherwise, an empty constant is passed.
 
Try running the attached VI and see if it works correctly for you.

Regards,
Sean C.
0 Kudos
Message 2 of 4
(2,875 Views)
After further poking around, I found out that what was really going on was that for non-global channels, the Channel properties node doesn't work.  It was in fact returning an error.  I didn't realize this.  It just so happens that when it returned an error, it also returned a value of "analog input" for channel type.  I find that a little troubling.  Maybe NI would be open to a suggestion for changing this behavior.
0 Kudos
Message 3 of 4
(2,871 Views)
Hello,
 
Can you attach a copy of the code you are using to get this error?  I cannot reproduce what you are seeing on my computer.  If an error occurs at a property node, then that property node does not execute.  You are probably seeing Analog Input because that is the default value for that property.
 
Regards,
Sean C.
0 Kudos
Message 4 of 4
(2,854 Views)