Welcome! Log In Create A New Profile

Advanced

[concept] Are there any Gcode standards for variables /conditions / math operations?

Posted by Tomek 
[concept] Are there any Gcode standards for variables /conditions / math operations?
November 27, 2017 12:49PM
So I have thought a few times that I wanted to make gcode that had conditional statements, math, and/or just variable infill in it. For example, with respect to the latter, something like ; $PARK = 200 ; in gcode, and in the gcode file a bunch of G1 X$PARK commands. Same thing for temperatures.

While this can be sort of done with firmware support, e.g, ultimaker stuff and some of the old makerbot stuff that you tell the printer a material and it heats and reacts for those material's settings. But I'd rather be able to write a gcode in which the host is expected to parse the file either once beforehand or on the fly and create something pretty agnostic for the output to the MCU. I guess it wouldn't work for SD card reading but I use octoprint/full host usually. I am trying to find out if anyone has seen a need for this before or worked on it. I only found one forum post for a similar question long ago,and it suggested using "SED" [https://en.wikipedia.org/wiki/Sed] which seems good enough, but I don't have the experience with it to judge whether it's well suited.

This is a kind of theoretical question so I figured "experimental" is the right place to post, but not sure.... In my case today I'll just write a python gcode script to generate me new gcode when I change variables in the header, but it's something I thought maybe people have given thought towards and I don't want to reinvent the wheel (plus I think if I did, it would be a wobbly wheel.)

Edited 1 time(s). Last edit at 11/27/2017 12:50PM by Tomek.
Re: [concept] Are there any Gcode standards for variables /conditions / math operations?
November 27, 2017 12:56PM
I found this which is partway: [www.cnccookbook.com]
&
[linuxcnc.org]

Seems conceptually it's a maybe-thing in CNC world, but I haven't found any reprap discussions about it. Probably because it's mostly implemented in firmware usually, and this CNC stuff is too to a degree, but I like the idea of having a host that controls things. Seems some functions would be hard to make it exclusively host-controlled.

Edited 1 time(s). Last edit at 11/27/2017 12:59PM by Tomek.
Sorry, only registered users may post in this forum.

Click here to login