LGF_RampCI (FB / V3.0.1)


Author: Siemens Digital Industries

Short description

The function generates a speed curve based on an interpolation point table. Linear interpolation occurs between the points within the prescribed time.

Block Interface

LGF_RampCI (FB)
LReal  defaultOutValue outputValue  LReal
    
Int  contStepNbr actTimeTable  Bool
    
Time  contStepTime stepNumber  Int
    
Bool  enDefaulftOutValue remainTime  Time
    
Bool  start totalTime  Time
    
Bool  hold remainTotalTime  Time
    
Bool  continue error  Bool
    
Bool  cyclicOP status  Word
    
Bool  updateTime subfunctionStatus  Word
    
Bool  reset   
    
OB_CYCLIC  callOB   
    
Array[*] of LGF_typeRampTimeTable  setpoints  Array[*] of LGF_typeRampTimeTable
       
   

Input parameter

IdentifierData typeDefault valueDescription
defaultOutValueLReal0.0Value for pre-assignment of the output variable
(`outputValue` = `defaultOutValue`)
contStepNbrInt0Number of the next interpolation point for continuing
contStepTimeTimeT#0MSRemaining time to continue to the interpolation point `contStepNbr`
enDefaulftOutValueBoolFALSEAssign default output value
(`outputValue` = `defaultOutValue`)
startBoolFALSERun down the interpolation point table
holdBoolFALSEFreeze/ hold output at actual value
continueBoolFALSEContinuing
cyclicOPBoolFALSERepeat interpolation point table cyclically
updateTimeBoolFALSEUpdate time values
resetBoolFALSEComplete reset of function
callOBOB_CYCLIC---Calling wake-alarm interrupt OB (cyclic interrupt OB)

Output parameter

IdentifierData typeDescription
outputValueLRealOutput value
actTimeTableBoolThe interpolation point table will be edited.
stepNumberIntcurrent interpolation point number
(interpolation point that is approached)
remainTimeTimeRemaining time until reaching the next interpolation point
totalTimeTimeTotal time for setpoint table
remainTotalTimeTimeTotal remaining time
errorBoolFALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)
subfunctionStatusWordStatus or return value of called FB's, FC's and system blocks

In/Out parameter

IdentifierData typeDescription
setpointsArray[*] of LGF_typeRampTimeTableInterpolation point table.
You can find information on the data type `LGF_typeRampTimeTable` under the item “Global data” .

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_FINISHED_NO_ERROR
Status: Execution finished without errors
16#7000STATUS_NO_CALL
Status: Block is not being processed
16#7001STATUS_FIRST_CALL
Status: First call, Rising edge `start`.
16#7002STATUS_FURTHER_CALLS
Status: Further calls, cyclic operation, Input `cyclicOP` set.
16#8200ERR_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`.
16#8201ERR_ARRAY_LOWER_BOUND
Error: Array does not start with 0 / Low array limit <> 0. The array with the interpolation points must start with the index 0.
16#8400ERR_QRY_CINT
Error in `QRY_CINT` command - check `subFunctionStatus` code

User defined datatype(s)

LGF_typeRampTimeTable (UDT)

Data type to setup a speed curve based on a setpoint table for the function LGF_RampCI

IdentifierData typeDefault valueDescription
outputValueLReal0.0Setpoint Value to reach by the interpolation curve
timeTimeT#0sTime until the interpolation point is reached

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.

Global data

Together with the block, you automatically receive the PLC data type LGF_typeRampTimeTable, which is composed of the parameters outVal for the value of a base point and time for the time, until the next base point is reached. The declaration takes place in a one-dimensional array of the data type LGF_typeRampTimeTable beginning with the index 0. The array is created in a global data block and then passed to the module LGF_RampCI.

Figure: Example of the declaration of the interpolation points

LGF_RampCI Setpoint table

The parameter time of the last interpolation point must be parameterized with 0s, since there is no longer any successor interpolation point.

Principle of operation

With this block, speed curves can be executed based on parameterized interpolation points; in each call cycle values are output according to a schedule, and interpolation takes place between the interpolation points.

In each cycle the currently approached interpolation point number stepNumber, the actual remaining time remainTime until reaching the interpolation point, the total time totalTime, and the total remaining time until reaching the end of the speed curve remainTotalTime, are output. In addition, the output actTimeTable is set if the projected speed curve is currently being output.

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

Figure: Interconnecting the cyclic interrupt OB

Interconnecting the cyclic interrupt OB

The following operating modes can be selected via control inputs:

Overview of the operating modes

Table: Overview of the operating modes

LGF_RampCI Table: Overview of the operating modes


Restart

The output outValue is reset to 0.0 with a rising edge at the input reset. With enDefaultOutValue = TRUE, defaultOutValue is output at outputValue. The total time and total remaining time are updated and output.

Pre-assigning an output

If the speed curve should begin with a certain output value, then enDefaultOutValue must be TRUE. In this case the value defaultOutValue is present on the output of the timer. The internal processing of the speed curve continues during this time. If enDefaultOutValue changes to FALSE again, interpolation is performed to the currently active calibration point.

Output a speed curve

With a rising edge at the input start, the speed curve is output - as long as start is TRUE or until the speed curve is terminated by reaching the last interpolation point. Through a subsequent rising edge, the speed curve is output again. In addition, the total time is updated at each switch-on.

Switch-on cyclic operation

If, in addition to the input start, the input cyclicOP is also set to TRUE, the speed curve automatically returns to the start point after outputting the last interpolation point value and starts a new cycle.

There is no interpolation between the last interpolation point value and the starting point. The following must apply for a smooth transition: last interpolation point value = start point.

Stop speed curve

With hold = TRUE the value of the output variable (including time processing) is frozen. When resetting hold = FALSE, the program continues at the point of interruption or at a parameterized point (see "Defining the processing step and processing time"). The processing time of the speed curve is extended by the holding time T1*. (see Figure below).

Specify processing step and processing time

If the input parameter continue is set to TRUE for continuation while the speed curve is stopped (hold = TRUE), then after the input hold has been reset the interpolation point number contStepNbr (target interpolation point) will be approached within the time contStepTime (interpolation). The total remaining time will be recalculated.

Updating total time and total remaining time

If values of the interpolation points are changed, the total time and the total remaining time of the speed curve can change. Since calculation of totalTime and remainTotalTime can significantly increase the processing time of the function block at many interpolation points, the calculation is only executed once with a rising edge on the updateTime input.


Functional processes

Figure: Functional processes

LGF_RampCI Functional processes

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
03.02.2017First released version
01.00.01Siemens Industry Online Support
16.05.2017Comment correction (REGION)
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.06Siemens Industry Presales Support
15.11.2019Code optimization, Regions, 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
Change UDT member name from `outValue` to `outputValue`