Справочник Пользователя для Mitsubishi Electronics FX

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-62
5.6.9
PWM (FNC 58)
Operation:
A continuous pulse train is output through device D
when this instruction is driven. The characteristics
of the pulse are defined as:
T h e  di s ta n c e ,  in  ti m e   ( m s e c ),   b e tw e e n   t w o
identical parts of consecutive pulses (S
2
).
And how long, also in time (msec), a single pulse
will be active for (S
1
).
Points to note:
a) Because this is a 16 bit instruction, the available time ranges for S
and S
are 1 to 32,767.
b) A calculation of the duty cycle is easily made by dividing S
by S
2
. Hence S
cannot have a
value greater than S
as this would mean the pulse is on for longer than the distance
between two pulses, i.e. a second pulse would start before the first had finished. If this is
programmed an error will occur. 
This instruction is used where the length of the pulse is the primary concern.
c) The PWM instruction may only be used once in a users program.
d) Because of the nature of the high speed output, transistor output units should be used with
this instruction. Relay outputs will suffer from a greatly reduced life and will cause false
outputs to occur due to the mechanical ‘bounce’ of the contacts. To ensure a ‘clean’ output
signal when using transistor units, the load current should be 200mA or higher. It may 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 only 
.
FX users: any Y
PPP
.
FX
2N(C) 
users: Y000 or 
Y001 only 
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
is set to D8132. Please see page 5-59 for more details.
h) FX units with CPU version 3.07 or greater and FX
2C 
units can monitor the number of pulses
which have been output as a double word using devices D8136 and D8137. 
FX
2N(C) 
units can also monitor the number of pulses output to Y0 using devices D8140 and
D8141 and the number of output pulses output to Y1 using devices D8142 and D8143. The
total number of pulses output can be monitored using D8136 and D8137.
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
X10
K50
D10
Y 0
PWM
[ S1 ] [ S2 ] [ D ]
D
S1
S2