iztok Posted August 29, 2016 Report Posted August 29, 2016 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. Quote
Luke.S Posted August 29, 2016 Report Posted August 29, 2016 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 Quote
iztok Posted August 29, 2016 Author Report Posted August 29, 2016 Hello, first of all you are the best i will try this. Thanks! Quote
iztok Posted August 29, 2016 Author Report Posted August 29, 2016 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!. Quote
Recommended Posts
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.