Custom Status Response via MCODE?
-
Hello,
The machine status returns the following based on the current machine state.status: I=idle, P=printing from SD card, S=stopped (i.e. needs a reset), C=running config file (i.e starting up), A=paused, D=pausing, R=resuming from a pause, B=busy (e.g. running a macro), F=performing firmware update
Is there a method to provide a custom state based on a MCODE? or can we change the status to a different state using a MCODE?
I am pulling data from a JSON request and when the code steps through subsequent MACROS, I'd like to be able to identify based on the MACRO running. The "P" status is too generic to know what is running.
-
@tmreith you could use a global variable to represent an extension of the state and change it using "set global" commands.
-
@dc42 Thanks David.
Would the global variable value be visible within the JSON response? -
@tmreith you can use M409 to get a JSON like response form the OM. if you use a global variable it will be under the "global" key:
M409 K"global"
-
@T3P3Tony Works great! Thanks for the suggestions.
-
@tmreith The status values you provided are defined by the Marlin firmware and are used to indicate the current state of the 3D printer. Unfortunately, there is no way to provide a custom state based on an MCODE or to change the status to a different state using an MCODE. The status values are hard-coded into the firmware and cannot be modified through G-code commands.