Sum part of an array starting at element 70

Yes, I will go correct that, but the flaw is that you can't ask for less elements to be manipulated than the number in position. I was asking for 30 elements starting at 70. i.e
POS > LEN so it said it was done
 
you need to unlatch the .DN bit and I would also unlatch .EN bit before you move the start .POS [70] into the search function
if the .DN bit is true when you move 70 into the .POS the function will set the .POS to 0 in the rung transition from false to true that's why it's important to clear the bits first
 
Yes, I will go correct that, but the flaw is that you can't ask for less elements to be manipulated than the number in position. I was asking for 30 elements starting at 70. i.e
POS > LEN so it said it was done




the flaw isn't that you cannot ask, because you can, just not directly; the flaw I see is that .LEN is incorrectly described in the manual; so setting .POS to M and .LEN to (N+M) is how you "ask for N elements starting at M."


Of course what they should have done was said ".DN is set when .POS = (.POSstart + .LEN), but then they would have had to keep track of .POSstart.
 
from what I see you are still not clearing the .DN bit before you move the starting position to the .POS
it must be in that order or it will clear the .POS
 
Here you go. Though I did have it working without clearing the .DN and .EN bits - I added them for good measure. I've danced with this little devil long enough.

FAL working.jpg

EDIT: Funny I happened to capture it at POS = 100. I don't see that looking at it live. Must have been just the right moment
 
it works but you 2 unlatch bits should be in the ONS (One shot) rung
otherwise it could keep them off when you need them to be on to end the FAL
rememer the .DN bit is set when .POS = .LEN
 
Super work, WaterBoy, GaryS, et al.


This is equivalent to finding a compiler bug; someone should make a me-tube vid of this, with some snarky comments about the misleading manual.
 
Last edited:
Yea, I know I have gone through this before and failed with no explanation as to why. Now I have that as well.

The end goal of this effort is to check if a data point has changed from either the local or remote location and if so copy it to the other. I now have that working too. Its a good Monday !
 
Kiss:
PS FAL will always reset POS to 0. But you can simply use an offset with the .POS + 30
Should work with any data type INT DINT Real.
Should probably clear SUMMyArray before as well.

SimpleFALSum.jpg
 
Last edited:


We had that 55 posts ago, but the OCD among us (ahem) could not let it go that the instruction did not seem to work as advertised.


"We will shave no yak before its time - but we will bloody well shave it" - with apologies to Orson Welles
 

Similar Topics

Hi again, I´m still working on the upgrade from 500 to 5000 of this program. I found something that I cannot explain, in RSLogix 500. It seems...
Replies
0
Views
822
First, a background on the equipment so you know what is going on. I have an AB ControlLogix L63 processor controlling some Mitsubishi...
Replies
17
Views
6,019
hello, I am a beginner and also new here, I was reading something about PID loop, there is two tanks , each with a sensor of pH, the control...
Replies
9
Views
3,084
Hello all, I'm trying to recreate the following checksum calculation in the PLC. The example is written in C++ of which I am not very familiar...
Replies
8
Views
3,058
Sum
Good Morning I am using rs logix 5000 and i would like to sum the values in an array without having to add each one in a CPT and at different...
Replies
1
Views
1,663
Back
Top Bottom