Jump to content

Recommended Posts

Posted
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.

Posted
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.
Posted
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.
Posted (edited)
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
Posted (edited)
As pointed out earlier, WSUM is ideal for this kind of thing (or if structured, increase the number of var pins) Edited by Mitsu

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
×
×
  • Create New...