EasyManuals Logo
Home>Allen-Bradley>Controller>micrologix 1500

Allen-Bradley micrologix 1500 Reference Manual

Allen-Bradley micrologix 1500
424 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 #152 background imageLoading...
Page #152 background image
Publication 1762-RM001C-EN-P
10-2 Math Instructions
Using the Math
Instructions
Most math instructions use three parameters, Source A, Source B, and
Destination (additional parameters are described where applicable, later
in this chapter). The mathematical operation is performed using both
Source values. The result is stored in the Destination.
When using math instructions, observe the following:
Source and Destination can be different data sizes. Sources are
evaluated at the highest precision (word or long word) of the
operands. Then the result is converted to the size of the destination. If
the signed value of the Source does not fit in the Destination, the
overflow shall be handled as follows:
If the Math Overflow Selection Bit is clear, a saturated result is
stored in the Destination. If the Source is positive, the Destination
is +32767 (word) or +2,147,483,647 (long word). If the result is
negative, the Destination is -32768 (word) or -2,147,483,648 (long
word).
If the Math Overflow Selection Bit is set, the unsigned truncated
value of the Source is stored in the Destination.
Sources can be constants or an address, but both sources cannot be
constants.
Valid constants are -32768 to 32767 (word) and -2,147,483,648 to
2,147,483,647 (long word).
Addressing Modes and File Types can be used as shown in the following
table:
Table 10.1 Math Instructions Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page4-2.
Parameter
Data Files
Function Files
(1)
(1) DAT files are valid for the MicroLogix 1500 only. PTO and PWM files are only recommended for use with MicroLogix
1200 and 1500 BXB units.
CS - Comms
IOS - I/O
DLS - Data Log
(2)
(2) The Data Log Status file can only be used by the MicroLogix 1500 1764-LRP Processor for the following math
instructions: ADD, SUB, MUL, DIV, NEG, and SCP.
Address
Mode
(3)
(3) See Important note about indirect addressing.
Address
Level
O
I
S
B
T, C, R
N
ST
L
MG, PD
RTC
HSC
PTO, PWM
STI
EII
BHI
MMI
DAT
TPI
Immediate
Direct
Indirect
Bit
Word
Long Word
Element
Source A •••••• ••••••••••••• ••
Source B ••••• ••••••••••••••
••
Destination •••• •••••••
••
IMPORTANT
You cannot use indirect addressing with: S, ST, MG, PD,
RTC, HSC, PTO, PWM, STI, EII, BHI, MMI, DAT, TPI, CS,
IOS, and DLS files.

Table of Contents

Other manuals for Allen-Bradley micrologix 1500

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley micrologix 1500 and is the answer not in the manual?

Allen-Bradley micrologix 1500 Specifications

General IconGeneral
BrandAllen-Bradley
Modelmicrologix 1500
CategoryController
LanguageEnglish

Related product manuals