IDEC FC4A-C10R2 User Manual page 334

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

20: P
I
ULSE
NSTRUCTIONS
Sample Program: PULS1
This program demonstrates a user program of the PULS1 instruction to generate 1,000 pulses at a frequency of 3 kHz from
output Q0, followed by 3,000 pulses at a frequency of 5 kHz.
Operand Settings
Operand
S1+0
Operation mode
S1+1
Output pulse frequency
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)
M8120
MOV(W)
MOV(W)
MOV(W)
MOV(W)
MOV(W)
SOTU
M101
MOV(W)
MOV(W)
PULS
1
I0
M101
SOTU
M1
20-6
Function
Frequency range 100 to 10,000 Hz
10,000 Hz × 30% (50%) = 3,000 Hz (5,000 Hz)
Enable pulse counting
1,000 (3,000)
0 to 3,000
0: Pulse output OFF
1: Pulse output ON
0: Pulse output not complete
1: Pulse output complete
0: Overflow not occurred
1: Overflow occurred (PULS1 only)
S1 –
D1 –
REP
1
D0
S1 –
D1 –
REP
30
D1
S1 –
D1 –
REP
1
D2
S1 –
D1 –
REP
0
D3
S1 –
D1 –
REP
1000
D4
M101
S1 –
D1 –
REP
50
D1
S1 –
D1 –
REP
0
D3
S1 –
D1 –
REP
3000
D4
S1
D1
D0
M100
M101
« FC4A M
Description
M8120 is the initialize pulse special internal relay.
When the CPU starts, five MOV(W) instructions store first-stage
parameters to data registers D0 through D4.
D0 (operation mode): 1 (100 to 10,000 Hz)
D1 (output pulse frequency): 30 (10,000 Hz × 30% = 3,000 Hz)
D2 (pulse counting): 1 (enable pulse counting)
D3 (preset value high word): 0
D4 (preset value low word): 1,000
Pulse data update flag M1 is reset (pulse data not updated).
R
M1
Pulse output complete flag M101 is turned off.
R
When M101 is turned on, three MOV (W) instructions store sec-
ond-stage parameters to data registers D1, D3, and D4.
D1 (output pulse frequency): 50 (10,000 Hz × 50% = 5,000 Hz)
D3 (preset value high word): 0
D4 (preset value low word): 3,000
S
Pulse data update flag M1 is set (pulse data updated).
M1
When start input I0 is turned on, PULS1 starts to generate
3,000Hz output pulses in the first stage.
Pulse output complete M101 is turned off.
R
S
U
'
M
ICRO
MART
SER
S
ANUAL
Allocation No. (Value)
D1 (30) → (50)
D4 (1000) → (3000)
»
D0 (1)
D2 (1)
D3 (0)
D5
D6
D7
M100
M101
M102

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents