02-07-2003, 08:36 PM
I have the following data handling problem:
In making a machine controller the machine movements are controlled by "G Code". A typical G code would be:
G3 X.234 Y.237 I1.008 J2.2195 Z.291 F36:
In handling the data we derive 13 different numbers from the above code. In order to make the machine operate smoothly we do something called Lookahead wherein we preview the succeeding 20 codes, getting the 13 different numbers from each.
All this data is put in an array of 13 x 20. Now when the machine is being run, the data is taken from the first group and as many following groups as needed. After the first group is run, I Re-number the following groups as:
FOR w = 1 to 20
xx(w) = XX(w + 1) 'X value, #1
yy(w) = yy(w + 1)
zz(w) = zz(w + 1)
ii(w) = ii(w + 1)
"
"
aa(w) = aa(w + 1) 'Arc value, #13
NEXT w
As you can see, the data from the first group is now lost. Now new data is added so that there are 20 groups of data stored.
So the data is being shifted back one place each time old data is used (removed) and new data is added.
My question is this: "Is there a better way of handling the data so that I don't have to renumber it and thus can SAVE THE TIME lost in the renumbering?" There may be many thousand blocks of data in a program, and I don't want to save 13 sets on info for each.
I hope this is clear enough; if not , maybe I can expand on it.
Regards,
Jack C.
In making a machine controller the machine movements are controlled by "G Code". A typical G code would be:
G3 X.234 Y.237 I1.008 J2.2195 Z.291 F36:
In handling the data we derive 13 different numbers from the above code. In order to make the machine operate smoothly we do something called Lookahead wherein we preview the succeeding 20 codes, getting the 13 different numbers from each.
All this data is put in an array of 13 x 20. Now when the machine is being run, the data is taken from the first group and as many following groups as needed. After the first group is run, I Re-number the following groups as:
FOR w = 1 to 20
xx(w) = XX(w + 1) 'X value, #1
yy(w) = yy(w + 1)
zz(w) = zz(w + 1)
ii(w) = ii(w + 1)
"
"
aa(w) = aa(w + 1) 'Arc value, #13
NEXT w
As you can see, the data from the first group is now lost. Now new data is added so that there are 20 groups of data stored.
So the data is being shifted back one place each time old data is used (removed) and new data is added.
My question is this: "Is there a better way of handling the data so that I don't have to renumber it and thus can SAVE THE TIME lost in the renumbering?" There may be many thousand blocks of data in a program, and I don't want to save 13 sets on info for each.
I hope this is clear enough; if not , maybe I can expand on it.
Regards,
Jack C.