IDEC FC4A-C10R2 User Manual page 350

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

20: P
I
ULSE
NSTRUCTIONS
Sample Program: RAMP — Reversible Control with Single Pulse Output
This program demonstrates a user program of the RAMP instruction to generate 30,000 pulses from output Q0. Control
direction output Q1 turns off or on while input I1 is off or on to indicate the forward or reverse direction, respectively.
Steady pulse frequency:
Initial pulse frequency:
Frequency change rate:
Reversible control enable:
Preset value:
Operand Settings
Operand
S1+0
Operation mode
S1+1
Steady pulse frequency
S1+2
Initial pulse frequency
S1+3
Frequency change rate
S1+4
Reversible control enable
S1+5
Control direction
S1+6
Preset value (high word)
S1+7
Preset value (low word)
S1+8
Current value (high word)
S1+9
Current value (low word)
S1+10
Error status
D1+0
Pulse output ON
D1+1
Pulse output complete
D1+2
Pulse output status
D1+3
Pulse output overflow
MOV(W)
S1 –
M8120
MOV(W)
S1 –
MOV(W)
S1 –
MOV(W)
S1 –
MOV(W)
S1 –
MOV(W)
S1 –
MOV(W)
S1 –
30000
MOV(W)
S1 –
I1
MOV(W)
S1 –
I1
RAMP
I0
20-22
5,000 Hz
2,000 Hz
100 Hz / 10 ms
Reversible control with single pulse output
30,000 pulses total
Function
D1 –
REP
1
D0
D1 –
REP
50
D1
D1 –
REP
20
D2
D1 –
REP
1
D3
D1 –
REP
1
D4
D1 –
REP
0
D6
D1 –
REP
D7
D1 –
REP
0
D5
D1 –
REP
1
D5
S1
D1
D0
M100
« FC4A M
Description
Frequency range 100 to 10,000 Hz
10,000 Hz × 50% = 5,000 Hz
10,000 Hz × 20% = 2,000 Hz
10,000 Hz × 1% = 100 Hz
Reversible control with single output
0 (forward) or 1 (reverse)
30,000
0 to 30,000
0: Pulse output OFF
1: Pulse output ON
0: Pulse output not complete
1: Pulse output complete
0: Steady pulse output
1: Changing output pulse frequency
0: Overflow not occurred
1: Overflow occurred
M8120 is the initialize pulse special internal relay.
When the CPU starts, seven MOV(W) instructions store parameters to
data registers D0 through D7.
D0 (operation mode): 1 (100 to 10,000 Hz)
D1 (steady pulse frequency): 50 (10,000 Hz × 50% = 5,000 Hz)
D2 (initial pulse frequency): 20 (10,000 Hz × 20% = 2,000 Hz)
D3 (frequency change rate): 1 (10,000 Hz × 1% = 100 Hz)
D4 (reversible control enable): 1 (reversible control with single output)
D6 (preset value high word): 0
D7 (preset value low word): 30,000
When input I1 is off, D5 (control direction) stores 0 (forward).
When input I1 is on, D5 (control direction) stores 1 (reverse).
When start input I0 is turned on, RAMP starts to generate 30,000 output
pulses.
S
U
'
M
ICRO
MART
SER
S
ANUAL
Allocation No. (Value)
»
D0 (1)
D1 (50)
D2 (20)
D3 (1)
D4 (1)
D5 (0 or 1)
D6 (0)
D7 (30000)
D8
D9
D10
M100
M101
M102
M103

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents