LGF_RectangleCI (FB / V3.0.1)


Author: Siemens Industry Support

Short description

This function generates a rectangular signal profile. For this it uses the time interval of the calling Cyclic Interrupt OB.

Block Interface

LGF_RectangleCI (FB)
Real  amplitude value  Real
    
Real  offset error  Bool
    
UDInt  periode status  Word
    
Real  phaseShift subFunctionStatus  Word
    
OB_CYCLIC  callOB   
    
Bool  reset   
    
   

Input parameter

IdentifierData typeDefault valueDescription
amplitudeReal1.0Amplitude of the signal profile.
offsetReal0.0Offset of the signal profile in the Y-direction.
periodeUDInt1000Period duration of the signal profile in [ms]
phaseShiftReal0.0Phase offset in [ms]
callOBOB_CYCLIC---Calling cyclic interrupt OB
resetBoolFALSEReset of the signal profile.

Output parameter

IdentifierData typeDescription
valueRealCurrent value of the rectangular signal.
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

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_FINISHED_NO_ERROR
Status: Execution finished without errors
16#8600ERR_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#8601ERR_QRY_CINT
Error in `QRY_CINT` command - check `subFunctionStatus` code

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.

The block calculates the values for a rectangular signal profile, which is output to the output parameter value.

The amplitude, the offset in the Y-direction, the period, and the phase shift can be set at the input parameters.

The input parameter reset resets the signal profile. At the value output parameter, the value 0 is output as long as reset is set to TRUE.

The block must be called in a cyclic interrupt OB. The time interval of the calling cyclic interrupt OB is determined in the FB with the command QRY_CINT. For this, the constant name of the calling cyclic interrupt OB must be interconnected at the input parameter callOB.

Interconnecting the cyclic interrupt OB

The number of calculated values of the signal profile per period duration is calculated as follows:

Quantity Values = \frac{Period duration}{Time intervak Cyclic interrupt OB}
Note
To obtain a continuous signal profile of the curve, the time interval of the cyclic interrupt OB should not be selected too large depending on the period duration.


The Figure below shows the signal profile of the calculated values.

LGF_RectangleCI

Change log

Version & DateChange description
01.00.00Siemens Industry Online Support
03.07.2018First released version
01.00.01Siemens Industry Online Support
17.08.2018Upgrade: TIA V15 Update 2
01.00.02Siemens Industry Online Support
23.11.2018Upgrade: TIA V15.1
01.00.03Simatic Systems Support
26.09.2019Code refactoring, regions and more comments added
phase shift availability 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
15.02.2021Insert documentation