PWM_Creator_FixedCycle (FB)¶
FUNCTION_BLOCK FINAL PWM_Creator_FixedCycle EXTENDS PWM_CreatorBase
Represents a two point controller with pulse width modulation using a fixed cycle width.
Note
If the cycle time given by udiWidthCycleTime can not be divided without remainder by the
cycle time of the task calling this FB, the number of ON-cycles is calculated as
defined by eRoundingStrategy
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xEnableBOOLTRUE: Activates the defined operationFALSE: Aborts/resets the defined operationLConC
Output
xBusyBOOLTRUE: Operation is runningLConC
xErrorBOOLTRUE: Error condition reachedLConC
Input
lrProportionValueLREALRepresents the demanded proportional value for the pwm controller between 0 and 1If this value is out of range an error is produced.PWM_CreatorBase
Output
xOutputBOOLRepresents the boolean output value
PWM_CreatorBase
eErrorIDERROR.NO_ERROR
The current error.Only valid ifxErrorisTRUE.PWM_CreatorBase
Input
udiPWMCycleTimeUDINTThe cycle time in µs
Input Const
eRoundingStrategyRoundingStrategy.round
The strategy being used to deal with the remainder of the PWM-CycleTime divided by the task cycle time calling this FB
Methods:
Structure: