In my application I need to use a generic Gcode program with Variables which should take values from a big array of data (20000 integers) during runtime.
I investigate on using the gather buffer.
step1/ load the 20000 integer values in the gather
=> From a .Net application, how can I upload the 20000 integer in the gather buffer.
I looked in doc without a clear answer
the code would be like this:
Code: Select all
KM.KMotionLock()
KM.ServiceConsole()
KM.WaitToken(500)
KM.WriteLine("SetGatherHex " & offset & " " & nData)
KM.WriteLine(data)
KM.ReleaseToken()
Question 1:
=> this data would be extremely large and could cause issues and timeout during the KM.WriteLine(data)?
step2/ run the gcode which will use a dedicated M1xx Mcode running a C program to fetch the gather value
inspired by
CaptureXYMotionPosDest.c
Code: Select all
//dedicated Mcode running this C program
p = gather_buffer;
indexGather = (Qvalue- 1) * 40;
persist.UserData[50] = p[indexGather]; indexGather += 1;// from gather;
for (int i = 1; i <= 20; i++) {
//read start segment from gather
persist.UserData[50 + (2 * i) -1] = p[indexGather]; indexGather += 1;
//read end segment from gather
persist.UserData[52 + (2 * i)] = p[indexGather]; indexGather += 1;
}
SetVars(50, (1+40), 50); //41 variables to copy from persistent 50 to Gcode #50
Question :
Is my investigation possible? Do you have other proposal on using so much variables with a Gcode program using #variables?
Thanks for your support
Frederic