Bryll

MrPLC Member
  • Content count

    349
  • Joined

  • Last visited

Files posted by Bryll

  1. Range_Fnc

    I sometimes need to scale an analog value, so I had to do a function to better suit my needs than Siemes "Scale" function.
    It has 5 inputs, all in integer format.
    _In - The value to be scaled
    _In_Min - Lowest value of the "_In" signal.
    _In_Max - Highest value of the "_In" signal.
    _Out_Min - Lowest allowed value of the scaled output.
    _Out_Max - Highest allowed value of the scaled output.
    The output "_Out" is the calculated value in integer format.
    Edit.
    It's saved as a global library.
    TIA Portal V13 SP1 Upd. 4

    281 downloads

    Updated

  2. Calculate Range (Scaling) GX IEC Developer

    A simple Function Block used to scale and unscale values.
    Input is in Integer format.
    Output is in Real format and also in Integer Format.
    Min and Max input values specifies the range of the input signal.
    Min and Max output values specifies the range of the output signal.
    Example:
    We have a 0-10V input module with a 0-6V sensor connected to it for pressure measurement.
    The sensors pressure range is -1,2 to 4,5 Bar.
    The Analog raw value is 0 to 16000.
    The settings should then be:
    "MinLimit_In" = 0
    "MaxLimit_In" = 9600 (60% of max input)
    "MinLimit_In" = -12 (Assuming we shall use Integer output and use one decimal)
    "MaxLimit_Out" = 45 (Assuming we .........).

    1463 downloads

    Submitted