12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

638 Common AttributesIf you use a SINT or INT tag and an immediate value in an instructionthat converts data by sign-extension, use one of these methods tohandle 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 thevalue of the left-most bit into each bit position to its left untilthere are 32 bits.• Create a tag for each operand and use the same data typethroughout 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 thetags.• Use a MEQ instruction to check only the required bitsThe following examples show two ways to mix an immediate valuewith an INT tag. Both examples check the bits of a 1771 I/O moduleto determine if all the bits are on. Since the input data word of a 1771I/O module is an INT tag, it is easiest to use a 16-bit constant value.EXAMPLEMixing an INT tag with an immediate valueSince remote_rack_1:I.Data[0] is an INT tag, the value to checkit against is also entered as an INT tag.EQUEqualSource A remote_rack_1:I.Data[0]2#1111_1111_1111_1111Source Bint_02#1111_1111_1111_111142093EXAMPLEMixing an INT tag with an immediate valueSince remote_rack_1:I.Data[0] is an INT tag, thevalue to check it against first moves into int_0, alsoan INT tag. The EQU instruction then compares bothtags.2#1111_1111_1111_1111MOVMoveSource 2#1111_1111_1111_1111Destint_02#1111_1111_1111_1111EQUEqualSource A remote_rack_1:I.Data[0]2#1111_1111_1111_1111Source Bint_02#1111_1111_1111_111142093Publication 1756-RM003I-EN-P - January 2007

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!