Solved Error while using meta commands
-
I am trying to use meta commands in my Gcode. I have a global variable "printing" declared in my config file like so.
global printing = 0Within my Gcode, when a certain condition is met, I change its value to 1. So it acts as a switch. In my Gcode I have this line in several places.
set global.printing=1
Or
set global.printing=0When I run the prints, I get this error:
Error: in GCode file line 83 column 5: meta command: expected a global or local variable
Cancelled printing file 0:/gcodes/RIP_10x10x40_layer ht 0.11_wd 0.6_break det test.gcode, print time was 0h 0mLine 83 is the first place where the variable appears in my Gcode file.
I can go to the console and type set global.printing=1 to change the value of the variable and it works fine, but when I use the same line in my Gcode file, it gives me this error. Can someone help me with this please? Thank you!
-
-
@fcwilt here is the actual code
;FLAVOR:Marlin
;TIME:1263
;Filament used: 1.51671m
;Layer height: 0.11
;MINX:1.425
;MINY:2.115
;MINZ:0.11
;MAXX:10.425
;MAXY:11.115
;MAXZ:39.93
;Generated with Cura_SteamEngine 4.7.1
G90;LAYER_COUNT:363
M3 S1000 P0
G4 P300
M5
G4 P500
;LAYER:0
M107
;MESH:10x10x40.STL
G1 Z1.11 F750
G1 A74.55 F19800
M3 S1000 P0
G4 P300
M5
G4 P500
set global.printing=0
G0 X9.825 Y2.715 F990
;distance from (0.0000, 0.0000) = 10.1932
;total distance moved = 0.0000
M3 S1000 P0
G4 P300
M5
G4 P500
G1 Z0.1100 F750;TYPE:WALL-INNER
G1 Z1.11 F750
set global printing=1
G1 A0 F19800
G1 X9.825 Y3.69 F990
;distance from (9.8250, 2.7150) = 0.9750
;total distance moved = 0.9750
G1 Z0.1100 F750
G1 Z1.11 F750
G1 A0 F19800
G1 X9.825 Y4.665 F990
;distance from (9.8250, 3.6900) = 0.9750
;total distance moved = 1.9500
G1 Z0.1100 F750
G1 Z1.11 F750
G1 A0 F19800
G1 X9.825 Y5.64 F990
;distance from (9.8250, 4.6650) = 0.9750
;total distance moved = 2.9250
G1 Z0.1100 F750
G1 Z1.11 F750
G1 A0 F19800 -
-
@fcwilt Of course! That was embarrassing. Thanks a lot for your help.
-
-