FB_CTRL_PWM_OUT_EXT
This function block creates a PWM modulated signal on the basis of the input signal. Both the minimum switch-on time and the minimum switch-off time can be parameterized, in addition to the mark-to-space ratio, in this extended function block.
Description of the output behavior 1
Description of the output behavior 2
Inputs
VAR_INPUT
fPwmInput : FLOAT;
eMode : E_CTRL_MODE;
END_VAR
Name | Type | Description |
---|---|---|
fPwmInput | FLOAT | Input value for the function block |
eMode | E_CTRL_MODE | Input that specifies the operation mode of the function block. |
Outputs
VAR_OUTPUT
bPwmOutBitPos : BOOL;
bPwmOutBitNeg : BOOL;
eState : E_CTRL_STATE;
bError : BOOL;
eErrorId : E_CTRL_ERRORCODES;
END_VAR
Name | Type | Description |
---|---|---|
bPwmOutBitPos | BOOL | PWM signal, when fPwmInput > 0.0 |
bPwmOutBitNeg | BOOL | PWM signal, when fPwmInput < 0.0 |
eState | E_CTRL_STATE | State of the function block |
bError | BOOL | Supplies the error number when the output |
eErrorId | E_CTRL_ERRORCODES | Becomes TRUE, as soon as an error occurs. |
Inputs/ outputs
VAR_IN_OUT
stParams : ST_CTRL_PWM_OUT_EXT_PARAMS;
END_VAR
Name | Type | Description |
---|---|---|
stParams | ST_CTRL_PWM_OUT_EXT_ | Parameter structure of the PWM element |
stParams
consists of the following elements:
TYPE ST_CTRL_PWM_OUT_EXT_PARAMS :
STRUCT
tTaskCycleTime : TIME;
tPWMPeriod : TIME;
tMinOnTime : TIME;
tMinOffTime : TIME;
tMinWaitTime : TIME;
END_STRUCT
END_TYPE
Name | Type | Description |
---|---|---|
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. |
tPWMPeriod | TIME | Period of the PWM signal |
tMinOnTime | TIME | Minimum switch-on time |
tMinOffTime | TIME | Minimum switch-off time |
tMinWaitTime | TIME | Waiting time between the switching actions between a positive and negative output signal |