start_code()

Immediately starts executing a G-code program provided as a string.

Syntax

planetcnc.start_code(gcode)

Parameters

Parameter Type Description
gcode str A string that contains the G-code commands to be started.

Return Value

Examples

#! /usr/bin/env python 
 
# G-code commands as a string.
gcode_commands = "G00 X0 Y0\nG01 X100 Y100\nM03"
# Start executing the G-code commands immediately.
if planetcnc.start_code(gcode_commands):
    print("G-code program execution started successfully.")
else:
    print("Failed to start G-code program execution.")

See also

open_file
open_code
start_file
start_code
test_file
test_code