Sum part of an array starting at element 70

TheWaterboy

Lifetime Supporting Member + Moderator
Join Date
May 2006
Location
-27.9679796,153.419016
Posts
1,924
I'm trying to sum the last part of an array starting at element 70 for 30 elements.

I placed a 70 in the .POS element of the FAL and it gets cleared to zero at each pass. I haven't seen examples that start anywhere other than zero yet so I gotta ask.

What is the proper way to start at somewhere other than zero?
 
I get where you are going with those but I can't enter anything but a DINT into the POS field of the FAL instruction. I tried entering a starting position withe MOV on the rung above and still resets to zero.
 
I get where you are going with those but I can't enter anything but a DINT into the POS field of the FAL instruction. I tried entering a starting position withe MOV on the rung above and still resets to zero.

But you can write a value to the POS of the control. MOV 70 MyControl.POS
 
How big is your array
if you are starting at 70 and using 3 elements then the array length must be at least 101
I got in the practice of always making my arrays larger then I need to avoid index overrun and processor fault
 
Placed LoopyDoop on a trend and watched .POS. It goes from zero to 70 and back to zero. What is going on with this instruction?

In my example, it is 0 when the instruction is not true, It's first iteration starts at 70 once the instruction goes true. I had a value in [0], it was not included in the sum.
 

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
815
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,008
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,078
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,055
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,655
Back
Top Bottom