FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
7-1
7: B
INARY
A
RITHMETIC
I
NSTRUCTIONS
Introduction
This chapter describes the arithmetic operation instructions that perform arithmetic based on specified data and store those results
in devices. For addition and subtraction devices, internal relay M8003 is used to carry or to borrow.
The ROOT instruction can be used to calculate the square root of the value stored in one or two data registers.
ADD (Addition)
SUB (Subtraction)
MUL (Multiplication)
DIV (Division)
Data type W or I:
S1 + S2
→
D1, CY
Data type D, L, or F:
S1·S1+1 + S2·S2+1
→
D1·D1+1, CY
When input is on, 16- or 32-bit data assigned by source devices S1 and S2 are
added together. The result is set to destination device D1 and internal relay
M8003 (carry or borrow).
REP
**
S1(R)
*****
D1(R)
*****
ADD(*)
S2(R)
*****
Data type W or I:
S1 – S2
→
D1, BW
Data type D, L, or F:
S1·S1+1 – S2·S2+1
→
D1·D1+1, BW
When input is on, 16- or 32-bit data assigned by source device S2 is
subtracted from 16- or 32-bit data assigned by source device S1. The result is
set to destination device D1 and internal relay M8003 (carry or borrow).
REP
**
S1(R)
*****
D1(R)
*****
SUB(*)
S2(R)
*****
Data type W or I:
S1
×
S2
→
D1·D1+1
Data type D, L, or F:
S1·S1+1
×
S2·S2+1
→
D1·D1+1
When input is on, 16- or 32-bit data assigned by source device S1 is multiplied
by 16- or 32-bit data assigned by source device S2. The result is set to
destination device D1.
When the result exceeds the valid range for data types D or L, the ERR LED
and special internal relay M8004 (user program execution error) are turned on.
REP
**
S1(R)
*****
D1(R)
*****
MUL(*)
S2(R)
*****
Data type W or I:
S1 ÷ S2
→
D1 (quotient), D1+1 (remainder)
Data type D or L:
S1·S1+1 ÷ S2·S2+1
→
D1·D1+1 (quotient),
D1+2·D1+3 (remainder)
Data type F:
S1·S1+1 ÷ S2·S2+1
→
D1·D1+1 (quotient)
When input is on, 16- or 32-bit data assigned by source device S1 is divided
by 16- or 32-bit data assigned by source device S2. The quotient is set to 16-
or 32-bit destination device D1, and the remainder is set to the next 16- or 32-
bit data. Data type F does not generate a remainder.
When S2 is 0 (dividing by 0), the ERR LED and special internal relay M8004
(user program execution error) are turned on.
A user program execution error also occurs in the following division
operations.
Data type I:
Data type L:
–32768 ÷ (–1)
–2147483648 ÷ (–1)
REP
**
S1(R)
*****
D1(R)
*****
DIV(*)
S2(R)
*****
Summary of Contents for MICROSmart FC6A Series
Page 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Page 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...