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
0
votes
1 answer
ANTLR: How to get rid of 'missing NEWLINE at '''?
I'm having trouble recognising 'end of file' correctly with ANTLR. As soon there's no new line but just 'end of file' after the last character I get
line 37:1 missing NEWLINE at ''
Any ideas on how to deal correctly with end of file?
This is my…

BetaRide
- 16,207
- 29
- 99
- 177
0
votes
1 answer
G-code G1 move command is not consistent with MM114 get motor position command
I am using the G1 move command to rotate a a stepper motor with a Duet3D stepper controller board. I just realised by using the M114 command, which returns the actual motor position, that there is an error margin between the 2 commands, but I don't…

JCSB
- 345
- 2
- 16
0
votes
1 answer
Using re.compile function to parse a gcode file line by line in Python
I'm parsing a gcode file (located in f_path) line by line, searching for a given string. That string ("M622") appears a single text in the whole text file, whose structure is like this one:
GCODE FILE
M622; arm the Lasers
M610 S0 A80 B0 C0 ;…

Figs
- 15
- 3
0
votes
2 answers
A application which shows line by line sequence of the gcode
is there any application which I can load the gcode from a CNC for example and I can check line by line graphically what is going on line by line in my g-code?
I mean like the apple swift playground?

Manolo
- 469
- 6
- 20
0
votes
1 answer
Windows File Explorer preview for every GCode images C#
I can generate images from GCode files, but I don't know how to add a preview in Windows File Explorer for every image.
I would like to achieve this:
LINK
I never done this
PS. I'm using .Net C# WinForms.
Thanks advanced,
Steve

Steve Miller
- 35
- 6
0
votes
0 answers
Rendering g-code coordinates in a WPF application?
I need to develop a g-code visualizer that will build lines according to g-code.
The task is quite simple. I need that in the WPF window, in the 3d component all the lines are displayed according to g-code. It should be possible to increase/decrease…

Alexey M
- 44
- 4
0
votes
1 answer
How to check if a number inside an IF statement has changed and only then execute a script?
I am creating a tool changer for a pen plotter that only makes a tool change every time the source file moves to read data from a new layer (inside inkscape). This script injects a certain piece of GCODE (code that a CNC-based machine needs to know…

Marinus
- 39
- 5
0
votes
1 answer
Where is this white space coming from?
I am post-processing output from a python script that generates GCODE for my homebrew pen plotter.
The post-processor adds a white space in my GCODE right after a crucial bit of information (after every X and Y coordinate value), causing the GCODE…

Marinus
- 39
- 5
0
votes
0 answers
Gcode for fabric cutting machine
i am trying to understand how following gcode works:
H1*
G71*
M70*
M20*
Default…

dismine
- 575
- 13
- 17
0
votes
1 answer
converting a Fanuc g-code including Macro-B to basic syntax
I have a g-code written in Fanuc g-code format including Macro-B (more info here), for example
#101 = 2.0 (first variable)
#102 = 0.1 (second variable)
#103 = [#101 + #102 * 3] (third variable using simple arithmetic)
G01 X#101 Y#103 F0.1
which…

Foad S. Farimani
- 12,396
- 15
- 78
- 193
0
votes
0 answers
How to use DrawArc in C# correctly from GCODE?
I'm trying to draw an arc (using Graphics.DrawArc) from GCode, but the C# result is not the same when i compare with result from https://ncviewer.com/ website.
I changed the coordinate system to start from left buttom.
I'm using the following…

Steve Miller
- 35
- 6
0
votes
1 answer
Convert an Arc to Polyline
I have 3 points, that will define an arc.
I would like to convert the Arc to Polyline.
How can I implement this is c#?
Thanks advanced

Steve Miller
- 35
- 6
0
votes
0 answers
bug in SVG to Gcode conversion
I am working on a project that converts an image to its respective Gcode. But when i run it for simple shapes (square, circle etc) the gcode generated fills the interior of the shapes, which is not needed. i realized the error is in one file but i…

Tarun Karthik
- 51
- 7
0
votes
0 answers
Does anyone know of a g-code parser that translates user input to g-code?
I am building a stretching stage to be distributed publicly for scientific testing of soft-bodied electronics and I am writing a GUI that allows users to input stretching distance (x) and number of cycles (times it will be stretched x distance. Does…

rperalta22
- 1
- 1
0
votes
1 answer
How to specify tool offset with G41 syntax
Let's say during a side milling operation, a 40mm dia tool is used, so an offset is specified using a syntax as follows:
G41 D4
From what I understand from the above syntax is that, D must be followed by a number obtained by dividing the tool dia…

Somanna
- 284
- 1
- 13