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.
The request interface is used according to the following sequence:
1.
Call the SFB 49:
n
SW_EN
= FALSE
n
JOB_VAL
= Enter a value for the
number of pulses
here.
n
JOB_ID
= 08h: Write
number of pulses
for the 1. pulse train job.
n
JOB_REQ
= TRUE (edge 0-1)
ð
n
From
JOB_VAL
the
number of pulses
for the 1. pulse train job is trans-
mitted.
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
2.
To reset JOB_REQ, call SFB 49 again with the same parameters and JOB_REQ =
FALSE.
Controlling the pulse train
output
VIPA System 300S
+
Deployment I/O periphery
Pulse width modulation - PWM > SFB 49 - PULSE - Pulse width modulation
HB140 | CPU-SC | 313-5BF23 | en | 19-01
142