LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with using DAQmx Scaling

Solved!
Go to solution

I have a cDAQ-9171 with a NI 9207 inserted into it. I don't have anything actually hooked up to the DAQ right now, but I'm using NI-max to set up a task to use in LabVIEW, and it seems like the scaling is not working at all.

 

I have it set up to read AI0, Min = -10, Max = 10 (of the scaled units). When I run the task in NI-MAX to get a reading I get ~6mV or .006V.

 

Here are the results I get when I apply the following scales

Y = 2X+0 -> I still get .006V

Y = 2X+1 -> I still get .006V

Y = 3X+0 -> I get ~2V (WTF?!)

Y = 3X+1 -> I get thrown an error. AI Min has to be greater than -9.9 and less than 10.9. WTF?! This range is of the scaled units, shouldn't it be within -29 to 31 (assuming the limit of the DAQ is -10V to +10V?)

 

Can someone please explain why I'm getting the AI Min error, and what is going on with the scaling?

0 Kudos
Message 1 of 4
(2,417 Views)

Hey DDang,

 

You said "I have it set up to read AI0, Min = -10, Max = 10 (of the scaled units)" and I am unsure what it does really mean.

Can you share a screenshot of the configuration you have and the error you get so that we have a bit more info ?

 

Maybe that can help : http://www.ni.com/product-documentation/54458/en/

 

Thank you 🙂

CLAMaxime -- Kudos are a great way to say thank you
0 Kudos
Message 2 of 4
(2,399 Views)
Solution
Accepted by topic author DDang

I've only used Scales once, and it was an "education".  I was working with a Triaxial Accelerometer that had a gain of "about" 0.3 v/g (g = acceleration due to Earth's gravity at sea level) and a bias of "about" 1.5 v.  I wrote a Calibration utility that tested and returned the correct numbers for each of the three axes (the manufacturer's Data Sheet said their values were "within 10%", not very accurate!) and I wanted to use those to get my outputs in units of "g" instead of Volts.

 

I tried doing this with MAX.  Didn't work well, as I recall.  I tried doing it within LabVIEW Project -- didn't work well.  Came here to the Forum, and someone (crossrulz?) said "Just Byte the Bullet and do it in DAQmx".  So I did, and it worked like a charm.

 

Here, without much explanation, is the routine I use to create the Cluster that I will later use to read from the Accelerometer (the third Cluster element is the Task input for the DAQmx Read).  The Bias and Gain scaling factors come from the Calibration procedure mentioned earlier, with independent scaling for each of the three Axes.

Scaled Task.png

 

Bob Schor

 

0 Kudos
Message 3 of 4
(2,380 Views)

Late reply but yes, MAX was not working at all and everything was definitely not being calculated correctly. I bit the bullet and did it in DAQmx in Labview and it was great.

 

There must be some kind of bug in MAX because it 100% was not working as expected

0 Kudos
Message 4 of 4
(2,262 Views)