G-code is the common name for the widely-used computer numerical control (CNC) programming language defined in EIA-274.
Questions tagged [g-code]
117 questions
1
vote
1 answer
How to display the variable in a tkinter window?
I am completely new to Python and I am working on a following code that I made with big help of fellow stackflow user.
After running the script a tkinter window open where you can select a gcode file (it is a file with many many lines of…

Bart
- 101
- 4
- 11
1
vote
1 answer
Sending gcode string to 3D printer through a serial port
I am trying to display a message on my FlashForge Creator Pro (dual) 3D printer by sending the Gcode to the printer through serial communication.
When I open the ReplicatorG software and place the string:
M70 P5; Hello World.
And click "Build"…

dennis
- 2,000
- 18
- 26
1
vote
1 answer
Interpret G-code into motor control signals
I'm not sure that this is the right place to post this question, but I figured it was a good start since it deals with code... if not, please point me to the right forum, thanks.
I'm looking to create a G-Code interpreter on a C/C++/FPGA embedded…

Jedi Engineer
- 493
- 3
- 11
- 29
1
vote
1 answer
Two possible paths for G-code circles
In G-codes a clockwise arc can be specified by e.g.
G02 X2 Y0 R2
This code should give an arc between the current position and (2,0) with radius=2.
According to several sources (And Math) eg.
There will always be two circles/arcs that satisfies…

Sigurd V
- 5,077
- 4
- 18
- 27
1
vote
1 answer
Changing Regex to work with dot's c#
Im using regex to seperate my G Code into seperate X,Y,Z,E,F commands.
using the regex below it works with commas.
[GMXYZEF][-+]?[0-9]+(,[0-9]+)?
G1 X-5,300 Y5,110 E1,17440
But if i switch the commas to dot's it dosent work.
G1 X-5.300 Y5.110…

user2521664
- 11
- 1
0
votes
0 answers
Problem regarding converting text to g-code in C#
So I have a problem regardind converting text to G-Code commands (G-Code commands supported by GRBL firmware). I almost did a good conversion, but not really. My export function looks like this right now:
private void ExportButton_Click(object…

tymol
- 1
- 1
0
votes
1 answer
moving an object around a Circle
I am going to draw a shape like a gear, how can I move a tooth around a circle?
Something like the image below :
circle
For example, I need to draw 20 teeth at equal intervals around a circle with a diameter of 50 mm.
I am doing this for a G-code…

Ashkan Khajeh
- 3
- 2
0
votes
0 answers
Possibility of transforming G-code to Step file
I’m quite new to programming but I’m enthusiastic. I hope I did not ask anything stupid.
Is there any was of transforming/converting a G-code from a slicer to a step file?
What I would need is the structure generated by the slicer to be in CAD file…
0
votes
0 answers
How can I convert a web page to gcode for CNC engraving?
What I want to do is take the text from a Wikipedia page and etch it into stone with a CNC.
Conceptually it's not that hard, you scrape the text, convert it to vectors, and use a CAM tool to make gcode. But doing it in an automated way with a body…

Pepijn
- 4,145
- 5
- 36
- 64
0
votes
0 answers
Laser engraving with 3018 pro can be controlled with basic Openbuilds controls, but engraving a file causes errors
I've been struggling with this for the past three days, and I can't seem to solve this problem. I'm on a Mac and trying to let my 3018 pro cnc machine laser engrave an image, but whatever I do, it always gives this error: "Error 20 - Unsupported or…

Bas Boersma
- 13
- 2
0
votes
0 answers
Pen Command (M280P0S0) is occuring before move command (G1) completes
Hello I'm having a problem with the sequence order of events. I am under the impression that g-code (or the machine) will wait for each command to complete before moving on to the next command. But I'm not seeing this.
I have a plotter machine that…

user1529413
- 458
- 8
- 19
0
votes
1 answer
What gcode keyword is responsible for "Click to resume" feature?
I want to make a gcode to make it easier to level my ender 3 pro, that uses the marlin firmware. On previous CHEP levelling gcodes, i've seen the "Click to resume" feature that waits for the user to click the knob to move to the other spot. I can…

Hefahl
- 19
- 4
0
votes
0 answers
How to generate a G-code from a bitmap using Python?
I need to generate a txt file with G-code in it from a black and white bitmap. In the other words, i need to cover the black area with traces for a CNC machine. I was thinking about transforming the bitmap into an array with coordinates of black…
0
votes
0 answers
Execute command for Nextion with M118 gcode
I am trying to control Nextion device with Skr Pro v1.2 But I couldn't find a way.
I enabled #define NEXTION_TFT nextion module and connected to TFT port. I used many versions of M118 codes but it didn't work.
Fo ex: M118 P2 page page2 or M118 A1 P2…

user2435650
- 21
- 5
0
votes
2 answers
Insert Item into line on text file with Python
I have a large gcode/text file.
I want to search the file and if a line contains the word 'layer' like:
; layer 1, Z = 0.500
Then I want to add this below it once every x amount of layers:
;Clean Nozzle
G0 X30 Y-47 F10000
G0 X70 Y-47
G0 X30…

AdWidd
- 3
- 2