IDEC MICROSmart FC6A Series Ladder Programming Manual page 278

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

13: P
B
ROGRAM
RANCHING
Example: DJNZ and LABEL
The following example demonstrates a program to store consecutive values 1,000 through 1,049 to data registers D100 through
D149, respectively.
MOV(W)
1049
M8120
MOV(W)
LABEL
255
IMOV(W)
M8120
DEC(W)
S/D
D0
DJNZ
1st cycle:
D1
2nd cycle:
D1
3rd cycle:
D1
4th cycle:
D1
49th cycle:
D1
50th cycle:
D1
13-6
I
NSTRUCTIONS
S1 –
D1 –
REP
D0
S1 –
D1 –
REP
50
D1
S1 –
S2
D1 –
D0
D99
S1
S2
D1
255
50
Destination: D99 + 50 = D149
49
Destination: D99 + 49 = D148
48
Destination: D99 + 48 = D147
47
Destination: D99 + 47 = D146
2
Destination: D99 + 2 = D101
1
Destination: D99 + 1 = D100
FC6A S
MICROS
ERIES
M8120 is the initialize pulse special internal relay.
At start-up, MOV instructions store initial data.
1049 → D0 to store the value for the first cycle.
50 → D1 to determine the jump cycles.
D2
REP
IMOV moves D0 data 1049 to D1049 in the first cycle.
D1
DEC decrements D0 data to 1048.
DJNZ jumps to label 255 until D1 value reduces to 0.
END
L
P
MART
ADDER
ROGRAMMING
1049
D0
D0
1048
D0
1047
1046
D0
1001
D0
1000
D0
M
FC9Y-B1726
ANUAL
1049
D149
D148
1048
D147
1047
1046
D146
1001
D101
1000
D100

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents