Resetting a bool array in RSL5000

DairyBoy

Member
Join Date
Jun 2007
Location
UK
Posts
393
When using RSL500, I can indirectly address an unconditionally enabled coil and so long as it is immediately preceded by a FLL function that covers the word(s) containing the indirectly addressed bits, then only one bit is ever set at any time. I use this structure for bit-sequencers and it works well.


With RSL5000 I can do the indirect thing with a bool array but I can't find a way to replicate the FLL function and universally clear in one instruction the contents of a bool array (in this case, 128 bits).


Given the near-instantaneous scan regime in the L53x processors, would a preceding unlatch with the same indirect address as the "decoded" bit be guaranteed to clear that decoded bit every scan prior to it being set again or could it sometimes miss the target depending on when the value of the indexer is changed and leave a series of set bits in the bool array?


Or am I missing a simple bool array clear function? šŸ™ƒ
 
As I responded in your other post, I would use the FOR command again and use an Unlatch for each bit in the array. I know its not a single instruction, but it is just two.
 
Steve, I'm trying to get my head around the FOR in this context. 1: Set up the FOR function immediately prior to the indirect coil. 2: Add a routine to the project. 3: In the new routine put a single rung with a Unlatch that is indirectly addressed by the current value of the loop. Is that right? I have one periodic task running for PID loops. That was the only one that showed in the pull-down in the FOR instruction. Is that an indication as to where I should place the new routine? If ever a wheel was being reinvented. 5000 can be a real pain sometimes.
 
Last edited:
Walking out the door and tired, so I might misunderstand what you're doing...

What I do is create an array "All_Zeros_Array" that is filled with all zeros. I then COP (copy) the "All_Zeros_Array" to the array thaty I want cleared.
 
Thanks, kekrahulik, if it was a dint it'd be ok, but it seems that there's precious little that RSL5000 can do with bool arrays including copying/moving/ex-oring/subtracting/cpt-ing and just about everything else. o_O
 
You could do a do while loop (or any loop really) as long as the array isn't too long and just set the bool to 0. (Just make sure your loop has an exit point and doesn't lock the system up.)
 
1: Set up the FOR function immediately prior to the indirect coil.
I don't know that you need another "indirect" coil. In the FOR function, the "Index" parameter is a tag (I recommend a DINT tag like "IndexValue") that will increase by whatever the "Step" amount you define (1 in your case).
2: Add a routine to the project.
Yes, create a brand new routine with a new name.
3: In the new routine put a single rung with a Unlatch that is indirectly addressed by the current value of the loop.
Yep. So your Unlatch tag name will be something like "MyTag[IndexValue]". It will be the only rung in your new routine and have no nothing else on the rung other than this Unlatch coil.
I have one periodic task running for PID loops. That was the only one that showed in the pull-down in the FOR instruction. Is that an indication as to where I should place the new routine?
If you are referring to your FOR Function, yes, this is where it goes. I assume you have a "FAULT RESET" bit that will trigger the FOR instruction. I would also put a One-Shot in this rung, too.

Steve
 
Thanks for taking the time, Steve. The coil I was referring to in(1) was my original "output" coil that's doing all the work so that has to stay.

The single routine showing in the pull-down changed to all the others after I had started adding some detail to the instruction.

As you say, only two instructions. So it's that or a subroutine with 128 lines of "CMP Step_No=1 OTE Step[1]" etc. I think I'll toss a coin :D
 
This thread has ended up as a parallel to my other post and it's late and my brain hurts, so after tossing the coin, the multiple comparator/coil solution won. Thanks for the help though, Steve; it'll come in useful. Right now it's too many hours for too little output.
 

Similar Topics

Does Rockwell still offer reset codes for old school Master Disk floppy's? In a bind and need to reset the activation disk soon and to be pointed...
Replies
9
Views
236
Hi, I recently installed 2 1783-NATR devices into two of our machines. The machines are pretty much identical, both having 1769- L24ER-QFC1B...
Replies
4
Views
303
How is it going y'all? So We have had a pesky problem with an EH 300 flow meter. We are using EIP to reset the totalizer, and for some reason the...
Replies
3
Views
798
MELSEQ "intelligent modules" configuration, programmatically resetting the CPU Hello. This is for the Mitsubishi experts, and thanks in advance...
Replies
5
Views
1,067
Hi all, is there an easy way to reset a user defined shift register to 0? i have a data type containing 8 bools for an array of 10 and would like...
Replies
12
Views
3,199
Back
Top Bottom