Based on some experiments it appears that TinyG does not support user parameters in G-Code files. Is this correct or is there some trick? An example I tried is:
#1=10
#2=20
G0X#1Y#2
I also tried:
G0X[5+5]Y[10+10]
but that doesn't work either. It appears that neither the #1= form is allowed nor calculating a result in [].
Thanks for confirming that. I'm writing g-code templates to control the scan path of an instrument we are building. We will need to insert the parameters (position, size and scan speed) into the template. We will just have to do a little more work without parameters.
I've just gone through the latest code and the following are the only GCode parameters parsed:
case 'G':
case 'M';
case 'T': SET_NON_MODAL (tool_select, (uint8_t)trunc(value));
case 'F': SET_NON_MODAL (feed_rate, value);
case 'P': SET_NON_MODAL (parameter, value);
case 'S': SET_NON_MODAL (spindle_speed, value);
case 'X': SET_NON_MODAL (target[AXIS_X], value);
case 'Y': SET_NON_MODAL (target[AXIS_Y], value);
case 'Z': SET_NON_MODAL (target[AXIS_Z], value);
case 'A': SET_NON_MODAL (target[AXIS_A], value);
case 'B': SET_NON_MODAL (target[AXIS_B], value);
case 'C': SET_NON_MODAL (target[AXIS_C], value);
case 'U': SET_NON_MODAL (target[AXIS_U], value);
case 'V': SET_NON_MODAL (target[AXIS_V], value);
case 'W': SET_NON_MODAL (target[AXIS_W], value);
case 'I': SET_NON_MODAL (arc_offset[0], value);
case 'J': SET_NON_MODAL (arc_offset[1], value);
case 'K': SET_NON_MODAL (arc_offset[2], value);
case 'R': SET_NON_MODAL (arc_radius, value);
case 'N': SET_NON_MODAL (linenum,(uint32_t)value);
case 'L': break;
I couldn't find any use of the '#' user parameter and my testing of the board itself
#100 = 50
G0 X#100
Resulted in X going to 100, not 50, so it looks like # is parsed as a value, not a variable.
I'll have a look at G2Core and see if it has a better alignment with NIST GCode.