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: 

Getting Scaled Units from a DAQmx Task

I have a Data Acquisition program with a few DAQ Assistants.  I'm currently using the DAQmx Task Propery Node to get an array of the channel names out of the DAQmx Task.  Is there a way to do the same thing, but with the scaled DAQmx units instead?  My DAQmx Task is made up of a few temperature measurments (RTD's and thermocouples), and a few voltage signals scaled to units of % or ppm.  I'd like to have a 1-D array of the units, which I can put in the final output data spreadsheet with the channel names.

 

Thanks,

Sam

0 Kudos
Message 1 of 7
(4,437 Views)

Hi Sam,

Thank you for posting to the NI Forums!! I think I'm a little confused as to what you mean by scaled. Could you please provide an example of what you have and what you're looking for? Are you saying that you want a way to attach the units or that you are wanting to manipulate the actual numbers so that they are on a certain scale? Please let me know and I will be happy to help! Have a great day!

Regards,
Margaret Barrett
National Instruments
Applications Engineer
Digital Multimeters and LCR Meters
0 Kudos
Message 2 of 7
(4,411 Views)

Hi Margaret,

 

Sorry if I was unclear before.  I've managed to somewhat solve my problem, in a not-so-elegant way.  I've attached an image of the block diagram, which shows the DAQ Assistants.  From there, I use a DAQmx Task Property Node to read the array of channel names in the DAQ Assistant. The resulting array ("Names") is used later as an input to a file saving VI, to generate column headings for my data.  In the DAQ Assistant, I use custom scales to define units (see the attached DAQ Assitant screen shot).  I am trying to get an array of the units (as strings) to match up with the corresponding channels.  As you can see on my block diagram, I use a DAQmx Channel Propery Node to get the Analog Input Custom Scale name (using the Channel name as an input).  This does work for getting custom scale names, but does nothing for temperatures, or anything that does not have a custom scaling.  If there is a custom scale, I use the DAQmx Scale Property Node to get the ScaledUnits output.  If there is no custom scale name, then it adds "Deg C" into the array, since everything in my DAQ assistant has a custom scaling except for my temperature measurement.  While this works fine for now, I was hoping to having something more dynamic, which would work for any unit, custom or not, without having to modify the block diagram in the event the DAQ Assistant is modified.

 

Hopefully this somewhat clearer.  I'm not terribly experienced with LV, so I was hoping there was a nicer way of accomplishing this.

Download All
0 Kudos
Message 3 of 7
(4,407 Views)
Here is my SubVI which extrats a Name and a Channel from the Waveform datatype.  You are using a Signal datatype, so you may need to convert or something.  Wrap this up in a fro loop and you should have what you need.
0 Kudos
Message 4 of 7
(4,395 Views)
Uhg..my description failed.  It extracts the Channel Name and Channel Units from a waveform as string output.  This is 8.6, please let me know if u need me to save as previous version.
0 Kudos
Message 5 of 7
(4,393 Views)

I am running 8.5.1 (hoping our dept gets 8.6 soon).  I'm not at work now so I can't try it out yet, but hopefully that will do what I'm looking for.  

Thanks for the help!

0 Kudos
Message 6 of 7
(4,382 Views)

Here you are.

 

Again, I am using the "Waveform" datatype.  In your example you are using the "Signal" data type.  I'm not sure what the differences are, exactly, but I do know that they are different and therefore my subvi may not work for you.  Still, it may give you some idea.  "Signal" data type comes from express VI's where as the Waveform datatypes come from non-express VI's.... that may have something to do with it.  I've had to convert from Waveform to Signal before using the dynamic datatype converter Express VI, but never the other way.

 

Message 7 of 7
(4,367 Views)