PLC-API bSync : A rising edge at this input will set the mark-to-space ratio of the internal PWM block to the value fManSyncValue. eMode : Input that specifies the block's operating mode [ } 16] . VAR_OUTPUT VAR_OUTPUT bOut : BOOL; fPWMDutyCycle : FLOAT; (* debug only *) eState : E_CTRL_STATE; eErrorId : E_CTRL_ERRORCODES; bError : BOOL; END_VAR bOut : Output of the controller. fPWMDutyCycle : Current mark-to-space ratio of the internal PWM block. eState : State of the function block. eErrorId : Supplies the error number [ } 16] when the bError output is set. bError : Becomes TRUE, as soon as an error occurs. VAR_IN_OUT VAR_IN_OUT stParams :
ST_CTRL_2POINT_PWM_ADAPTIVE_PARAMS; END_VAR stParams : Parameter structure of the 2-point element. This consists of the following elements: TYPE ST_CTRL_2POINT_PWM_ADAPTIVE_PARAMS: STRUCT tCtrlCycleTime : TIME := T#0ms; (* controller cycle [TIME] *) tTaskCycleTime : TIME := T#0ms; (* task cycle time [TIME] *) tPWMPeriod : TIME fOkRange : FLOAT fForceRange : FLOAT fStepSize : FLOAT fMinLimit : FLOAT (* [0% ... 100%] *) fMaxLimit : FLOAT (* [0% ... 100%] *) tWaitTime : TIME END_STRUCT END_TYPE tCtrlCycleTime : 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 : 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. tPMWPeriod : Period of the PWM signal. fOkRange : The range of fE over which the mark-to-space ratio will not be modified. fForceRange : If fE exceeds this range, the output is permanently set to TRUE. fStepSize : Value by which the mark-to-space ratio is varied each time it is adapted. [0% ... 100%] fMaxLimit : Maximum mark-to-space ratio in percent [0% ... 100%].
fMinLimit : Minimum mark-to-space ratio in percent [0% ... 100%]. tWaiTimet : Waiting time between individual modifications of the mark-to-space ratio. TS4100 42 Version: 1.1