Not loading macro from G-code



  • I hope I just missed something here.
    I have made a macro for the start of the print.

    ; Ready printer and calibrate bed
    M83 			; Set extruder to relative moves
    G21 			; set mm units
    G90 			; set absolute coordinates
    G28 			; Home Machine
    M561 			; Clear any bed transform
    G1 X140 Y117 F8000 	; Go to center of bed
    G1 Z10 F8000 		; Go to 10mm over bed
    G30 			; Probe bed and set Z-height
    G29 			; Run mesh compensation
    M593 F80. 		; Set Dynamic Acceleration Adjustment to 80Hz
    
    ; Extrude anchor
    M703			; Set filament parameters
    G1 X0 Y0 F5000		; Go to home origo
    G92 E0.			; Zero exreuder
    G1 Z0.6			; Move nossle down
    G1 E45. F500 		; Extrude anchor
    G92 E0.			; Zero extruder
    G1 E-1.3 F25		; Retract filament
    G1 Z10.0 F300 		; Move platform down 5mm
    G1 Y20. F3000 		; Move away from the anchor
    M99			; Go back to main program
    

    Wen I run this in console, the macro starts.

     M98 P"0:/macros/start_of_print.g"
    

    But when I have the same command in a program:

    ....
    G90
    M83
    M106 S0
    M140 S60
    M190 S60
    M104 S215 T0
    M109 S215 T0
    
    M98 P"0:/macros/start_of_print.g"
    
    ; process Process1
    ; layer 1, Z = 0.300
    T0
    ; feature skirt
    ; tool H0.300 W0.480
    G1 Z0.300 F120
    .....
    

    The duet returns:

    Warning: Macro file 0 /macros/start_of_print.g not found
    

    Any ideas?

    Board: Duet WiFi 1.02 or later
    Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.01-RC4 (2020-03-16b1)
    Duet WiFi Server Version: 1.23


  • administrators

    It looks like whatever is sending the "program" is stripping out the colon. How are you sending it?

    You could try: M98 P"/macros/start_of_print.g"

    BTW there is already a file "start.g" that gets called automatically at the start of a print from SD card.



  • Okay, so I think the error is not in Duet.
    I was trying to start the print from my Repetier Server attached to the Duet. Seems like there is something getting wrong in the fransfer.
    I think it removes the colon and maybe the quotes?
    When I upload the G-code directly to the duet, it runs fine. 😕



  • @dc42
    Damn! You are so fast at answering in the forum! 😄 I just love it!

    Ahh, so the start.g would be a better place to set the macro then. I will try that.
    Thanks.



  • @dc42
    Turns out I don't have a Start.g in the file system. ... and the cancel.g is just a bunch of HTML? Just got a load of errors when canceling the job.

    Strange because I just flashed the Duet a week ago. Think I need to go over the file system.
    Is the Start.g supposed to be in the system folder?


  • administrators

    @Kryckan said in Not loading macro from G-code:

    Is the Start.g supposed to be in the system folder?

    Yes, in /sys. But it only gets called when you start a print from the SD card, not if you print through Repetier Server.



  • @dc42

    M98 P"/macros/start_of_print.g" works in Repetier Server.

    Thanks.


Log in to reply