Explain a LIM (Limit Test)

Snide

Member
Join Date
Oct 2005
Location
Pittsburgh
Posts
73
Hi, I'm very new to PLC's. I'm trying to understand a program that someone else has written. I having trouble understanding the LIM (limit test)I understand where the High Lim and Low Lim come from, but where does the value for the 'Test' come from. I'm looking at a program that has
low lim 4000
4000<
Test I:7.0
12234<
High Lim 20000
20000<
I understand that I:7.0 is an address input but, where does the 12234 come from. Is that a value from the input? Could you please explain the 'Test' part of the LIM (limit test). Thanks ~Snide
 
The "12234" is the current value of input word I:7.0

This rung is true because:

4000 < 12234 < 20000

Or, verbally, the "Test" value is between the low and high limits.
 
A copy of RSLOGIX instruction help. From the help file

LIM [Limit Test]



Use with processorsSLC 5/02SLC 5/03SLC 5/04SLC 5/05 All MicroLogix Example of Instruction(Parameters shown are examples only, your data will vary.)
Description

Use the LIM instruction to test for values within or outside a specified range, depending on how you set the limits.

Entering Parameters

Depending on how you define the Test parameter, the Low and High Limit parameters can be a word address or program constant. See below.

Test Low Limit High Limit
Constant Word Address Word Address
Word Address Constant or Word Address Constant or Word Address
True/False Status of the Instruction

If the Low Limit has a value equal to or less than the High Limit, the instruction is true when the Test value is between the limits or is equal to either limit. If the Test value is outside the limits, the instruction is false.
If the Low Limit has a value greater than the High Limit, the instruction is false when the Test value is between the limits. If the Test value is equal to either limit or outside the limits, the instruction is true.


Related Topics

Comparison Instructions
Addressing Help

Rockwell Software 2005
 
Last edited:
Mickey said:
If the Low Limit has a value equal to or less than the High Limit, the instruction is true when the Test value is between the limits or is equal to either limit. If the Test value is outside the limits, the instruction is false.

If the Low Limit has a value greater than the High Limit, the instruction is false when the Test value is between the limits. If the Test value is equal to either limit or outside the limits, the instruction is true.
The second paragraph (bold) is a subtle tidbit of knowledge because this basically allows a limit instruction to look mathematically improbable.

I have seen people examining the logic go crazy trying to understand this...

Good one, Mickey. In my race to reply to this, I took the easy answer. Yours examines the "complete" answer.
 
I was wonder about SCP (scale with parameters). Maybe you could expain the rung I have. the program is for reading data from a radar on a liquid tank. like i posted before for the lim
4000
<4000
I:7.0
<12234
20000
<20000

and on the same rung

SCP
input I:7.0
<12234
input min. 4000
<4000
input max. 20000
<20000
scaled min. 2.0
<2.0
scaled max. 119.0
<119.0
output F25:3
<62.21113

how do you calc. by hand to get 62.21113?? how do you choose scaled min and max??
My boss wants me do use this program for 8 other tanks and i want to make sure I'm doing this stuff right.

I read the help on RSlogix 500, but I need more help.

Sorry for all the questions.
 
The SCP instruction calculates the constants for and executes the standard equation for a line:

Code:
y = mx + b

with the constants being:

Code:
m slope of the line
b line offset from the origin

m is the change in your scaled value over the change in input. in your case it is:

Code:
m = (scaled max - scaled min) / (input max - input min)

b can be back calculated from any two known points on the line once the slope is known.

Code:
b = scaled max - (input max * m)

Scaled max and min as well as input max and min often come from your sensor calibration. All you need are two known points along your input signal and the scaled units those points correspond to. In your case it looks like someone scaled a 4-20mA signal to equal 2 - 119 user units.

I hope this helps.
Keith
 
Last edited:
Raw Data = value at I:7.0
(((raw data - min raw data)/ max range)* Engineering units max value-min value)+offset.
ie. ((( 12234-4000)/16000)*119-2)+2=62.21113

The min and max value are the scaling of your Transmitter at the tank
ie 4-20ma= 2 to 119 inches

Hope this helps

Kamenges you type faster then I do
 
This is quick:

% = (Input-Min)/(InputMax-InputMin) = (12234-4000)/(20000-4000) = .514

NewValue =(%*(ScaledMax - ScaledMin))+Scaledmin = (.514*(119-2))+2 = 62.12
 

Similar Topics

and then when i open the windowmaker, intouch is shutdown... that's not work that's demo I have 30days demo
Replies
3
Views
132
Hi All In my plc program in following picture there are functions FC50 in the begining and FC51 in end of organization block OB32. I can not...
Replies
3
Views
935
Just for readers in the US, when I write 'gas' I mean it as a state of matter, not shorthand for gasoline :-) I don't understand the logic of a...
Replies
39
Views
11,073
Hello all, I have recently been working on a project utilizing Allen Bradley PLC/HMI. It's an L16ER-BB1B PLC and a Panelview Plus 7 HMI. I'm...
Replies
15
Views
5,342
I’m using rslogix5000 v20 with ControlLogix L72. I added some rungs to monitor time meter of our propulsors. But with same ladder instruction I...
Replies
11
Views
3,938
Back
Top Bottom