3. Call the SFB 49:
n SW_EN = FALSE
n JOB_VAL = Enter a value for the on-delay here
n JOB_ID = 02h: Write on-delay for PWM output.
n JOB_REQ = TRUE (edge 0-1)
ð
n From JOB_VAL the on-delay is transmitted to the PWM output.
n JOB_DONE is FALSE during the SFB run.
n On error JOB_ERR = TRUE and the cause of the error is returned in
JOB_STAT
4. To reset JOB_REQ, call SFB 49 again with the same parameters and JOB_REQ =
FALSE.
5. Call the SFB 49:
n SW_EN = FALSE
n JOB_VAL = Enter a value for the minimum pulse duration here
n JOB_ID = 04h: Write minimum pulse duration for PWM output.
n JOB_REQ = TRUE (edge 0-1)
ð
n From JOB_VAL the minimum pulse duration is transmitted to the PWM
output.
n JOB_DONE is FALSE during the SFB run.
n On error JOB_ERR = TRUE and the cause of the error is returned in
JOB_STAT
6. To reset JOB_REQ, call SFB 49 again with the same parameters and JOB_REQ =
FALSE.
7. Call the SFB 49:
n SW_EN = TRUE (edge 0-1)
n JOB_REQ = TRUE (edge 0-1)
n OUTP_VAL: Specify a duty factor.
ð
n The PWM output is started
n STS_EN goes to TRUE and remains in this state until SFB 49 is called with
SW_EN = FALSE.
n On error JOB_ERR = TRUE and the cause of the error is returned in
JOB_STAT
8. Call the SFB 49 cyclically:
n SW_EN = FALSE
n Via STS_EN you get the current status of the PWM output. With OUTP_VAL
you can always change the duty factor.
9. As soon as JOB_DONE returns TRUE, you can change the PWM parameters by
repeating the steps 1 to 5.
If values are changed during PWM output, the new values are only
output with the beginning of a new period. A started period is
always finished!
10. By resetting of SW_EN (SW_EN = FALSE) the output is immediately stopped.
11. With reading jobs, you can find the values to be read in the parameter JOB_OVAL
in the instance DB at address 20.
VIPA SPEED7
Integrated Standard
System Function Blocks > SFB 49 - PULSE - Pulse width modulation
HB00 | OPL_SP7 | Operation list | en | 18-30 771