bgtorque

TIA Portal and Scaling Channels

2 posts in this topic

Hi All
I'm from an Allen-Bradley background and i'm using an S7-300 on a project.  With scaling a channel in AB I had a Scaling Block setup which would take in a raw input (counts) and multiply it by a scalar to return a value in the appropriate engineering units.  I then had an ADD block that would let me add in an offset. So to calibrate the channel, say for a pressure transducer I would simulate a voltage or current input and note counts and then a different voltage or current and note counts again.  Then looking at the gradient vs what those currents or voltages should represent in kPa I would derive a scalar to apply to the counts.  After applying this scalar I would then simulate another pressure and apply the appropriate +ve or -ve value in the offset to get the correct reading in kPa.  So, all I would need to do in the HMI is allow the appropriate calibration engineer access to change the scalar and the offset values (for calibration you would make the offset 0 and the scalar 1 initially and then do the calibration).

With TIA there is a Scaling function already under the basic instructions called scale.  This looks like you stipulate the theoretical high and low value of the sensor (say 100kPa to 1000kPa) and the block works it out for you.  My question is really, how to you calibrate this in reality, since that pressure transducer might return 4-20mA = 87.558kPa - 1057.849kPa, for example?

Share this post


Link to post
Share on other sites

This is a function block that mirrors the SCP command in RSL500.  It is written in SCL.

 

FUNCTION FC1610 : INT


// Block Parameters
VAR_INPUT
    // Input Parameters
Raw : DINT;  
RawMin : DINT;
RawMax : DINT;
EngMin : REAL;
EngMax : REAL;
END_VAR

VAR_IN_OUT
    // I/O Parameters
END_VAR

VAR_OUTPUT
    // Output Parameters
Scale : REAL;
END_VAR


VAR_TEMP
    // Temporary Variables
d2r : REAL;
END_VAR

    // Statement Section
    ;
    d2r := Raw;
    
    Scale := (d2r-RawMin)*((EngMax-EngMin)/(RawMax-RawMin))+EngMin;
    
    FC1610 := 0;
    
END_FUNCTION

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now