All Duet software projects (RepRapFirmware, Duet Software Framework) provide a central 'Object Model' (OM) that replicates the entire machine state, storing configuration and sensor data. This data model is synchronized with Duet Web Control as well as stored in its backend, and can be accessed by Gcode and meta Gcode commands, macros and external data requests. This allows for powerful control and feedback systems to be built.
For information about the object model structure, check out the DSF code documentation.
For a list of the currently-supported fields, see Object Model documentation
Use the Object Model plugin to browse the Object Model tree. Enable the plugin in DWC > Settings > Plugins, and it will appear in DWC > Plugins > Object Model.
Examples of Gcode using Object Model fields are on the Meta Gcode page here.
Query the OM from external applications using M409 or the HTTP request rr_model.
When a job runs, RepRapFirmware extracts information from the Gcode file and stores it in the Object Model. This data can be used using Gcode and Meta Gcode to, for example, determine any additional actions that need to be taken.
A list of the information gathered is here, and includes (not an exhaustive list):
Additionally, from RepRapFirmware 3.6.0, user-defined Object Model keys and values can be embedded in the Gcode file, which will be created in the OM when the Gcode file is run:
;customInfo <key>=<value>
<key>
is an identifier and <value>
is an expression. Such comments will result in the specified key-value pairs being added to the object model under job.file.customInfo. They are also returned as additional information in the rr_fileinfo response. The M36 response now includes any customInfo found in the GCode file (although there is a known issue with this feature, see 1096)Some fields may not be available in standalone mode because some fields are only maintained by DSF and/or DWC. It is advised to consider this when developing applications that address Duets in standalone and SBC mode.
Certain fields have class names in braces (...) appended to the object model path. These class names are present for items where different item types may be configured. If a class inherits values from a base type, the inheritance is marked using a colon (:) followed by the base class name. So, for example, LaserFilamentMonitor : FilamentMonitor means that a LaserFilamentMonitor inherits all the properties from the FilamentMonitor base class.
In standalone mode, each main key (like boards or heat) has its own sequence number in the seqs key which is not documented here. Whenever a non-live field is updated (see M409 F"f"), this sequence number is increased. For clients targeting standalone mode, it can be helpful to check these values to determine when it is time to request a full key from RRF again. There is an extra value seqs.reply as well which is used notify clients about new messages (see rr_reply). Note that these sequence numbers are not exposed in SBC mode.