GEN (FB)ΒΆ
FUNCTION_BLOCK GEN
Generates periodic functions of different, given types
The generation may be done relative to a specific time base or a given call-count base (BASE).
An example set of available types of periodic functions are shown in the following image.
- InOut:
Scope
Name
Type
Initial
Comment
Input
MODETypes available:
TRIANGLE: Triangular from -AMPLITUDEto +AMPLITUDETRIANGLE_POS: Triangular from 0 to +AMPLITUDESAWTOOTH_RISE: Sawtooth increasing from -AMPLITUDEto +AMPLITUDESAWTOOTH_FALL: Sawtooth decreasing from +AMPLITUDEto -AMPLITUDERECTANGLE: Rectangular switching from -AMPLITUDEto +AMPLITUDESINE: SineCOSINE: Cosine
BASEBOOLFALSE: Period referring to call (CYCLES)TRUE: Period referring to time (PERIOD)PERIODTIMETIME#1s0ms
Period time, only relevant if
BASE=TRUECYCLESINT1000
Number of calls per period, only relevant if
BASE=FALSEAMPLITUDEINTAmplitud of the function to be generated
RESETBOOLTRUE: SetsOUTto zeroOutput
OUTINTGenerated function value