Sum part of an array starting at element 70

I am reading the description of the FAL instruction in the ref manual over and over, and I still have no idea what it does.


Use the AVE instruction and multiply the result by 30.


Assuming AVE can write to a REAL destination, there should be enough bits in the mantissa to lose no resolution.
 
But shouldn't the .POS go from 70 to 100 once it goes true?

I'm sure it does happen, it starts at 0, rung goes true, we set the position to 70, iterates to the length, then goes back to 0 once complete. I believe it happens in 1 scan, which is probably why you don't see it in the trend.
 
I'm sure it does happen, it starts at 0, rung goes true, we set the position to 70, iterates to the length, then goes back to 0 once complete. I believe it happens in 1 scan, which is probably why you don't see it in the trend.

I'm not as convinced, the section I am looking for (70-100) is static and the section before that (0-69) is moving around and the value I get is moving around so I know its not looking at the right part of the array.
 
I'm not as convinced, the section I am looking for (70-100) is static and the section before that (0-69) is moving around and the value I get is moving around so I know its not looking at the right part of the array.

Set up a simple example like mine with known values. I have a 666 in [0], a 5 in [70], 10 in [71] and a 40 in [86]. The result is 55 when I run it.
 
"The done bit is set when the instruction has operated on the last
element (.POS = .LEN)."
So to do all from 70 to 99, you need to do .pos=70, .len=100
I know, confusing right?
Also, if you start with .pos>=.len, it resets .pos to zero for you.
I regret ever using this instruction.
 
"The done bit is set when the instruction has operated on the last
element (.POS = .LEN)."
So to do all from 70 to 99, you need to do .pos=70, .len=100
I know, confusing right?
Also, if you start with .pos>=.len, it resets .pos to zero for you.
I regret ever using this instruction.

That's what I am doing as well... Tech support said I was doing it right but its not working here. I gotta look through the files, I know I've used this before successfully .
 
You could always do two FALs: one with .LEN=70 and .MODE=ALL; one with .LEN=100 and .MODE=ALL.


Your answer (sum[70 to 99]) is the difference.


But you do need to ensure they both have ALL as the .MODE.
 
Last edited:

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
813
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
5,965
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,065
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,033
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,641
Back
Top Bottom