LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx custom scale: how do you set MIN and MAX values?

Solved!
Go to solution
Highlighted

Hello everybody,

 

I'm currently using LabVIEW 2010 and experiencing the following problem with DAQmx custom scale: I firstly created a custom linear scale (y-intercept=0, slope=50) and then a global channel which uses that scale. The real signal acquired from a NI-9205 (AI module) is in the range -8/+8 Volts; when I try to read the measure from the channel it seems saturated.

 

I discovered that changing AI.Max and AI.Min through a DAQmx Channel Property Node I can improve the situation but the point is: I was not able to set a range of -1000/+1000 for instance because it exceeds the maximum allowed and I get an error!!!

 

So, what are custom scale for???

 

Does anyone know how to fix it?

There seems not to be any possibility of having a big scaling factor! If I want to convert 1V into 1000V I will never achieve it!

 

Many thanks for the help.

 

B.

Message 1 of 6
(2,883 Views)
Solution
Accepted by topic author Blueyes

 

  HI,

 

  The custom scale will be the function that converts the input voltage to whatever units you may want.  If you use a linear scale it is in the form:

  Data in user units =    m * Vin  + b

  where m is the slope, b is the intercept and Vin is what comes in from the analog input channel.

 

  The MIN and MAX you set are the min and min AFTER scaling.  So if you want 1 volt in from channel Ain to show up as 1000 in the code, you want:

  m = 1000, b = 0

  Then your MAX and MIN is limited to -10000 and 10000 when the AI channel range is +-10V.  Selecting a MAX or MIN outside  this range will cause an error and numbers read in outside this will so saturation.

 

  The 9205 has selectable ranges:  ±200 mV, ±1, ±5, and ±10 V programmable input ranges.   I have not used the 9205 so I am not sure if this range is automatically selected or user set in the module preferences.   Either way, this will effect what the possible MAX and MIN are. 

 

  For example. 

    If you did what you said and used slope = 50, and intercept = 0, AND you had the system set to ±10 volts, then the MAX and MIN that you can set are limited to ±50*10 = ±500.   Thus if you try to put a maximum value of 1000 in there, you will get an error since it has to be within +500 to -500.   Your saturation will occur at ±10 volts (which is the scaled ±500)

     If the range is set to +-1 volt, then your MAX and MIN must be within -50 to +50.  Any values outside this will produce errors.  and if you try to read in voltages above +-1volt (+-50 scaled), it will saturation.

 

  I hope this is clear and helpful.

 

 --Alex--

Message 2 of 6
(2,871 Views)

Thank you. This is not intuitive. You would think a scale is a scale and that min/max is pure voltage to protect the system. Seems like there is space for human error to configure the device to an improper input range.

Message 3 of 6
(1,448 Views)

Good solution. I agree min/max value is not intuitive.

0 Kudos
Message 4 of 6
(1,255 Views)

Hi,

 

reading the LabVIEW help for DAQmxCreateChannel may help here:

  • minimum value specifies in units the minimum value you expect to measure.
  • custom scale name specifies the name of a custom scale for the channel. If you want the channel to use a custom scale, wire the name of the custom scale to this input and set units to From Custom Scale

When you apply a scale then you apply different units. Min/Max follow those different units!

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 5 of 6
(1,246 Views)

@jprevost wrote:

Seems like there is space for human error to configure the device to an improper input range.


I disagree.  To somebody who just cares about that measurement, it is much more intuitive to put in the range they expect their measurement to be (inches, lbs, etc).  It would introduce more error if you forced them to do the math to get back to the voltage.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 6 of 6
(1,242 Views)