Fbd_Math Structure - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Chapter 6
Compute/Math Instructions (CPT, ADD, SUB, MUL, DIV, MOD, SQR, SQRT, NEG, ABS)
Input Parameter
Data Type
EnableIn
BOOL
Source A
REAL
Source B
REAL
Output Parameter
Data Type
EnableOut
BOOL
Dest
REAL
Description:
If source B is zero and
All operands are integers (SINT, INT, or
DINT)
At least one operand is a REAL
276

FBD_MATH Structure

Description
Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
Value of the dividend.
Valid = any float
Value of the divisor.
Valid = any float
Description
The instruction produced a valid result.
Result of the math instruction. Arithmetic status flags are set for this output.
If the Destination is not a REAL, the instruction handles the fractional portion
of the result as follows:
If source A
And Source B are not
REALs
Or Source B is a REAL
The destination is set as follows.
If Source B (the divisor) is zero:
• A minor fault occurs:
– Type 4: program fault
– Code 4: arithmetic overflow
• The destination is set as follows:
And the destination is a
SINT, INT, or DINT
REAL
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Then the fractional
Example
portion of the result
Truncates
Source A
Source B
Destination
Rounds
Source A
Source B
Destination
And the result is
Then the destination is set to
Source A
Positive
-1
Negative
0
Positive
1.$ (positive infinity)
Negative
-1.$ (negative infinity)
DINT
5
DINT
3
DINT
1
REAL
5.0
DINT
3
DINT
2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents