GE 90-70, 'any bit set' function

jdbrandt

Lifetime Supporting Member
Join Date
Oct 2002
Location
Pennsylvania
Posts
1,203
Does anyone know how to generate a 'some bit is set' function or
logic, without using a 255 contact series rung with n.c. contacts?

I need a rung/instruction that answers the following question:

Are any of the bits between %M001 and %M255 set?

This is a piece of cake in AB (one of the few things), since you
can address a 'group of 16 bits' as a word. And, if I could, say,
move %M001 thru %M016 into %R001, etc, then, this would be a
good thing, and I could continue in my AB ways.

I'm sure there's an easier way to do this, but I can't for the
life of me see it in the book.
 
Use the 'Bit Position' function (BIT_POS_WORD) from the 'Bit Operation' function group. The length parameter for the function has units of 16-bit words, so for your specific application you put %M001
at the 'IN' node, and use a length of 16. Use any available register address at the 'POS' node. A nonzero value in the register points to the offset of the first bit over the specified range that is on. A value of zero in the register indicates that all bits are off.

_________
| BIT_POS |
| WORD |
--] [---| |-
| |
| 16 |
| |
| |
%M0001-|IN POS|-%R0001
| |
|_________|



You could move your %M bits into %R registers first, but there is no need to do so. In the Series 90, whenever you use a discrete address in a function that manipulates numbers, the instruction uses the specified address plus the next 15 (or 31). So, for example, if you used %M001 in an ADD_INT function, the system would interpret the bit pattern of %M001 - %M016 as an integer. The starting address of the discrete (%M) address must be on a byte boundary (%M001, %M009, %M017, etc).
 
Last edited:
Would the BIT POSITION instruction work for this? It will search until it finds a bit set to 1. The string length can be set.

Beat me to it....again
 
Steve

Would that be the LM90 equivalent of the BIT SET MATRIX function used in Logicmaster 6?

I only ask this because if I use this function when programming a Series 6 machine, I usually EOR the registers used first to reset all bits to zero and then set the bit I require on that scan, I do this to ensure that ONLY the bit set is the bit I want.

Paul
 
The BIT POSITION function in Series 90 returns the location of the first non-zero bit within the matrix. When I've used it, it has been as an 'any fault' detector. You could accomplish the same thing with an 'Equal' or 'Not Equal' function, but those are limited to a maximum of 32 bits.

The BIT SET and BIT CLEAR functions in the Series 6 act on a single bit in the defined range (matrix). There really is not an equivalent function in the Series 6 to the BIT POSITION. The closest would be the MATRIX COMPARE function, but that's closer to the MASKED COMPARE in Series 90. You could also do a Series 6 LIST SORT function and then test the lowest address in the sorted list for zero/nonzero.
 

Similar Topics

Hi all, Another odd question for you guys, Looking to try and set multiple bits to a single word register. Some context, I am using a Delta...
Replies
2
Views
1,696
What is the best way to set a bit over an ethernet/IP network on an Allen-Bradley ControlLogix Series PLC from a Windows PC. We have a program...
Replies
7
Views
2,104
Merry Christmas to everyone!! Working on a prototype system using a Click PLC and a Red Lion G306. I am trying to set a bit in the PLC when I am...
Replies
7
Views
2,098
I have an integer coming from an IO Link device into my PLC. The first 2 bits of the integer are digital status bits of 2 alarms in the device...
Replies
4
Views
1,506
Hi all, On a rare occasion I am programming a PV1000, in FV Studio Machine Edition 7. I want to SET a bit with one button and reset it with the...
Replies
5
Views
3,496
Back
Top Bottom