Adding consective numbers with fal

graybeard_61

Member
Join Date
Dec 2010
Location
tx
Posts
24
I need to add 20 consective numbers in a floating point file and store the result in a single element address also in the floating point file. I have used a # before the address in the expression but it still does not work. In my example I am adding f8:150 through f8:169 and storing the result in f8:170. I tried using it in all modes ( inc, all,and Num) with no success as yet. Any help is appreciated.
 
See picture below. Your length and registers will be different. Example below is just to give you an idea of how to make it work.

You will need to clear the total after each addition of the 20 registers before you add them all again.

add.jpg
 
Last edited:
If your processor has the AVERAGE instruction, then a faster implementation would be to AVErage the values, then multiply by the number of values.....

AVE = SUM/LEN

therefore

SUM = AVE*LEN
 

Similar Topics

Hi Everyone, Currently we have three plants running with Controllogix PLCs (L72, L73, L74). In each of these plants we have 2 FTView SE...
Replies
0
Views
54
Hello, Im building project with 1756-L82ES controller and 1756-IB16S card but i cant find it when trying to add the card to IO configuration...
Replies
3
Views
135
Hello, I have a pair of redundant 1756-L71 controllers rev 24. These controllers currently have produced and consumed tag interfaces to 3 other...
Replies
2
Views
158
I'm adding an IAI Gateway with 2 axes connected to it. To an ethernet network on my PLC. So, I think the math is correct on the Input and Output...
Replies
0
Views
143
Hi Folks. I am gearing up to add a 2nd identical HMI to a project. This 2nd HMI will basically be an exact clone of the 1st one. The equipment...
Replies
3
Views
258
Back
Top Bottom