EasyManuals Logo

IDEC OpenNet series User Manual

IDEC OpenNet series
427 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #166 background image
OPENNET CONTROLLER USERS MANUAL 11-1
11: BINARY ARITHMETIC INSTRUCTIONS
Introduction
The binary arithmetic instructions make it possible for the user to program computations using addition, subtraction, mul-
tiplication, and division. For addition and subtraction operands, internal relay M8003 is used to carry or to borrow.
ADD (Addition)
SUB (Subtraction)
MUL (Multiplication)
DIV (Division)
Data type W or I: S1 + S2 D1, CY
Data type D or L: S1·S1+1 + S2·S2+1 D1·D1+1, CY
When input is on, 16- or 32-bit data designated by source oper-
ands S1 and S2 are added. The result is set to destination oper-
and D1 and carry (M8003).
REP
**
S1(R)
*****
D1(R)
*****
ADD(*) S2(R)
*****
Data type W or I: S1 – S2 D1, BW
Data type D or L: S1·S1+1 – S2·S2+1 D1·D1+1, BW
When input is on, 16- or 32-bit data designated by source oper-
and S2 is subtracted from 16- or 32-bit data designated by
source operand S1. The result is set to destination operand D1
and borrow (M8003).
REP
**
S1(R)
*****
D1(R)
*****
SUB(*) S2(R)
*****
Data type W or I: S1 × S2 D1·D1+1
Data type D or L: S1·S1+1 × S2·S2+1 D1·D1+1
When input is on, 16- or 32-bit data designated by source oper-
and S1 is multiplied by 16- or 32-bit data designated by source
operand S2. The result is set to 32-bit data designated by desti-
nation operand D1.
When the result exceeds the valid range for data types D or L,
the ERROR LED and special internal relay M8004 (user pro-
gram 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)
When input is on, 16- or 32-bit data designated by source oper-
and S1 is divided by 16- or 32-bit data designated by source
operand S2. The quotient is set to 16- or 32-bit destination oper-
and D1, and the remainder is set to the next 16- or 32-bit data.
When S2 is 0 (dividing by 0), the ERROR 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: –32768 ÷ (–1)
Data type L: –2147483648 ÷ (–1)
REP
**
S1(R)
*****
D1(R)
*****
DIV(*) S2(R)
*****
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: info@clrwtr.com

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IDEC OpenNet series and is the answer not in the manual?

IDEC OpenNet series Specifications

General IconGeneral
BrandIDEC
ModelOpenNet series
CategoryController
LanguageEnglish

Related product manuals