Easy RSLogix 5k question

mmain1

Member
Join Date
Aug 2008
Location
Tulsa, OK
Posts
7
I am brand new to Allen Bradley programming, my background is with GE Fanuc.

Basically what I am trying to accomplish is to OR a BYTE.

I have a 16pt discrete input card. The first 8 inputs and the last 8 inputs are identical. The difference is they are created from different power sources is the reason for duplicating the inputs.

So logically what I want to do is OR those 8 bits together such that if either input is high, the result will be high.

I could do this with parallel contacts and a coil, but that would be a very time consuming and error-prone solution given the number of inputs on this system.

My best attempt was to copy 8 bools to two SINT registers and OR the SINT registers, but copy doesn't like the mismatched type when I try something like ENGINE:2.I.Data.8 to grab the last byte.
 
I would create an intermediate INT tag, then perform a Swap Bytes command to copy the Engine:2:I.Data tag to that intermediate tag in Low/High byte order.

You might need a Masked Move in there, too, if you want to treat the result as an 8-bit only data value.
 
Take a look at the Boolean Exclusive Or(BXOR) and Bitwise Exclusive Or(XOR) instructions; one of them might just be what you need.
 
I'm not 100% on what you are trying to do but I would look in the Move\Logical tab in the ladder editor. There are few functions in there that help with BIT operations in BTYES.
 
I would create an intermediate INT tag, then perform a Swap Bytes command to copy the Engine:2:I.Data tag to that intermediate tag in Low/High byte order.

You might need a Masked Move in there, too, if you want to treat the result as an 8-bit only data value.

This looks like exactly what I want. Thanks!
 

Similar Topics

I'm creating a new thread for this because I can't seem to find the relevant info in my documentation. I remember how to run online edits for...
Replies
8
Views
6,201
Working on a project right now where I'm adding some rungs to an existing program. I'm using tags because the I/O is all over the place, but...
Replies
3
Views
4,339
See picture. I want to add a rung (magenta) into the existing code. Can't figure out how to do this. I select a -||- , right? When I drag/drop...
Replies
21
Views
1,786
Hi All, On my site, the standard template for storing recipes in the PLC is to create a tag called PartRecipe which is an 2D array - for example...
Replies
4
Views
1,468
I would like to do change a kinetix drive, so i believe i just have to put the IP address in the new kinetix and just connect right? Do I need to...
Replies
1
Views
1,196
Back
Top Bottom