18: P
ULSE
O
UTPUT
I
NSTRUCTIONS
18-14 FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
Sample program
This section describes an example program that outputs a pulse with the pulse width ratio of 30% when I0 is off, and a pulse with
the pulse width ratio of 60% when I0 is on.
Settings
Function Device address Setting value Details
Output pulse frequency D0000 50 50 Hz
Pulse width ratio D0001 300 30%
Pulse counting — Disable pulse counting —
Preset value D0002, D0003 — —
M0000
M8120
I0000
I0001
REPD1 -
D0001
MOV(W) S1 -
300
REPD1 -
D0001
MOV(W) S1 -
600
D1
M0100
S2
M0000
PWM
1
S1
D0001
I0000
Turn on initialization input (M0000)
Set pulse width ratio (D0001) to 60 (60% ON)
When PWM1 instruction input (I0001) turns on, start output
of a pulse with the pulse width ratio of 30% or 60%
Set pulse width ratio (D0001) to 30 (30% ON)