Clearing a bit array in CLX

ydtech

Member
Join Date
Jul 2008
Location
Guaiba - RS
Posts
116
I have a bit array about 1000 in length. Now I need to clear about 100 in the middle of it. The FLL instruction doesn't work with bits and I'm not finding any suitable alternative instruction.

Any suggestions?
 
I think you'll find that brute force is the only solution. Make a subroutine (or heck, an AOI) and fill it with individual OTU instructions.

RA just didn't make the BOOL array datatype with the same pointer functionality as the other atomic datatypes.
 
maybe I'm not understanding exactly what you're asking for - but see if the ideas here will help ...

this works on my lab equipment to "zero out" the contents of 100 BOOLS starting at location My_Bool_Array[10] ...

you'll probably have to tinker around with the "target" and "length" values - but if I understand your problem (?) - then this might get you going ...

.

bool_eraser.PNG
 
Last edited:
Watch out for the increased task execution time when you enable this clearing logic - you don't want to be tripping the Task Watchdog.
 
I have a bit array about 1000 in length. Now I need to clear about 100 in the middle of it. The FLL instruction doesn't work with bits and I'm not finding any suitable alternative instruction.

Any suggestions?

When I have to clear bit-words, I always use XOR, the word, with itself, result-itself.
 

Similar Topics

Is there's an easy way to clear an array of bits without having to use indirect addressing/looping of some sort. My ControlLogix tag is...
Replies
2
Views
2,583
Using an L81 - I have the arrangement below that will try the Ethernet Radio first and if that fails use the Cellular Radio. The Failover works...
Replies
16
Views
3,364
I'm online with a 90-30 using PAC ME 9.8 No one has gotten online with this PLC for many years and the the I/O fault table has a total of 1209...
Replies
6
Views
2,992
Since this is the most helpful place on earth for us programmers, I'm back with another one. Using Logix v32 I've got an array with 100 elements...
Replies
9
Views
2,970
Hey guys, I'm still pretty new to PLC's in general. For a program on RSLogix 500 with a micro1400 and pvp400, we are currently logging data for...
Replies
9
Views
2,801
Back
Top Bottom