PLCopen Motion Control The function block calculates the signals of a function generator. VAR_OUTPUT Sinus: LREAL; Cosinus: LREAL; Rectangle: LREAL; SawTooth: LREAL; END_VAR VAR_INOUT stTimeBase: ST_FunctionGeneratorTB_BkPlcMc; stFunctionDef: ST_FunctionGeneratorFD_BkPlcMc; END_VAR Sinus, Cosinus, Rectangle , SawTooth : The output signals of the function generator. stTimeBase : A structure with the parameters of the time base of this function generator. stFunctionDef : A structure with the definitions of the output signals of a function generator. Behaviour of the function block The output signals are determined from stTime base.CurrentRatio and the parameters in stFunctionDef [ } 92] .
The time base in stTimeBase should be updated with an MC_FunctionGeneratorTB_BkPlcMc [ } 161] () function block. To change the operating frequency, an MC_FunctionGeneratorSetFrq_BkPlcMc [ } 160] () function block should be used. 4.4.4.2 MC_FunctionGeneratorSetFrq_BkPlcMc (from V3.0.31) The function block updates the operating frequency of a time base for one or several function generators [ } 159] . VAR_INPUT Frequency: LREAL; CycleTime: LREAL; END_VAR VAR_INOUT stTimeBase: ST_FunctionGeneratorTB_BkPlcMc; END_VAR Frequency: The operating frequency to be used. CycleTime: The cycle time of the calling task. stTimeBase :
A structure with the parameters of the time base of one or several function generators [ } 92] . Behaviour of the function block The function block sets stTimeBase.Frequency to the transferred value. stTimeBase.CurrentTime is adjusted, if required. The function block uses stTimeBase.Freeze to prevent a collision with MC_FunctionGeneratorTB_BkPlcMc [ } 161] () function blocks. Thus, it can also be called from another task. PLC Library Hydraulics 160 Version: 1.4