EasyManuals Logo

Allen-Bradley Logix5000 Reference Manual

Allen-Bradley Logix5000
708 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 #278 background imageLoading...
Page #278 background image
278 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 6 Compute/Math Instructions (CPT, ADD, SUB, MUL, DIV, MOD, SQR, SQRT, NEG, ABS)
Structured Text
divide_result := float_value_1 / float_value_2;
Function Block
Example 2: The DIV and MOV instructions work together to divide two integers, round the
result, and place the result in an integer tag:
• The DIV instruction divides dint_a by dint_b.
• To round the result, the Destination is a REAL tag. (If the destination was
an integer tag (SINT, INT, or DINT), the instruction would truncate the
result.)
• The MOV instruction moves the rounded result (real_temp) from the
DIV to divide_result_rounded.
• Since divide_result_rounded is a DINT tag the value from real_temp is
rounded and placed in the DINT destination.
Relay Ladder
43009

Table of Contents

Other manuals for Allen-Bradley Logix5000

Questions and Answers:

Question and Answer IconNeed help?

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

Allen-Bradley Logix5000 Specifications

General IconGeneral
BrandAllen-Bradley
ModelLogix5000
CategoryController
LanguageEnglish

Related product manuals