Description
Original instructions
Function description
The function block FGEN represents a function generator. It generates a signal form at the Y output which is defined in the data structure Para_FGEN. The function block can be cascaded, i.e. if several of these EFBs are used, various signal forms can be created and laid over one another.
The following 8 different signal forms can be generated:
NOTE: This function block performs an internal initialization in the first program cycle after a warm start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In case of inkoving the function block in a later program cycle, the internal initialization will not be performed and the ouputs may deliver wrong values.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EN and ENO can be configured as additional parameters.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL FGEN_Instance (R:=ResetFlag, START:=StartFlag, 
    PARA:=Parameter, YOFF:=Output_Y_Offset, 
    Y=>FunctionGeneratorOutput, 
    ACTIVE=>FunctionGeneratorActiv, N=>NumberOfPeriods)
Representation in ST
Representation:
FGEN_Instance (R:=ResetFlag, START:=StartFlag, 
    PARA:=Parameter, YOFF:=Output_Y_Offset, 
    Y=>FunctionGeneratorOutput, 
    ACTIVE=>FunctionGeneratorActiv, N=>NumberOfPeriods) ;
FGEN parameter description
Description of input parameters:
Parameter
Data type
Description
R
1: Reset
START
BOOL
1: Start function generator
PARA
Parameter
YOFF
Offset for output Y
Description of output parameters:
Parameter
Data type
Description
Y
REAL
Function generator output
ACTIVE
BOOL
ACTIVE = 1: Function generator is active
N
Number of intervals since start
Parameter description Para_FGEN
Data structure description
Element
Data type
Description
func_no
Generator function choice (1-8)
amplitude
Function amplitude
halfperiod
Half cycle duration
t_off
TIME
Idle time constant
t_rise
TIME
Rise time constant
t_acc
TIME
Smoothing time
unipolar
"1 "= Signal unipolar
"0 "= Signal bipolar
Runtime error
For a list of all block error codes and values, see CLC_PRO.