Home › Forums › TinyG › TinyG Support › TinyG support for user parameters (e.g. #1, #2, etc.)
Tagged: #1 user parameters
- This topic has 5 replies, 3 voices, and was last updated 6 years, 2 months ago by RichL.
-
AuthorPosts
-
August 16, 2018 at 5:52 pm #11078RichLMember
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#2I 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 [].
Is there a way around this?
RichL
August 16, 2018 at 9:19 pm #11080cmcgrath5035ModeratorI don’t see user parameters listed here
https://github.com/synthetos/TinyG/wiki/Gcode-Support,
so likely not supportedI don’t see a workaround in tinyG, you of course could develop a Gcode stream preprocessor., but not clear how that would help.
You are generating your own Gcode?
August 17, 2018 at 9:34 am #11081RichLMemberThanks 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.
RichL
August 19, 2018 at 12:50 am #11086ZootalawsMemberI’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#100Resulted 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.
August 19, 2018 at 1:00 am #11087ZootalawsMemberJust had a look at G2Core and it adds Marlin compatibility, but still no support for # user params.
August 20, 2018 at 9:42 am #11100RichLMemberThanks all for your answers, that confirms that I’m not missing something.
RichL
-
AuthorPosts
- You must be logged in to reply to this topic.