Scaling Analog Input to float and getting negative number

Join Date
Apr 2018
Location
Clyde, Ohio
Posts
18
Hello,

I have a Micrologix 1400 PLC and using RSLogix 500. Using a Multi Ranger Ultra Sonic Level Sensor and the input is moved to N7:11, then scaled from 3120 / 15,602 to 0 / 13.5. I also added the less than/equal to 3120 and greater than/equal to 15,602 and moving them into the appropriate spot to scale the input properly, which it does. Somehow it's still showing a negative number in the SCP output, which is saved to a Float.
 
For one thing I see your actual input I:2.1 shows 2961
That is less than the scaled min of 3120
Any input value less than the 3120 min value will be a neg value
it could actually be correct for your application
 
Yes, you are moving the minimum value AFTER the scaling.

Move the scaling to the last branch.

As it is the scaling is scaling the lower value from the input, then changing it to the minimum before the scan reports to RSLogix what the value is. As smart as controllers are, they only do one step of a rung at a time and can't comprehend (yet) what is really wanted.
 
The order that things are happening is important.

When the first rung is scanned, 2961 is moved into N7:11

When the SCP instruction is scanned, the Input is still 2961

Then, after the SCP instruction is done, you check for max and min and update N7:11.

If you put the max/min check before the SCP instruction then you will see those limits effect the output of the SCP.

perhaps your ultrasonic needs to be scaled/offset properly.
 
I would change thins a little
The scale input should be I:2.1 ( Input directly Into the Scale Function)
To set the limits
if F8:11 > 15602 then F8:11 = 15602
If F8:11 < 0 then F8:11 = 0

Both compares are after the scale is executed
The scale function scales the input then you check the limits of the scaled result
 
Ok I can do that. I just took over programming for our plant and had to debug the program, since the original programmer passed away in the middle of the project. There is no organization at all, so when I get the time I will rewrite it. I just started learning ladder logic a couple months ago. But I'm loving it.
 
Speak no ill of the dead. Okay, maybe just a tiny bit.

The automation business gives me an opportunity to learn something new every day.

At a Sunday dinner last week a 22-year-old son of a neighbor commented in passing that he had been bored at work and was goofing off. I must have paused in an unusual way; he asked "what do you do when you're bored at work ?"

"I, um. I don't know. I haven't been bored at work since I was sixteen."

Now, that doesn't mean I don't sometimes goof off; my 12,000+ posts on this forum prove that.

But it's not because I'm bored !
 
Actually, is the scaling for -10 to +10 VDC the reason for the 3,120 - 15,602? It's used for the Ultrasonic level probe and a hydraulic screen. I understand the 4-20 mA and PID scaling. Never used the -10 to +10 VDC.
 
"I, um. I don't know. I haven't been bored at work since I was sixteen

Yes Ken but you aren't the usual nut :ROFLMAO:
Actually I've been fortunate lately to not having boredom be an issue. Having said that in my previous job it wasn't boredom that was the problem, anger and frustration bad enough to make me want to... well I better not say. Someone is going to do what I wanted to do one of these days and I don't want to be the suspect that confessed online :whistle:
 

Similar Topics

Dear all Iam using three load cells connected in parallel to calibrate the weight of a product but in don't have a weighting module in my...
Replies
4
Views
3,457
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
8
Views
3,605
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
2
Views
1,827
Hello! I am new at PLC programming. I am using TM221CE16R PLC with TM3AI8 analog input module and SoMachine Basic v1.6. I am trying to scale...
Replies
8
Views
7,042
Hi, A couple of years ago our old PLC5 system was changed to Controllogix by adding a 1756 processor, the old PLC5 racks + cards are now used as...
Replies
1
Views
2,948
Back
Top Bottom