IDEC FC4A-C10R2 User Manual page 236

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

11: B
A
INARY
RITHMETIC
Repeat Operation in the ADD and SUB Instructions
Source operands S1 and S2 and destination operand D1 can be designated to repeat individually or in combination. When
destination operand D1 is not designated to repeat, the final result is set to destination operand D1. When repeat is desig-
nated, consecutive operands as many as the repeat cycles starting with the designated operand are used.
Since the repeat operation works similarly on the ADD (addition) and SUB (subtraction) instructions of the word and inte-
ger data types, the following examples are described using the ADD instruction of the word data type.
Repeat One Source Operand
When only S1 (source) is designated to repeat, the final result is set to destination operand D1.
ADD(W)
SOTU
I1
Repeat Destination Operand Only
When only D1 (destination) is designated to repeat, the same result is set to 3 operands starting with D1.
ADD(W)
SOTU
I1
Repeat Two Source Operands
When S1 and S2 (source) are designated to repeat, the final result is set to destination operand D1.
ADD(W)
SOTU
I1
Repeat Source and Destination Operands
When S1 (source) and D1 (destination) are designated to repeat, different results are set to 3 operands starting with D1.
ADD(W)
SOTU
I1
Repeat All Source and Destination Operands
When all operands are designated to repeat, different results are set to 3 operands starting with D1.
ADD(W)
SOTU
I1
Note: Special internal relay M8003 (carry/borrow) is turned on when a carry or borrow occurs in the last repeat operation.
When a user program execution error occurs in any repeat operation, special internal relay M8004 (user program execution
error) and the ERR LED are turned on and maintained while operation for other instructions is continued.
11-4
I
NSTRUCTIONS
S1 R
S2 –
D1 –
D10
D20
D30
S1 –
S2 –
D1 R
D10
D20
D30
S1 R
S2 R
D1 –
D10
D20
D30
S1 R
S2 –
D1 R
D10
D20
D30
S1 R
S2 R
D1 R
D10
D20
D30
« FC4A M
ICRO
S1 (Repeat = 3)
REP
D10
10
3
D11
15
D12
20
S1 (Repeat = 0)
REP
D10
10
3
D10
10
D10
10
S1 (Repeat = 3)
REP
10
D10
3
15
D11
20
D12
S1 (Repeat = 3)
REP
D10
10
3
D11
15
D12
20
S1 (Repeat = 3)
REP
10
D10
3
15
D11
20
D12
S
U
'
M
»
MART
SER
S
ANUAL
S2 (Repeat = 0)
+
D20
25
+
D20
25
+
D20
25
S2 (Repeat = 0)
+
D20
25
+
D20
25
+
D20
25
S2 (Repeat = 3)
25
+
D20
35
+
D21
45
+
D22
S2 (Repeat = 0)
+
D20
25
+
D20
25
+
D20
25
S2 (Repeat = 3)
25
+
D20
35
+
D21
45
+
D22
D1 (Repeat = 0)
D30
(35)
D30
(40)
D30
45
D1 (Repeat = 3)
D30
35
D31
35
D32
35
D1 (Repeat = 0)
(35)
D30
(50)
D30
65
D30
D1 (Repeat = 3)
D30
35
D31
40
D32
45
D1 (Repeat = 3)
35
D30
50
D31
65
D32

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents