Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Solved Error: unknown variable 'global.magprobestatus'

    Gcode meta commands
    2
    3
    75
    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.
    • thaug29
      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"

      fcwilt 1 Reply Last reply Reply Quote 0
      • fcwilt
        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 FT-5 with the 713 upgrade bits. A custom MarkForged style. A small Utilmaker style and a CoreXY from kits. Various hotends. Using Duets (2 and 3) running 3.4.1

        thaug29 1 Reply Last reply Reply Quote 0
        • thaug29
          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