EasyManuals Logo

Allen-Bradley Studio 5000 Logix Emulate User Manual

Allen-Bradley Studio 5000 Logix Emulate
676 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 #670 background imageLoading...
Page #670 background image
Chapter 12
670 Rockwell Automation Publication MOTION-RM002H-EN-P-February 2018
Convert SINT or INT to DINT
A SINT or INT input source tag gets promoted to a DINT value by a
sign-extension for Source Tag. Instructions that convert SINT or INT values to
DINT values use one of the following conversion methods.
This conversion method Converts data by placing
Sign-extension The value of the leftmost bit (the sign of the value) into each bit position to
the left of the existing bits until there are 32 bits.
Zero-fill Zeroes to the left of the existing bits until there are 32 bits.
Logical instructions (AND, OR, XOR, NOT, BTD, FRD, MVM, MEQ, SQI,
and SQO) use zero fill. All other instructions use sign-extension
The following example shows the results of converting a value using sign-
extension and zero-fill.
This value 2#1111_1111_1111_1111 (-1)
Converts to this value by
sign-extension
2#1111_1111_1111_1111_1111_1111_1111_1111 (-1)
Converts to this value by
zero-fill
2#0000_0000_0000_0000_1111_1111_1111_1111 (65535)
If you use a SINT or INT tag and an immediate value in an instruction that
converts data by sign-extension, use one of these methods to handle immediate
values.
Specify any immediate value in the decimal radix.
If you enter the value in a radix other than decimal, specify all 32 bits of the
immediate value. To do so, enter the value of the leftmost bit into each bit
position to its left until there are 32 bits.
Create a tag for each operand and use the same data type throughout the
instruction. To assign a constant value, either:
Enter it into one of the tags.
Add a MOV instruction that moves the value into one of the tags.
Use a MEQ instruction to check only the required bits.
The following examples show two ways to mix an immediate value with an INT
tag. Both examples check the bits of a 1771 I/O module to determine if all the bits
are on. Since the input data word of a 1771 I/O module is an INT tag, it is easiest
to use a 16-bit constant value.

Table of Contents

Other manuals for Allen-Bradley Studio 5000 Logix Emulate

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley Studio 5000 Logix Emulate and is the answer not in the manual?

Allen-Bradley Studio 5000 Logix Emulate Specifications

General IconGeneral
BrandAllen-Bradley
ModelStudio 5000 Logix Emulate
CategoryController
LanguageEnglish

Related product manuals