LGF_LimRateOfChangeAdvancedCI (FB / V3.0.1)

Overview

Author: Siemens Digital Industries

Short description

The function LGF_LimRateOfChangeAdvanced limits the rate of change of an input variable. Jump functions become ramp functions. In addition, the block has various operating modes.

Block Interface

LGF_LimRateOfChangeAdvancedCI (FB)
LReal  autoValue outputValue  LReal
    
LReal  manualValue posUpRateLim  Bool
    
LReal  setPosUpRateLim posDownRateLim  Bool
    
LReal  setPosDownRateLim negUpRateLim  Bool
    
LReal  setNegUpRateLim negDownRateLim  Bool
    
LReal  setNegDownRateLim highLim  Bool
    
LReal  setHighLim lowLim  Bool
    
LReal  setLowLim error  Bool
    
LReal  defaultOutValue status  Word
    
Bool  enDefaultOutValue subfunctionStatus  Word
    
Bool  track   
    
Bool  manOp   
    
Bool  reset   
    
OB_CYCLIC  callOB   
    
   

Input parameter

IdentifierData type Default value Description
autoValueLReal 0.0 Signal to be processed and limited in its rate of change
manualValueLReal 0.0 Manually controlled output value
(`outputValue` = `manualValue`)
setPosUpRateLimLReal 0.0 Rate of change per second for the rising ramp in the positive value range (1/second)
setPosDownRateLimLReal 0.0 Rate of change per second for the falling ramp in the positive value range (1/second)
setNegUpRateLimLReal 0.0 Rate of change per second for the rising ramp in the negative value range (1/second)
setNegDownRateLimLReal 0.0 Rate of change per second for the falling ramp in the negative value range (1/second)
setHighLimLReal 0.0 High limit value
setLowLimLReal 0.0 Low limit value
defaultOutValueLReal 0.0 Value for pre-assignment of the output variable
(`outputValue` = `defaultOutValue`)
enDefaultOutValueBool FALSE Assign default output value
(`outputValue` = `defaultOutValue`)
trackBool FALSE Follow / tracking of Input variable
(`outputValue` = `autoValue`)
manOpBool FALSE Manual mode on
(`outputValue` = `manualValue`)
resetBool FALSE Complete restart of function
callOBOB_CYCLIC --- Calling wake-alarm interrupt OB (cyclic interrupt OB)

Output parameter

IdentifierData type Description
outputValueLReal Output variable
posUpRateLimBool Rise limitation in positive range tripped
posDownRateLimBool Down rate limit in positive range reached
negUpRateLimBool Up rate limit in negative range reached
negDownRateLimBool Down rate limit in negative range reached
highLimBool High limit reached
lowLimBool Low limit reached
errorBool FALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord 16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)
subfunctionStatusWord Status or return value of called FB's, FC's and system blocks

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_FINISHED_NO_ERROR
Status: Execution finished without errors
16#8200ERR_NEG_RATE_LIM
Error: High limit lower than low limit. The high limit `setHighLim` must be greater than the low limit `setLowLim`.
16#8202ERR_NEG_RATE_OF_CHANGE
Error: Negative rate of change. The parameter for the change rate must not be negative.
16#8600ERR_QRY_CINT
Error in `QRY_CINT` command - check `subFunctionStatus` code
16#8601ERR_OB_UNAVAILABLE
Error: OB on input `callOB` is not configured / present. Interconnect the constant name of a configured cyclic interrupt OB at the input `callOB`.

Functional description

NOTE
The status of called commands is output in subFunctionStatus. In this case, the output value in status indicates which command caused the error. In this case, refer to the TIA Portal Online Help section for information on the respective commands.

For the positive/negative value range, two rates of change in each case for the ramp (rising and falling values) can be parameterized. The following operating modes can be selected via control inputs:

The output variable can be limited through two parametrize able limits. An active limitation of the rate of change of a ramp, as well as an active limitation of the output variable are reported via outputs.

The time interval of the calling cyclic interrupt OB is determined by interconnecting the calling cyclic interrupt OB at the input parameter callOB.

Interconnecting the cyclic interrupt OB

Restart

At restart reset = TRUE, the output outputValue is reset to 0.0.
If enDefaultOutValue = TRUE is set, defaultOutValue is output. All signal outputs are set to FALSE.

Pre-assigning an output

If enDefaultOutValue = TRUE is set, the value at defaultOutValue is output. When changing from TRUE to FALSE, outputValue is ramped from defaultOutValue to autoValue. When changing from FALSE to TRUE, the output outputValue immediately jumps to defaultOutValue.

Normal operation

The ramps are straight lines of limitation and are based on a rate of change per second; if, for example, the parameter setPosUpRateLim = 10.0 is assigned, then at a sampling time of 1s/100ms/10ms, 10.0/1.0/0.1 will be added to outputValue at each block call, if autoValue > outputValue, until autoValue is reached.

The limitation of the rate of change can be parameterized in both positive and negative ranges for the increase and decrease.


Table: Marking of the ramps

Parameters Ramp
setPosUpRateLim outputValue > 0.0 and |outputValue| rising
setPosDownRateLim outputValue > 0.0 and |outputValue| falling
setNegUpRateLim outputValue < 0.0 and |outputValue| rising
setNegDownRateLim outputValue < 0.0 and |outputValue| falling

If the ramps are not parameterized (setPosUpRateLim, setPosDownRateLim, setNegUpRateLim, and setNegDownRateLim equal 0.0), the output remains at 0.0 and normal operation is disabled.

Tracking

If the input track = TRUE is set, the input variable autoValue is interconnected directly to the output variable outputValue. Thus, jumps of the input variable will also be output.

Switch through controlled variable

If manOp = TRUE is set, the controlled variable manualValue is interconnected directly to the output variable outputValue.

In this operating mode, the parameterization of the ramps or the high/low limitation of the output variable, and the pre-assignment of the output, are ineffective.

When changing from TRUE to FALSE, the output outputValue is ramped again after autoValue.

As soon as the value range between the low and high limits is reached, the high and low limits are reactivated.

Figure: Ramp function sequence, operating modes

LGF_LimRateOfChangeAdvancedCI

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
21.06.2016First released version
01.00.01Siemens Industry Online Support
02.01.2017Upgrade: TIA Portal V14 Update 1
01.00.02Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.00.03Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.07Simatic Systems Support
15.11.2019Regions, comments and constants are added
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
22.03.2021Insert documentation