IDEC FC4A-C10R2 User Manual page 235

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

Example: SUB
• Data Type: Word
The following example demonstrates the use of special internal relay M8003 to process a borrow.
SOTU
I0
M8003
Examples: MUL
• Data Type: Word
MUL(W)
S1 –
D10
I1
When input I1 is on, data of D10 is multiplied by data of D20, and the result is set to
D30 and D31.
• Data Type: Integer
MUL(I)
S1 –
D10
I1
Note: Since the destination uses two word operands in the multiplication operation, data register D399 (10-I/O type CPU
module) or D1299 (other CPU modules) cannot be used as destination operand D1. When using a bit operand such as inter-
nal relay for destination, 32 internal relays are required; so internal relay M281 (10-I/O type CPU module) or M1241 (other
CPU modules) or a larger number cannot be used as destination operand D1.
Examples: DIV
• Data Type: Word
DIV(W)
S1 –
D10
I2
• Data Type: Integer
DIV(I)
S1 –
D10
I2
Note: Since the destination uses two word operands in the division operation, data register D399 (10-I/O type CPU module)
or D1299 (other CPU modules) cannot be used as destination operand D1. When using a bit operand such as internal relay
for destination, 32 internal relays are required; so M281 (10-I/O type CPU module) or M1241 (other CPU modules) or a
larger number cannot be used as destination operand D1.
SUB(W)
S1 –
S2 –
D12
7000
SUB(W)
S1 –
S2 –
D13
1
S2 –
D1 –
REP
D20
D30
S2 –
D1 –
REP
D20
D30
S2 –
D1 –
REP
D20
D30
S2 –
D1 –
REP
D20
D30
« FC4A M
ICRO
11: B
D12 – 7000 → D12
D1 –
REP
To process borrowing so that the number of times
D12
a borrow occurs is subtracted from D13.
D1 –
REP
When a borrow occurs, D13 is decremented by
D13
one.
500
×
D10
D20
(01F4h)
–500
×
D10
D20
(FE0Ch)
D10
50
÷
D20
When input I2 is on, data of D10 is divided by data of D20. The quo-
tient is set to D30, and the remainder is set to D31.
50
D10
÷
D20
S
U
'
M
»
MART
SER
S
ANUAL
A
INARY
RITHMETIC
600
D30·D31
(0258h)
D30
(0004h)
37856
D31
(93E0h)
600
D30·D31
(0258h)
65531
D30
(FFFBh)
27680
D31
(6C20h)
7
D30
7
Quotient
–7
–7
D30
Quotient
I
NSTRUCTIONS
300000
(000493E0h)
4
–300000
(FFFB6C20h)
D31
1
Remainder
1
D31
Remainder
11-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents