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

    State saved/restored when a macro runs

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    4
    228
    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.
    • gloomyandyundefined
      gloomyandy
      last edited by

      Does anyone know if the details of what state (if any) is saved and restored when a macro is executed is documented anywhere? I've had a quick look but couldn't find anything.

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @gloomyandy
        last edited by dc42

        @gloomyandy it's these variables from GCodeMachineState:

        	float feedRate;
                uint32_t
        		selectedPlane : 2,
        		drivesRelative : 1,
        		axesRelative : 1,
        		volumetricExtrusion : 1,
        		g53Active : 1,							// true if seen G53 on this line of GCode
        		usingInches : 1,						// true if units are inches not mm
        		macroRestartable : 1,					// true if the current macro has used M98 R1 to say that it can be interrupted and restarted
        		;
        
        	Compatibility compatibility;				// which firmware we are emulating
        	uint8_t commandedQueueNumber;				// the queue number that was most recently commanded on this channel

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        gloomyandyundefined 1 Reply Last reply Reply Quote 0
        • gloomyandyundefined
          gloomyandy @dc42
          last edited by

          @dc42 Thanks David, do any of the "special" macros (like tool change, filament etc.) save/restore anything extra?

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @gloomyandy
            last edited by

            @gloomyandy no, the only special thing about system macros (apart form being invoked automatically) is that they ignore workplace coordinate offsets.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

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