TinyG support for user parameters (e.g. #1, #2, etc.)

Home Forums TinyG TinyG Support TinyG support for user parameters (e.g. #1, #2, etc.)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11078
    RichL
    Member

    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 [].

    Is there a way around this?

    RichL

    #11080
    cmcgrath5035
    Moderator

    I don’t see user parameters listed here
    https://github.com/synthetos/TinyG/wiki/Gcode-Support,
    so likely not supported

    I 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?

    #11081
    RichL
    Member

    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.

    RichL

    #11086
    Zootalaws
    Member

    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.

    #11087
    Zootalaws
    Member

    Just had a look at G2Core and it adds Marlin compatibility, but still no support for # user params.

    #11100
    RichL
    Member

    Thanks all for your answers, that confirms that I’m not missing something.

    RichL

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.