LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Totally stumped on custom scaling

Solved!
Go to solution

Working on a simple 4-20ma output, trying to read that and scale it to a displacement measurement range 0-10mm...pretty simple stuff.  Linear relationship y= mx+b (m = 0.625, b = -2.5)

 

I'm trying to use the custom scaling vi for the first time and getting stuck...error -200077

What I don't understand why the scaling vi is messing with the create channel vi.  The module i have in my cDaq is ±20ma so i need to set the lower limit to 4ma in the create channel...at least i think so.

 

Let me know what i'm missing and thanks.

 

image.png

 

 

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

It is impossible to see how things are connected from the picture (backwards, overlapping, hidden wires, etc.). Please do a diagram cleanup and post again.

0 Kudos
Message 2 of 6
(4,254 Views)

@coolhandLV7 wrote:

The module i have in my cDaq is ±20ma so i need to set the lower limit to 4ma in the create channel...at least i think so.


That is where you went wrong.  The max and min you apply to the channel should be AFTER the scale is applied.  In other words, your max and min should be your max and min displacements.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(4,221 Views)

Below is the cleaned up code as requested.  I also changed the channel limits to the displacement range as suggested but i still get the same error.  I've also added the actual error message, looks like it wants a value == to (b) [-2.5]

 

LV2017_Scale.JPGScaling_Error.JPG

0 Kudos
Message 4 of 6
(4,175 Views)
Solution
Accepted by coolhandLV7

Your problem is your slope.  You did the math assuming mA.  But the DAQ actually measures in A.  So your slope is off by a factor of 1000 (it should be 625).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(4,163 Views)

Wow...thanks.  Super simple...can't believe i overlooked it.

0 Kudos
Message 6 of 6
(4,155 Views)