clx summing question

take a look at the FAL instruction ... you'll probably also need to use a CLR to "zero out" any previous sum just before you do the FAL ...
 
Write a ST routine that goes:

i := 0;
Total := 0;

While i < 100 Do
Total := Total + Array
i := i + 1;
End_While
 
Not everyone has ST licensed CLX, otherwise a good suggestion.

In Ladder, you could also use the Average instruction (AVE) and multiply by 100.
 
Last edited:
robertmee said:
Not everyone has ST licensed CLX, otherwise a good suggestion.

In Ladder, you could also use the Average instruction (AVE) and multiply by 100.

Absolutely true, but I can't imagine programming in 5000 without it........
 
CroCop said:
Absolutely true, but I can't imagine programming in 5000 without it........

I'm with you there. I was dismayed when CLX first came out without STX at all after having it available in PLC5 for so many years. BUT, in that it costs more as an option, there are many plants that are doing SLC or PLC5 to CLX conversions that don't purchase it.
 
robertmee said:
In Ladder, you could also use the Average instruction (AVE) and multiply by 100.
:cool:

I like that - so obvious, now why didn't i think of it ....

my solution would have been to use either a FAL (clunky with it's indexing), or a FOR loop (slow).
 
daba said:
:cool:

I like that - so obvious, now why didn't i think of it ....

my solution would have been to use either a FAL (clunky with it's indexing), or a FOR loop (slow).

The AVE instruction will not work in my situation because I want to get the exact sum of the array and not the average.
 
johnfarrugi said:
The AVE instruction will not work in my situation because I want to get the exact sum of the array and not the average.

That's why you multiply it by the number of your array. If you have a 100 numbers, take the average and multiply by 100 then you get the sum.
 

Similar Topics

Controller: 1756-L84E v.35 Prosoft MVI56E-MNETC for ModbusTCP/IP I'm having an issue with some of my write commands. The write command that...
Replies
0
Views
198
I have several Avery scale units and they are configured as Generic Ethernet modules, and I am actually reading the data fine for the weight...
Replies
2
Views
424
What's the best way to move a tag value from the panelview+7 to the clx plc. We display amps from a power meter on the panelview screen, read in...
Replies
1
Views
400
I'm running into an issue migrating a PLC-5 using the newer Logix Designer Export when opening a saved .ACD from RSLogix-5. It has multiple RIO...
Replies
2
Views
622
We have two sites that are stranded with no line of site, they are handled by phone/modem with a chain that includes: Stranded site (client)...
Replies
5
Views
912
Back
Top Bottom