Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Error while using meta commands

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    5
    286
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • anaghundefined
      anagh
      last edited by

      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 = 0

      Within 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=0

      When 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 0m

      Line 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!

      fcwiltundefined 1 Reply Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt @anagh
        last edited by

        @anagh

        We need to see the actual code the is not working for you.

        Frederick

        Printers: a E3D MS/TC setup and a RatRig Hybrid. Using Duet 3 hardware running 3.4.6

        anaghundefined 1 Reply Last reply Reply Quote 0
        • anaghundefined
          anagh @fcwilt
          last edited by

          @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

          fcwiltundefined 1 Reply Last reply Reply Quote 0
          • fcwiltundefined
            fcwilt @anagh
            last edited by

            @anagh

            You have

            set global printing = 1

            instead of

            set global.printing = 1

            Frederick

            Printers: a E3D MS/TC setup and a RatRig Hybrid. Using Duet 3 hardware running 3.4.6

            anaghundefined 1 Reply Last reply Reply Quote 1
            • anaghundefined
              anagh @fcwilt
              last edited by

              @fcwilt Of course! That was embarrassing. Thanks a lot for your help.

              1 Reply Last reply Reply Quote 1
              • dc42undefined dc42 marked this topic as a question
              • dc42undefined dc42 has marked this topic as solved
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA