Sign in to follow this  
Followers 0
mdanielswv18

Adding multiple registries in Q Series

8 posts in this topic

Is there a shortcut to add 5 different registries together in a Q series? Lets assume I want to add the contents of d100, d101, d102, d103, and d104 and then store them in d105. I know I could do a long process of [+ d100 d101 d200] then add everything individually and finally store my result in d104 but I would like to simplify this and I am not sure if it is possible.

Share this post


Link to post
Share on other sites
Isn't there a SUM command? Maybe WSUM or something like that? As long as they are consecutive registers there is a function for that. If using GX Works2 the math function blocks in structured ladder can be expanded to 28 inputs.

Share this post


Link to post
Share on other sites
I might be wrong here, but isn't the SUM command the same as the mathematical SUM which takes the average of x number of inputs? As mentioned, I might be wrong here, but check the docs.

Share this post


Link to post
Share on other sites
Hello! I think this is the best way:

Share this post


Link to post
Share on other sites
If you want to add more registers, you can use the FOR - NEXT instructions. This program add the contents of all registers between D0 and D99, and store the result in D100. You can set the numbers of addition with constant after FOR instruction. Edited by gempetya

Share this post


Link to post
Share on other sites
As pointed out earlier, WSUM is ideal for this kind of thing (or if structured, increase the number of var pins) Edited by Mitsu

Share this post


Link to post
Share on other sites
kaare_t you are thinking of MEAN, not SUM. MEAN is an average function. SUM is a total.

Share this post


Link to post
Share on other sites
Yep, you are indeed correct! Good to know!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0