Table of Contents

Saw signal generator

Block name

B4_SAW_GENERATOR

ST call

PROGRAM B4_TEST
VAR 
    O1,O2: REAL;
    FB: LIB.CORE.V1_1.B4_SAW_GENERATOR:= (MINIMUM:= 0, MAXIMUM:= 10);
END_VAR
 
    FB(OUT => O1, TRES => O2);
END_PROGRAM

Library

LIB\CORE

Version

V1.1

Description

The block is a saw signal generator with minimum and maximum value setting, minimum and maximum value time duration setting, and ramp time setting. Another output provides remaining time until the end of the period.

Version V1.1

Correction of a combination of short cycles and long periods (eg cycle 1 ms and period 60 s). The generator did not hold time base and generated incorrect timing.

Inputs

Input TypeDescription Default value
ENABLE BOOLEnable of functionality of the block True
TMIN TIMETime interval for OUT=MINIMUM. 0s
TRAMP TIMETime interval for the OUT to rise from MINIMUM to MAXIMUM.1s
TMAX TIMETime interval for OUT=MAXIMUM. 0s
MINIMUMREALMinimum value of the output signal. 0
MAXIMUMREALMaximum value of the output signal. 1
PAUSINGBOOLBehaviour when paused True

Outputs

OutputTypeDescription
OUT REALOutput saw signal.
TRES TIMERemaining time until the end of the period.

Function

The output signal OUT provides a saw signal with intervals Tmin, Tramp, and Tmax and limit values of MINIMUM and MAXIMUM. The block contains another output signal, Tres, which is remaining time until the end of the current period T, see image below. The block also contains a boolean input ENABLE which switches the generator off (when ENABLE: = false). The block behaviour after switching off depends on the PAUSING parameter (see image below):

Application example

Function B4 generates a saw signal on the O1 output, with period of 1 second, minimum value of 0, and maximum value of 1.