G-code output
Save profile-specific output and understand the standalone CLI export path.
Beam Bench generates G-code for supporting controllers. Other adapters, such as Ruida and the original xTool M1, use their own machine formats for jobs. A generic G-code file is not interchangeable with those formats.
Export from the app
Use Save GCode in Laser Control when available, or Laser Tools > Save Machine Files. Select the intended machine profile first, even when exporting without a connected machine.
The app validates planning failures, raster travel, and workspace bounds before writing the destination. If export is blocked, fix the reported geometry or placement and refresh the plan. It does not write a partial replacement file for a rejected plan.
Placement follows Start From and Job Origin. Connection-dependent modes need valid position information. Rotary export requires connected GRBL-family support and Current Position placement.
What the file contains
The output includes coordinate setup, laser-off travel, linear cutting or engraving moves, feed and power values, and configured air-assist commands. The machine profile can add start and end commands and select constant or dynamic laser power.
Typical GRBL commands include:
| Command | Meaning |
|---|---|
G0 | Rapid positioning. The controller determines rapid speed. |
G1 | Linear motion at the commanded feed rate. |
G21 | Millimeter units. |
G90 / G91 | Absolute or relative coordinates. |
M3 / M4 | Constant or dynamic laser power mode. |
M5 | Laser off. |
S | Power value scaled to the configured S-value maximum. |
F | Feed rate. GRBL output normally uses millimeters per minute. |
M7 / M8 / M9 | Configured coolant or air-assist commands. |
Normal job placement translates the planned geometry. It does not add a G92 coordinate reset. Custom start or end commands can change controller behavior, so verify them for the target machine.
Standalone CLI export
beambench-cli export gcode /abs/path/project.lzrproj /abs/path/out.gcodeThis command loads the project directly and works without the app or API server. It uses the locally saved profile assigned to the project, or the saved active profile when none is assigned. Missing profiles block export. Power scaling, output configuration, and plan validation use the same generation code as Save GCode in the app.
The CLI has no live machine position. Current Position and rotary jobs require export through the connected app; User Origin requires a saved origin. Empty jobs, failed operations, and motion outside the machine workspace are rejected before writing output. Always inspect generated output for the intended controller before running it in another sender.