QUOTE (pabeader @ Sep 14 2009, 08:25 AM)

QUOTE (Alaric @ Sep 14 2009, 09:17 AM)

With only 25 entries a brute force comparison against all 25 will take less system overhead and time than any kind of indexed search. Using cut and paste you can probably program it all in under five minutes. You can use a subroutine and RETurn when found so that you only check until a match is found.
That's what I was afraid of. Thanks for the info!!!
So then I would setup a group of B's to track which 'slot' is available. Brute force it again to MOV a newly created widget PN/SN into the available slot and reset the slot available bit.
If you use a subroutine again with conditional RETurns then you can pretty easily set it up to always use the first available slot and then return.
If it is any consolation, one plus to brute force is that someone else can come along and pretty easily decipher what you were intending. That tends to minimize 3:00 am phone calls from Bubba. Its a little more work for the programmer, but the PLC often executes brute force repetitive rungs better than loops. Given the chance however, I myself would still prefer to use a loop and indirect addressing. Unfortunately AB seems to have an obsessive/compulsive need to dumb down its bricks in ways that make little sense and make life difficult for their customers.