Jump to content

Recommended Posts

Posted

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.

Posted

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

  • Like 1
Posted
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!.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...