Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Channel Properties for a task defined with MAX.

Hi,

I need to create and send TCP messages which contain channel properties such as name, units, measurement type, max value, and min value.  These parameters are set using MAX.  I want my input to be one or more DAQmx task names and get the properties of the channels associated with these tasks.  I am using the DAQmx Channel property node but I am getting an "Error 200658 occurred at Property Node DAQmx Channel (arg 1)".  Can someone tell me how I can iterate through the channels of a task and get their properties.  I have tried setting the "Active Channels" property inside a loop which is fed by the array provided by  the "Channels" property in DAQmx Task property node but I get the same error.

I also noticed that a channel can be selected for the DAQmx Channel property node with the DAQmx Create Channel vi but I cannot use this to specify a channel created by MAX.

Any suggestions are appreciated.

    Thanks
    Michael

P.S I originally posted this on the LabVIEW board but was told that I should move it here.
0 Kudos
Message 1 of 8
(7,906 Views)
Hello Michael,

I have attached some code and a picture of the code below that outlines how to get the properties out of a task.  This code is setup to pull all channels from MAX, or get information on a specific channel.  I've only selected a few properties to retrieve, but there are many other.

To get the channel/task properties you need to to first get a handle to that task/channel.  This is done in the example through the System Property node or the DAQmx Global Channel control.  I hope this gets you started.

Regards,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
Download All
0 Kudos
Message 2 of 8
(7,890 Views)

I need to know how to read AI.Max and AI.Min from a single channel in a task. When I attempt to do so, I get the following error:

 

Error -200658 occurred at Property Node DAQmx Channel (arg 1) in GetChannelMaxMin.vi->LPCUHeaterControl.vi->LPCUMainScreen.vi 

 

Possible reason(s):

Measurements: Attempt to get property failed, because your task contains multiple channels, and the property has different values for different channels.

 

Get this property one channel at a time using Active Channel to specify each individual channel.

 

How do I get the property one channel at a time using Active Channel? I can set (write) a single Active Channel and properties, but it seems that I can not get (read) the Active Channel, nor any of its properties. The ActiveChans property is write only. Is there a get ActiveChannel function somewhere that I am missing?

 

The Channels array is an array of DAQmx Global Channels. The property node of this data type does not give access to AI.Min and AI.Max. Please help!

 

GettingActiveChannelProperties.jpg

 

 

0 Kudos
Message 3 of 8
(7,636 Views)

Try something like this.

 

Channel Properties.PNG

0 Kudos
Message 4 of 8
(7,626 Views)

Dennis,

 

Thanks for the quick reply. Your proposed solution was actually the first thing that I tried. Unfortunately, when I try the following:

 

GettingChannelProperties2.jpg

 

I get an error the first time the DAQmx Channel property node is executed:

 

Error -200428 occurred at Property Node DAQmx Channel (arg 1) in GetChannelMaxMin.vi->LPCUHeaterControl.vi->LPCUMainScreen.vi 

 

Possible reason(s):

Measurements: Value passed to the Task/Channels In control is invalid.

The value must refer to a valid task or valid virtual channels. 

 

 

I believe this is one of the same errors that the first poster of this issue was referring.

 

It seems the elements of the Channel array (produced from the DAQmx Task property node) are not the data type that the DAQmx Channel property node expects. If I create a control from one of the Channel elements, and then create a property node from that control, AI.Min and AI.Max are not valid properties of the property node as shown in the screen shot below.

 

The DAQmx Channel property node seems to expect that a task be wired to it. I am still at a loss at how to retrieve AI.Max and AI.Min from individual channels in a task. What am I doing wrong?

 

DAQmxChannelPropNode.jpg

 

0 Kudos
Message 5 of 8
(7,612 Views)

Hello natewkidd,

 

For properties that will vary by channel, you need to define the Active Channel property before reading those properties.  It will look something like this:

Get Channel Properties.jpg

This will give you the AI.Max and AI.Min for the channel defined for "ActiveChans"

 

Regards,

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
Message 6 of 8
(7,608 Views)

Seth,

 

Thanks, that works! For some reason I didn't think I could write and read in the same property node, but I think ActiveChannels might be an exception.

 

nate

0 Kudos
Message 7 of 8
(7,603 Views)

Nate,

 

Actually (at least as far as DAQmx is concerned) you can freely read and write in the same node all you want.  Granted, some properties can only be read (for instance pretty much all of the device properties), but in general you can just right-click on the property line and select "Change To" » "Read" or "Write".

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
Message 8 of 8
(7,582 Views)