FX Series Programmable Controlers Applied Instructions 5
5-62
5.6.9 PWM (FNC 58)
Operation:
A continuous pulse train is output throu
h device D
when this instruction is driven. The characteristics
of the pulse are defined as:
The distance, in time (msec), between two
identical parts of consecutive pulses (S
2
).
And how lon
, also in time (msec), a sin
le pulse
will be active for (S
1
).
Points to note:
a) Because this is a 16 bit instruction, the available time ran
es for S
1
and S
2
are 1 to 32,767.
b) A calculation of the dut
c
cle is easil
made b
dividin
S
1
b
S
2
. Hence S
1
cannot have a
value
reater than S
2
as this would mean the pulse is on for lon
er than the distance
between two pulses, i.e. a second pulse would start before the first had finished. If this is
pro
rammed an error will occur.
This instruction is used where the len
th of the pulse is the primar
concern.
c) The PWM instruction ma
onl
be used once in a users pro
ram.
d) Because of the nature of the hi
h speed output, transistor output units should be used with
this instruction. Rela
outputs will suffer from a
reatl
reduced life and will cause false
outputs to occur due to the mechanical ‘bounce’ of the contacts. To ensure a ‘clean’ output
si
nal when usin
transistor units, the load current should be 200mA or hi
her. It ma
be
found that ‘pull up’ resistors will be required.
Mnemonic Function
Operands
Program steps
S
1
S
2
D
PWM
FNC 58
(
Pulse
width
modulation)
Generates a
pulse train with
defined pulse
characteristics
K, H,
KnX, KnY, KnM,
KnS,
T, C, D, V, Z
Note:
S1
S2
Y
Note:
FX
0(S)
/FX
0N
users:
Y001 onl
.
FX users: an
Y
PPP
.
FX
2N(C)
users: Y000 or
Y001 onl
PWM:
7 steps
)FX
(2C)
and FX
2N(C)
units can use the HSZ (FNC 55) instruction with the PLSY instruction
when source device S
1
is set to D8132. Please see pa
e 5-59 for more details.
h) FX units with CPU version 3.07 or
reater and FX
2C
units can monitor the number of pulses
which have been output as a double word usin
devices D8136 and D8137.
FX
2N(C)
units can also monitor the number of pulses output to Y0 usin
devices D8140 and
D8141 and the number of output pulses output to Y1 usin
devices D8142 and D8143. The
total number of pulses output can be monitored usin
D8136 and D8137.
X10
K50D10 Y 0PWM
[ S1 ]
[ S2 ] [ D ]
D
S1
S2