Is it possible to run macros inside the " " of M911?
-
I'm using M911 to monitor the voltage of the PSU and perform a shutdown when necessary.
M911My Duet is duet mini 5 + ,DSF Ver3.4.5
I would like to execute the RasPi shutdown command along with this process.
Does anyone know how to get the Raspberry Pi's shutdown to work with this code?Note: I plan to connect a battery to the Raspberry Pi for short-term UPS purposes using a supercapacitor, allowing it to maintain power for about one minute.
This is the power supply board.I added [M999 B-1 P"OFF"] that can be used with the DuetPi plug-in in the M991 code generated by RRF Configurator.
DuetPi Management PluginM911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000 M999 B-1 P"OFF""
However, when I restart the system, I receive an error in config.g.
I also attempted to create a shutdown macro by including "M999 B-1 P"OFF"" as a separate command, but that didn't work either.
If this can be executed, I think that it can shut down automatically and safely.
Can anyone help me? -
@Nagoya-Kougei if you want to include a double-quote character inside a string parameter, you have to duplicate it. So your command should be:
M911 S19.8 R22.0 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000 M999 B-1 P""OFF"""
In general we don't recommend calling macros within the M911 command string because of the time it may take to read the SD card. However, in your case it may well be OK because you are providing the Pi with backup power for a little while.
-
@dc42 Thank you for teaching me how to write Gcode.
It worked fine and the shutdown was performed!
-
-