PLC API stParams consists of the following elements: TYPE ST_CTRL_SIGNAL_GENERATOR_PARAMS: STRUCT tCtrlCycleTime : TIME := T#0ms; tTaskCycleTime : TIME := T#0ms; eSignalType : E_CTRL_SIGNAL_TYPE; tCylceDuration : TIME; fAmplitude : FLOAT; fOffset : FLOAT := 0.0; tStart : TIME := T#0s; END_STRUCT END_TYPE 4.2.2 Global Constants 4.2.2.1 Library version All libraries have a specific version. This version is shown in the PLC library repository too. A global constant contains the library version information: Global_Version VAR_GLOBAL CONSTANT stLibVersion_Tc2_ControllerToolbox :
ST_LibVersion; END_VAR ST_LibVersion To compare the existing version to a required version the function F_CmpLibVersion (defined in Tc2_System library) is offered. Obsolete Functions All other possibilities known from TwinCAT2 libraries to query a library version are obsolete! 4.2.3 Data Structures 4.2.3.1 Definition of the structures and enums This appendix describes all the structures and enums used in the TwinCAT controller toolbox. TF4100 173 Version: 2.2.4 Name Type Description tCtrlCycleTime TIME Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime.
The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle. tTaskCycleTime TIME Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task. eSignalType E CTRL _ _ SIGNAL TYPE _ Selection of the type of signal. TYPE E CTRL SIGNAL TYPE :
_ _ _ ( eCTRL TRIANGLE := 0, _ eCTRL SINUS := 1, _ eCTRL SAWTOOTH := 2 ); _ END TYPE _ tCylceDuration TIME Period of the generated signal curve fAmplitude FLOAT Amplitude of the generated signal curve fOffset FLOAT Offset to be added to the signal curve tStart TIME The moment of time within a period at which following the signal curve will begin when switching into eCTRL MODE ACTIVE occurs. _ _