IDEC FC4A-C10R2 User Manual page 340

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

20: P
I
ULSE
NSTRUCTIONS
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
S1+0
Output pulse frequency
S1+1
Pulse width ratio
S1+2
Pulse counting
S1+3
Preset value (high word)
S1+4
Preset value (low word)
S1+5
Current value (high word)
S1+6
Current value (low word)
S1+7
Error status
D1+0
Pulse output ON
D1+1
Pulse output complete
D1+2
Pulse output overflow
MOV(W)
S1 –
M8120
MOV(W)
S1 –
MOV(W)
S1 –
I0
MOV(W)
S1 –
I0
PWM
1
I1
20-12
Function
D1 –
REP
2
D0
D1 –
REP
0
D2
D1 –
REP
30
D1
D1 –
REP
60
D1
S1
D1
D0
M100
« FC4A M
Description
217.86 Hz
30% or 60%
Disable pulse counting
Not used
Not used
0: Pulse output OFF
1: Pulse output ON
0: Pulse output not complete
1: Pulse output complete
0: Overflow not occurred
1: Overflow occurred (PWM1 only)
M8120 is the initialize pulse special internal relay.
When the CPU starts, 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.
S
U
'
M
ICRO
MART
SER
S
ANUAL
Allocation No. (Value)
»
D0 (2)
D1 (30 or 60)
D2 (0)
D3
D4
D5
D6
D7
M100
M101
M102

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents