Add (Addition); Sub (Subtraction); Mul (Multiplication); Div (Division) - IDEC MICROSmart FC6A Series Ladder Programming Manual

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

Advertisement

7: B
INARY
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)

ADD(*)
S1(R)
*****

SUB (Subtraction)

SUB(*)
S1(R)
*****

MUL (Multiplication)

MUL(*)
S1(R)
*****

DIV (Division)

DIV(*)
S1(R)
*****
A
RITHMETIC
S2(R)
D1(R)
REP
*****
*****
**
S2(R)
D1(R)
REP
*****
*****
**
S2(R)
D1(R)
REP
*****
*****
**
S2(R)
D1(R)
REP
*****
*****
**
FC6A S
MICROS
ERIES
MART
I
NSTRUCTIONS
Data type W or I:
Data type D, L, or F:
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).
Data type W or I:
Data type D, L, or F:
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).
Data type W or I:
Data type D, L, or F:
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.
Data type W or I:
Data type D or L:
Data type F:
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:
L
P
M
ADDER
ROGRAMMING
ANUAL
S1 + S2 → D1, CY
S1·S1+1 + S2·S2+1 → D1·D1+1, CY
S1 – S2 → D1, BW
S1·S1+1 – S2·S2+1 → D1·D1+1, BW
S1 × S2 → D1·D1+1
S1·S1+1 × S2·S2+1 → D1·D1+1
S1 ÷ S2 → D1 (quotient), D1+1 (remainder)
S1·S1+1 ÷ S2·S2+1 → D1·D1+1 (quotient),
D1+2·D1+3 (remainder)
S1·S1+1 ÷ S2·S2+1 →D1·D1+1 (quotient)
–32768 ÷ (–1)
–2147483648 ÷ (–1)
FC9Y-B1726
7-1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents