S7-300 Equivalent to RS5000 Scale and Limit Blocks

WilsonNC

Member
Join Date
Dec 2010
Location
Murphy
Posts
24
I am looking to see if anyone has any blocks that are the equivalent the RS-Logix 5000 scale and limit blocks, or if the S-7 library has blocks to do these functions. Also any working examples with comments.

I will have to scale some analog inputs, and write to analog outputs.
 
Why do we keep reinventing the wheel???

Look in standard library IEC functions there is a LIMIT, MIN, MAX and such blocks there ready to go..
 
And why do we keep cooking potatoes?

I'm sorry if my piece of reinvented ladder has offended some of you. I will eat raw potatoes with my next dinner.
:ROFLMAO:

Kalle

Because raw potatoes are technically poisonous?

Reinventing the wheel is a good way to learn how the wheel works though. So it's not always a bad thing to do.
 
FC105 doesn't handle negative numbers so I developed this solution:

FUNCTION_BLOCK SCALE

VAR_INPUT

RAW : INT; //Enter value to be scaled
rInput_Min : REAL; //Enter input value @ rest (real)
rInput_Max : REAL; //Enter input value @ max (real)
rScaled_Min : REAL; //Enter minimum engineering units (real)
rScaled_Max : REAL; //Enter maximum engineering units (real)
Gen_Alarm : BOOL;

END_VAR

VAR_OUTPUT

iScaled_Out : INT;
rScaled_Out : REAL;

END_VAR

VAR

rRAW : REAL;
Rate : REAL;
Offset : REAL;

END_VAR


BEGIN

rRAW:=INT_TO_REAL(RAW); //Convert incoming integer to REAL



IF Gen_Alarm = FALSE THEN //If General Alarm isn't present

Rate := (rScaled_Max - rScaled_Min) / (rInput_Max - rInput_Min); //solve for X
Offset := rScaled_Min - (rInput_Min * Rate); //solve for B

rScaled_Out:= (rRAW * Rate) + Offset; // solve Y=MX+B where M = RAW, X = Rate B = Offset
iScaled_Out:=REAL_TO_INT(rScaled_Out);

ELSE

rScaled_Out := 0; // GenAlarm Alarm is true, output 0
iScaled_Out := 0;

END_IF;

END_FUNCTION_BLOCK
 
Last edited:
Although these are some good examples, they dont address the equivalent of the AB LIM block. It has a high and low setpoint, then if the input is between those two values, the output (boolean) is true.
 

Similar Topics

I have started a new thread for this discussion. Previously I asked: If you were migrating from quantum to siemens, would the equivalent siemens...
Replies
20
Views
6,262
I am relatively new to the S7-300 family, but have over 15 years S5 experience and 6 years Contrologix experience. I have an app in S7 , where I...
Replies
7
Views
2,304
in allen bradley kinetix 300 drive first E31 error shows after resting drive E11 error occurs need solution to reset E11 fault code
Replies
4
Views
147
Hi, I'm setting up a modbus master on an S7-300. It seems to work in OB1 but not when I use it in OB35. Does anyone have any ideas why? Could...
Replies
10
Views
123
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
15
Views
285
Back
Top Bottom