Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controlers Applied Instructions 5
5-62
5.6.9 PWM (FNC 58)
Operation:
A continuous pulse train is output throu
g
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
g
, also in time (msec), a sin
g
le pulse
will be active for (S
1
).
Points to note:
a) Because this is a 16 bit instruction, the available time ran
g
es for S
1
and S
2
are 1 to 32,767.
b) A calculation of the dut
y
c
y
cle is easil
y
made b
y
dividin
g
S
1
b
y
S
2
. Hence S
1
cannot have a
value
g
reater than S
2
as this would mean the pulse is on for lon
g
er than the distance
between two pulses, i.e. a second pulse would start before the first had finished. If this is
pro
g
rammed an error will occur.
This instruction is used where the len
g
th of the pulse is the primar
y
concern.
c) The PWM instruction ma
y
onl
y
be used once in a users pro
g
ram.
d) Because of the nature of the hi
g
h speed output, transistor output units should be used with
this instruction. Rela
y
outputs will suffer from a
g
reatl
y
reduced life and will cause false
outputs to occur due to the mechanical ‘bounce’ of the contacts. To ensure a ‘clean’ output
si
g
nal when usin
g
transistor units, the load current should be 200mA or hi
g
her. It ma
y
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
y
.
FX users: an
y
Y
PPP
.
FX
2N(C)
users: Y000 or
Y001 onl
y
PWM:
7 steps
g
)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
g
e 5-59 for more details.
h) FX units with CPU version 3.07 or
g
reater and FX
2C
units can monitor the number of pulses
which have been output as a double word usin
g
devices D8136 and D8137.
FX
2N(C)
units can also monitor the number of pulses output to Y0 usin
g
devices D8140 and
D8141 and the number of output pulses output to Y1 usin
g
devices D8142 and D8143. The
total number of pulses output can be monitored usin
g
D8136 and D8137.
X10
K50D10 Y 0PWM
[ S1 ]
[ S2 ] [ D ]
D
S1
S2