LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Apply DAQmx Scale To Value

Okay so let say I have a DAQmx scale defined in MAX, that converts from volts to PSI.  Is there an easy way, to give an arbitrary value for the voltage, and have it tell me what PSI that is?  Or vise versa, to give an arbitrary value for PSI and have it tell me the voltage?

 

Notice how I didn't say what type of scale this is?  That's because it can be defined by the user and it could be any supported by DAQmx.  I could write custom code to support each type of scale and then do the conversion.  But is there an easier way?  Is there a low level VI I'm unaware of that can apply a DAQmx scale to a value?

0 Kudos
Message 1 of 8
(3,325 Views)

You are aware that "DAQmx Create Channel" has an input "custom scale name"?

From the sound of your question, i can imagine that this is somehow a good step to a solution....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(3,282 Views)
You are aware my post asked nothing about DAQmx channels or tasks.
0 Kudos
Message 3 of 8
(3,272 Views)

Hi Hoovaa,

 

DAQmxScales apply to DAQmxChannels.

 

When you want custom scaling of some arbitrary values in your VI you will need to use your own scaling routines.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(3,260 Views)

If you have a DAQmx scale in MAX defined, you can use the DAQmx API (primarily property nodes) to read the configuration (type and parameter values). That info can be used to create a "scaling algorithm" you can use independently from DAQmx in your application.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 8
(3,252 Views)

@Norbert_B wrote:

If you have a DAQmx scale in MAX defined, you can use the DAQmx API (primarily property nodes) to read the configuration (type and parameter values). That info can be used to create a "scaling algorithm" you can use independently from DAQmx in your application.


Yeah this is the last resort of course and this is what I meant when I said.

 

"I could write custom code to support each type of scale and then do the conversion.  But is there an easier way?"

0 Kudos
Message 6 of 8
(3,240 Views)

Looks Like you need to start here and finish the dirty business yourself.

!2.png

 

(Unfortunate- a set of primitaves that auto adapt to scalar, array or waveform would be a nice add to the palatte- the underlying code is probably buried in some DAQ dll but not exposed in LabVIEW )


"Should be" isn't "Is" -Jay
Message 7 of 8
(3,230 Views)

Thanks for the jump start, Jeff.  See attached for polymorphic (waveform, array, scalar) VI to convert raw values based on DAQmx scale.  Test wrapper also included.  It shouldn't be too much work to break out scaled-to-raw.  Note that Table and Map scales are unbounded.


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
Message 8 of 8
(3,035 Views)