Hi all!
I am trying to help a colleague at distance with a problem where we want to repeat a series of local motions, but with a slightly shift in Y-direction each loop, for a couple of times.
I use a FOR-loop where R[2] is the FOR-counter that I use in the program where I calculate the UF shift.
I have written this code in the shift program:
1: UFRAME_NUM=1 ;
2: UTOOL_NUM=9 ;
3: ;
4: PR[98]=UFRAME[1] ; <-- Saving the original UF data to overwrite with in the end.
5: ;
6: PR[99]=UFRAME[1] ; <-- I put UFRAME1-data in PR[99]
7: R[99]=PR[99,2] ; <-- I put the Y-value from PR[99] into R[99]
8: R[97]=100*R[2] ; <-- In R[97] I do the shift calculation
9: R[99]=R[99]+R[97] ; <-- In this row I replace the value of R[99] with R[99]+R[97]
10: PR[99,2]=R[99] ; <-- Here I put the recalculated Y-value back into PR[99]
11: UFRAME[1]=PR[99] ; <-- And here I put the changed PR[99] with the ny Y-value back into UF1
What I thought it will do on row 10 is to only overwrite the Y-value in PR[99]. But it seems that all other values (X, Z, W, P, R) turn to 0 at this Point. The Y-value is correct but the others Changes to 0.
Anyone have an idea what I am doing wrong?
Thanks!