iztok

Iteration trough data registry

4 posts in this topic

Hello,

i have simple problem but i do not  have solution for it.

Therefore, i  have one source for example D0 and i whant on every cycle change destination of data registry for example from D100 to D200?

To be more clearer i need to move value from the D0 in first iteration in D100, then in second iteration in D101 and so on.

P.S. I working on FX3G nad FX3U with GX works2.

Thank you in advance.

Share this post


Link to post
Share on other sites

This can be done with index registers (Z). For example:

mov k0 z0; the value of index register 0 = 0

mov D0 D100z0; the contents of D0 will be moved to D100 (100+0=100)

inc z0; index register now = 1

mov D0 d100z0; D0 will now be moved to D101(100+1=101)

and so on..

1 person likes this

Share this post


Link to post
Share on other sites

Hello, first of all you are the best i will try this.

Thanks!

Share this post


Link to post
Share on other sites
Just now, Luke.S said:

This can be done with index registers (Z). For example:

mov k0 z0; the value of index register 0 = 0

mov D0 D100z0; the contents of D0 will be moved to D100 (100+0=100)

inc z0; index register now = 1

mov D0 d100z0; D0 will now be moved to D101(100+1=101)

and so on..

Hello, your solution workin perfect.

Once again thank you a lot!.

 

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