Why not just use the screen button to set soft limits?
There is no G code or specific M code.
You could create a Macro, include it as part of the Initialization String. Could also then use the macro
in start of any gcode file.
For the mill screen Soft limit Image button is OEMButton 119 and the LED is OEM Code 23.
Also from a list additional button codes are 1029 and also 13000.So I guess one could check the soft limit state
and then use DoButton ( ) or Do OEMButton () to turn soft limits on if off with the macro.
RICH