M409
Back to the Gcode Dictionary
M409: Query object model
Parameters
- K"key" Key string, default empty
- F"flags" Flags string, default empty
Examples
- M409 K"move.axes" F"f" ; report all frequently-changing properties of all axes
- M409 K"move.axes[0] F"v,n,d4" ; report all properties of the first axis, including values not normally reported, to a maximum depth of 4
- M409 K"move.axes[].homed" ; for all axes, report whether it is homed
- M409 K"#move.axes" ; report the number of axes
- M409 F"v" ; report the whole object model to the default depth
The key string is just the path to the object model variables wanted, with the following extensions:
- An element that is an array may be followed by either [number] to select just one element, or by [] to select all elements and report the results as an array
- The path may be preceded by # in which case the path must refer to an array and just the number of array elements is returned
An empty key string selects the entire object model. Note, the entire object model may be very large, so there is typically insufficient buffer space to construct a JSON response that represents the whole object model. For this reason, RepRapFirmware sets a default maximum depth of 1 if the key string is empty or not present and the 'f' flag is not included in the flags string.
The flags string may include one or more of the following letters:
- f: return only those values in the object model that typically change frequently during a job
- v: Verbose: include values that are rarely needed and not normally returned
- n: include fields with null values
- o: include obsolete fields (v3.3 and newer)
- d: limit the depth of the reported tree to the specified number following the letter d. Objects at the maximum depth will be returned as {}.
The flags string may optionally use spaces or commas to separate the individual flags
The response is a JSON object of the following form:
{"key":"key","flag'":"flags","result":object-value}
If the key string is malformed or refers to a property that does not exist in the object model, the result field is null.
For details of the Object Model supported by RepRapFirmware, see Object Model of RepRapFirmware.
0 Comments