07-24-2014 01:49 PM
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?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-25-2014 04:35 AM
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
07-25-2014 06:32 AM
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-25-2014 07:38 AM
07-25-2014 07:47 AM
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
07-25-2014 09:18 AM
@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?"
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-25-2014 09:46 AM
Looks Like you need to start here and finish the dirty business yourself.
(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 )
02-13-2015 11:38 AM
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.