scl fb in siemens

dilliganesh

Member
Join Date
Oct 2013
Location
*******
Posts
15
hi friends any one please tell me how to use scl function block in siemens s7 1200
my requirement is to convert 4-20 ma current signals to 0 to 120 ppm
i am new to this software
 
Hello Dilliganesh,

At the first input "IN" put in you analog in value as int.
At "Hi_lim" put in your high limit ( 120)
At "Lo_lim" put in your Low limit(0)

Best Regards /Victor
 
Last edited:
as add-on to Dilliganesh:
what viktor show is a built-in function in TIA (not a fb, so it does not need DB)

also output is your scaled value and ret_val is error code. both must be defined, but you can use one temp variable for all ret_val if you need to call this function multiple times.
also don't forget to set Bipolar, it also has to be defined as TRUE or FALSE (but i think it cannot contain constant in ladder)

just FYI, in step7 classic there is SFC104 or SFC105, don't know exatcly but i don't think you use that as you specified s7-1200.

EDIT:
if you write in scl then:
Code:
[FONT="Courier New"]#temp := SCALE(IN := <raw_analog_int>,
               HI_LIM := 120,
               LO_LIM := 0,
               BIPOLAR := FALSE,
               OUT => (your_scaled_var));[/FONT]
 
Last edited:
hi victor i know this scale block but ...can u explain how its convert 4-20 mA current signals to 0 to 120 PPM..... i need a explanation about this block
 
it is pretty well explained in Help section with formula and picture.
Go to Help, search, SCALE (or SCALE_X maybe for s7-1200 cause SCALE is for s7-300/400)
 
I don't know which firmware you have, but with older FW you need 1st to use NORM_X to normalise raw value to 0-1 then use SCALE_X to rescale that to your value cause with older version SCALE_X used only normalised input (i.e. input needed to be between 0-1).
best to check both NORM_X and SCALE_X
 

Similar Topics

Hello, When you want compare values of an array to a range of numbers is it a right way to do that? FUNCTION ADD VAR_IN_OUT A:ARRAY[1..50]...
Replies
5
Views
2,066
Hi All, I need to try and convert some code from Siemens SCL (TIA16) over to Allen Bradley RS5000. I have attached an image of the SCL and what...
Replies
10
Views
4,049
in the scl code written in screenshot Line 1 condition is false but still the program checking the line 2 condition and says it is true i had...
Replies
3
Views
1,752
I am new to PLC programming. Is there a standard way to incorporate alarms / warnings / events such as the exceptions in C++ or Java where you can...
Replies
5
Views
1,958
Hello All, I am new to programming with Tia Portal and I am having difficulty with something that we have found "easy" in other programming...
Replies
3
Views
2,371
Back
Top Bottom