20: P
ULSE
I
NSTRUCTIONS
20-12
« FC4A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
»
Sample Program: PWM1
This program demonstrates a user program of the PWM1 instruction to generate pulses from output Q0, with an ON/OFF
ratio of 30% while input I0 is off or 60% when input I0 is on.
Operand Settings
Operand
Function
Description
Allocation No. (Value)
S1+0
Output pulse frequency
217.86 Hz
D0 (2)
S1+1
Pulse width ratio
30% or 60%
D1 (30 or 60)
S1+2
Pulse counting
Disable pulse counting
D2 (0)
S1+3
Preset value (high word)
Not used
D3
S1+4
Preset value (low word)
D4
S1+5
Current value (high word)
Not used
D5
S1+6
Current value (low word)
D6
S1+7
Error status
D7
D1+0
Pulse output ON
0: Pulse output OFF
1: Pulse output ON
M100
D1+1
Pulse output complete
0: Pulse output not complete
1: Pulse output complete
M101
D1+2
Pulse output over flow
0: Over flow not occurred
1: Over flow occurred (PWM1 only)
M102
M8120
I0
M8120 is the initialize pulse special internal relay.
When the CPU star ts, MOV(W) instructions store parameters to data regis-
ters D0 and D2.
D0 (output pulse frequency): 2 (217.86 Hz)
D2 (pulse counting): 0 (disable pulse counting)
When input I0 is off, D1 (pulse width ratio) stores 30 (30%).
When input I0 is on, D1 (pulse width ratio) stores 60 (60%).
When input I1 is on, PWM1 generates output pulses of a 30% or 60%
pulse width ratio from output Q0 depending whether input I0 is off or on,
respectively.
REP
S1 –
2
MOV(W)
D1 –
D0
REP
S1 –
0
MOV(W)
D1 –
D2
REP
S1 –
30
MOV(W)
D1 –
D1
REP
S1 –
60
MOV(W)
D1 –
D1
I0
D1
M100
PWM
1
S1
D0
I1
Содержание FC4A-C10R2
Страница 1: ...FC4A SERIES Micro Programmable Logic Controller User s Manual FC9Y B812 ...
Страница 6: ...PREFACE 4 FC4A MICROSMART USER S MANUAL ...
Страница 94: ...2 MODULE SPECIFICATIONS 2 74 FC4A MICROSMART USER S MANUAL ...
Страница 184: ...6 ALLOCATION NUMBERS 6 20 FC4A MICROSMART USER S MANUAL ...
Страница 218: ...8 ADVANCED INSTRUCTIONS 8 8 FC4A MICROSMART USER S MANUAL ...
Страница 240: ...11 BINARY ARITHMETIC INSTRUCTIONS 11 8 FC4A MICROSMART USER S MANUAL ...
Страница 244: ...12 BOOLEAN COMPUTATION INSTRUCTIONS 12 4 FC4A MICROSMART USER S MANUAL ...
Страница 252: ...13 SHIFT ROTATE INSTRUCTIONS 13 8 FC4A MICROSMART USER S MANUAL ...
Страница 274: ...15 WEEK PROGRAMMER INSTRUCTIONS 15 8 FC4A MICROSMART USER S MANUAL ...
Страница 378: ...22 DUAL TEACHING TIMER INSTRUCTIONS 22 4 FC4A MICROSMART USER S MANUAL ...
Страница 386: ...23 INTELLIGENT MODULE ACCESS INSTRUCTIONS 23 8 FC4A MICROSMART USER S MANUAL ...
Страница 408: ...24 ANALOG I O CONTROL 24 22 FC4A MICROSMART USER S MANUAL ...
Страница 426: ...26 COMPUTER LINK COMMUNICATION 26 6 FC4A MICROSMART USER S MANUAL ...