Skip to content

Node: DSF Monitor

Minty Trebor edited this page Jul 7, 2023 · 21 revisions

DSF-Monitor

The DSF-Monitor node is the primary node for establishing the connection between Node-Red and the DCB/DSF.

Typically only one DSF-Monitor node is required for each Machine. It is recommended to connect the output of DSF-Monitor to a Link-Out node (to allow multiple flows to receive the output) , and a Debug Node to help you review & navigate the Object Model.
Recommended Deployment

Setup

Other than name, DSF-Monitor has two parameters:

  • Duet/DSF IP. Change this to the IP address of the Duet Control Board or SBC running DSF by clicking the little pencil icon, which will take you to the connector node properties. Where you can specify:
    * the IP (if you have installed Node-Red on the same SBC as DSF you may use localhost)
    * mode of operation (DSF or Duet)
    * poll rate
    * password
    (the last 2 options normally do not need to be changed from their default values).

  • Auto Start. Check this box to start the monitor node to auto-start polling for information at boot/deployment.

Input

Monitor In
The monitor node checks for payload.monitorState value of ON or OFF to start/stop the node from polling DSF/Duet. Useful in scenarios where monitoring is not required 24/7. (EG. control by Start/Stop buttons on a dashboard)

Output

DSF-Monitor will output the following msg structure every time it receives an update to the Machine Model from DSF.

  • msg.payload.fullModel
  • msg.payload.patchModel
  • msg.payload.prevModel

The combination of objects provides, the complete current state of the machine; - what changed with the machine; - and what the previous machine state was.

msg.payload.fullModel

This object always holds a copy of the full Machine Model which is always up-to date with the latest information.

msg.payload.patchModel

Contains the latest changes to the Machine Model sent by DSF. It is only a fragment of the full Machine Model containing the data that has changed. The patchModel has already been merged into the fullModel object.

msg.payload.prevModel

This object holds the last version of the fullModel prior to receiving the latest update from DSF. It is provided to enable comparative functions within your flows.

RRF Messaging

The text of M117 messages is located in state.displayMessage.
The text of M118 and other console messages (errors etc) is located in state.consoleMessage.

Important

Each DSF-Monitor node you deploy creates a new connection to the DCB/DSF, which consumes additional resources on the DCB/DSF. A single Node-Red instance should only require one DSF-Monitor node to be deployed for each DCB/DSF instance. The inbuilt 'node-out' and 'node-in' nodes in node-red enable a single DSF-Monitor node to be used in multiple flows.