Docs
Ask or search…
K

G-Code

Parser and executor
Warning: This is an early version of the feature and some behaviors are subject to change.
The RapidCode G-Code Parser and Executor are not a replacement for a true CNC controller. It is not a simple drop-in replacement for a full function CNC provided by companies who offer turn-key solutions in this field. However, the flexibility of the RMP motion controller as well as interoperability with PathMotion and arbitrary kinematic robot models make it ideal for designing specialized machines that use G-Code as the motion command source.
G-Code is not running in the RMP but instead, a program that buffers motions to the RMP (Getters and setters will not work across multiple applications at the same time)

What is G-Code?

G-Code is a programming language for specifying coordinated motions in cartesian space used by many manufacturing machines.
RapidCode API G-Code Sample

How does G-Code work?

In the RapidCode API, G-Code parsing requires the creation of a Robot instance, which requires the kinematic model to be specified, and a MultiAxis instance that contains all of the axes used during the execution of the G-Code file. Machines with prime or redundant axes can also be configured by specifying the axis to link their motion to within the kinematic model.
You can find the full set of G-Code functions in our API documentation.

User Interface

Build your user interface using our API or use our G-Code UI built into RapidSetup.
RapidSetup: G-Code UI

Supported Codes

We currently only support a very basic set of codes. If you would like us to support more codes in the future reach out to us and we can look into supporting a new feature for your needs.
Code
Description
Explanation
G1
Linear interpolation
Coordinated linear motion between points in cartesian space
G2
Circular interpolation, clockwise
Clockwise arc motion about a center point to an end point
G3
Circular interpolation, counter clockwise
Counter clockwise arc motion about a center point to an end point
G9
Exact stop check (non-modal)
Placed before a motion group command, the machine will come to a complete stop at end of the move before continuing to the next. Only remains active for one line.
G17
XY plane selection
G2/3 commands happen on the XY plane (Default mode)
G18
ZX plane selection
G2/3 commands happen on the ZX plane
G19
YZ plane selection
G2/3 commands happen on the YZ plane
G20
Programming in inches (in)
Distances after this command will be interpreted as inches
G21
Programming in millimeters (mm)
Distances after this command will be interpreted as mm
G54-59
Work Offset
Applies a pre-configured XYZ offset relative to home(origin) to all motions.
G61
Exact Stop Check (modal)
The machine will come to a complete stop at end of the move before continuing to the next for all future moves until G64 is called.
G64
Cancel Exact Stop
Reset to default cutting mode (cancel G61)
G90
Absolute programming
Distances after this command will be interpreted as absolute (relative to origin 0,0,0)
G91
Incremental programming (relative)
Distances after this command will be interpreted as incremental (relative to current position at start of move)
G92
Coordinate System Offset
Sets the current (absolute) position to have the specified coordinate values by moving the origin.

M-Code Support

Currently, M-codes are supported by calling a user-defined callback associated with a specific M-code (M#). In a G-Code file, when the M-code is executed, it completes the motion preceding it, executes the callback, and then continues the motion in the remainder of the file.

Not Yet Supported

Helical G2/3 motions Features not listed above
Last modified 1mo ago