RS Logix 5000 INT to two SINT?

BudW

Member
Join Date
Sep 2005
Location
Detroit, MI
Posts
107
In RS Logix 5000, If I have a INT word (16#1234) how do I look at just the upper 8 bits (16#12) or just the lower 8 bits (16#34)?

Thank you
 
Needed to do a more in depth search.

COP INT SINT 2 - Copies both bytes from INT to SINT[0] and SINT[1]

Thank you rdrast
 
Last edited:
The COP will work only if the data is in the Hex format not just displayed in Hex. You might need to use the FRD to convert to Hex/BCD if it is not.

If you want 1234 (just an example I am sure) to be stored as 12 and 34 then look at the BTD instruction. If you want them stored as 1200 and 34 then maybe take a look at the MVM.

OG
 
To clarify.....

Data in RSLogix5000 SINTs, INTs, and DINTs is always stored as pure signed-binary, regardless of which "Style" is chosen for the tags.

These "Style" selections only affect how RSLogix5000 displays the numbers, and has no effect on what bit patterns are stored in the tag database.

The instructions used on the data do not "interrogate" the Style, they merely manipulate the data in the assumption that the programmer is using the appropriate instructions for the data that is stored.

In the tag-database, there are two views, Monitor and Edit. The Style selection in the Edit view is the default style that RSLogix always reverts to when the database is opened. The Style selection in the Monitor view is just a temporary style that is applied until the database is closed and re-opened.

Changing either of these Style selections does not change the data that is stored in the tag in any way.

Now back to BudW's problem.

It all depends on what data is stored, not how it is displayed.

If the data has come from a BCD source, then his 16#1234 will be stored as....

0001_0010_0011_0100

...which is 4660 in decimal.

If you COP this into two SINTs, you will get

0001_0010 in the first, and 0011_0100 in the second.

0001_0010 is 20 decimal, or 12 Hex, and
0011_0100 is 52 decimal, or 34 Hex.

The fact that BudW showed his numbers with 16# prefix infers only that his INT location contains a bit pattern that is a representation of a Hex number, and the use of COP is appropriate in this case.
 

Similar Topics

I am working on a project with a Controllogix 5582 processor using v32 firmware where I will be communicating with a Genset using Modbus TCP. It...
Replies
14
Views
928
Hello i have been trying to figure out a good way to take hex and convert it to an array of SINT[]. Here is what my failed attempt looks like.
Replies
5
Views
1,267
Hi! I had a little problem yesterday regarding how to link two DINTs together, but after some time thinking, I feel my question is actually, “How...
Replies
29
Views
7,153
Hey All, I'm currently building a control system for a large building in a industrial setting. Doing lighting, vent, roof control, door access...
Replies
12
Views
3,494
Hello, I'm using Compact Logix L33 in RSLogix 5000. I'm trying to message over modbus register that is 16bit UINT. In Rslogix 5000 do I message...
Replies
3
Views
1,498
Back
Top Bottom