Indirect Addressing Emerson PAC Machine Edition

James42005

Member
Join Date
Dec 2018
Location
Waterloo, IA
Posts
35
Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think?

What I need to do is search an array of bools for any non-zero value. I don't really care which element it is, only if any are = 1.

So, in AB land I would probably use indirect addressing to index through the array to find any bool = 1.

Im struggling to find an option for how to do this in my new life as a GE/Emerson guy.

Thanks
 
Check out the SEARCH_GT instruction, using a target of zero. It will check over a range of variables and return a boolean true if it finds a match. It will also return the location of the first nonzero variable in the range, all within a single scan. If you're using addressed variables, be aware that you can assign the same address to a BOOL array and a WORD array. So if you have a BOOL array of 128 elements that starts at %M00001, you can also define a WORD array of 8 elements starting at %M00001.
The Rx3i also supports indirect addressing, so the techniques you've learned in Rockwell land may also work.
 
Thanks Steve,

I looked into the search instructions... it doesn't appear they are available with bool data type arrays.

Byte, dint, sword, int, unit, and word
 
I looked into the search instructions... it doesn't appear they are available with bool data type arrays.
Here's how I would approach it.
If your BOOL array doesn't already have an address assigned, give it one. Let's say its 256 elements in the array and you assign it to the address %M00097. Now you can define a WORD array of 16 elements, assign it the same starting address of %M00097 and use that array as your search range. The only thing to watch out for is that the starting address you assign to your BOOL array must lie on a byte boundary. That means when you divide the address by 8, there must be a remainder of 1. Examples are %M00001, %M00009, %M00017, etc. When you assign a memory type that is inherently BOOL like %M to a WORD data type, the software will automatically assign it to a byte boundary. When you try to assign %M00005 to a WORD variable, the software will change it to %M00001.
 

Similar Topics

Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
669
Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,381
Hi All, which the best way to do the indirect addressing in an optimize DB? Ccurrently this is my partial code inside an FB...
Replies
7
Views
2,276
Hey everyone, Just used the PLC5/Logix migration utility to convert a program, and while addressing the PCEs, I noticed a lot of errors for "XIC...
Replies
12
Views
1,985
Hi there I'm currently converting an RSLogix500 program that I wrote 20 years ago into RSLogix5000 for an SLC to CompactLogix upgrade. The...
Replies
3
Views
2,210
Back
Top Bottom