14: P
ROGRAM
B
RANCHING
I
NSTRUCTIONS
14-6
FT1A S
MART
A
XIS
U
SER
’
S
M
ANUAL
FT9Y-B1382
Example: DJNZ and LABEL
The following example demonstrates a program to store consecutive values 1000 through 1049 to data registers D100 through
D149, respectively.
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.
IMOV moves D0 data 1049 to D1049 in the first cycle.
DEC decrements D0 data to 1048.
DJNZ jumps to label 255 until D1 value reduces to 0.
LABEL
255
M8120
END
M8120
REP
S1 –
D0
D1 –
D99
IMOV(W)
S2
D2
D1
REP
S1 –
1049
D1 –
D0
MOV(W)
REP
S1 –
50
D1 –
D1
MOV(W)
S/D
D0
DEC(W)
S2
255
S1
D1
DJNZ
1049
D0
Destination: D99 + 50 = D149
1049
D149
50
D1
1st cycle:
1048
D0
Destination: D99 + 49 = D148
1048
D148
49
D1
2nd cycle:
1047
D0
Destination: D99 + 48 = D147
1047
D147
48
D1
3rd cycle:
1046
D0
Destination: D99 + 47 = D146
1046
D146
47
D1
4th cycle:
1001
D0
Destination: D99 + 2 = D101
1001
D101
2
D1
49th cycle:
1000
D0
Destination: D99 + 1 = D100
1000
D100
1
D1
50th cycle:
Summary of Contents for microsmart pentra
Page 1: ...FT1A SERIES FC9Y B1382 Ladder Programming Manual ...
Page 6: ...Preface 5 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 104: ...7 DATA COMPARISON INSTRUCTIONS 7 10 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 122: ...8 BINARY ARITHMETIC INSTRUCTIONS 8 18 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 138: ...10 SHIFT ROTATE INSTRUCTIONS 10 12 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 162: ...11 DATA CONVERSION INSTRUCTIONS 11 24 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 188: ...12 CALENDAR COMPARISON INSTRUCTIONS 12 26 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 198: ...15 REFRESH INSTRUCTIONS 15 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 202: ...16 INTERRUPT CONTROL INSTRUCTIONS 16 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Page 266: ...20 DUAL TEACHING TIMER INSTRUCTIONS 20 4 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 318: ...25 USER COMMUNICATION INSTRUCTIONS 25 22 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...