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

    Error: unknown variable 'global.magprobestatus'

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    3
    191
    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.
    • thaug29undefined
      thaug29
      last edited by

      I am trying to run this macro but I keep getting the error unknown variable. This is a Duet 3 6HC with SBC, what am I doing wrong.

      if sensors.probes[0].value[0] = 0
      set global.magprobestatus = "attached"
      elif sensors.probes[0].value[0] > 500
      set global.magprobestatus = "docked"

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

        @thaug29 said in Error: unknown variable 'global.magprobestatus':

        I am trying to run this macro but I keep getting the error unknown variable. This is a Duet 3 6HC with SBC, what am I doing wrong.

        if sensors.probes[0].value[0] = 0
        set global.magprobestatus = "attached"
        elif sensors.probes[0].value[0] > 500
        set global.magprobestatus = "docked"

        You have to create a variable before you can refer to it with a set command.

        To create the variable you would use something like:

        global magprobestatus = "unknown"

        That is not a typo, there is no period, there is one space.

        I create my globals in config.g.

        Frederick

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

        thaug29undefined 1 Reply Last reply Reply Quote 0
        • thaug29undefined
          thaug29 @fcwilt
          last edited by

          @fcwilt said in Error: unknown variable 'global.magprobestatus':

          global magprobestatus = "unknown"

          Thanks You, that did it!

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA