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.
Solved! Go to Solution.
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.
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.
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.
reading the LabVIEW help for DAQmxCreateChannel may help here:
When you apply a scale then you apply different units. Min/Max follow those different units!
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.