EasyManuals Logo
Home>Allen-Bradley>Controller>Logix5000

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 #651 background imageLoading...
Page #651 background image
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 651
Common Attributes Appendix A
Because immediate values are always zero-filled, the conversion of a SINT or
INT value may produce unexpected results. In the following example, the
comparison is false because Source A, an INT, converts by sign-extension; while
Source B, an immediate value, is zero-filled.
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 are entering 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.
EXAMPLE
Mixing an INT tag with an immediate value
ATTENTION: Since remote_rack_1:I.Data[0] is an INT tag, the
value to check it against is also entered as an INT tag.
adder Logic Listing - Total number of rungs: 3
Equal
Source A remote_rack_1:I.Data[0]
2#1111_1111_1111_1111
Source B2#1111_1111_1111_1111
EQU
42093
Equal
Source Aremote_rack_1:I.Data[0]
2#1111_1111_1111_1111
Source B int_0
2#1111_1111_1111_1111
EQU
42093

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