Skip to content

DSF Intercept

Minty Trebor edited this page Jul 16, 2024 · 7 revisions

DSF-Intercept

DSF-Intercept looks for specially constructed M291 Messages within the Machine Model sent from DSF. A user can embed these M291 messages in the g-code job files or macros which when matched in DSF-Intercept can be used to trigger events in node-red.

For example: By adding an M291 command to the slicers 'colour change' g-code settings, DSF-Intercept can trigger a flow to send an email to an individual to come and action the colour change on the machine.

The M291 command should be formatted as shown below:

M291 R"[command identifier]" P"[command code]"  

Within the configuration of DSF-Intercept the matching "Command Identifier" & "Command Code" should be specified to trigger the node.

EG. The command M291 R"NRCMD" P"Colour Change" would require DSF-Intercept to be configured -
Command Identifier: NRCMD
Command Code: Colour Change

It is possible for Node-Red to automatically acknowledge receipt of the command by issuing the appropriate M292 command using the DSF-Command node. Please refer to the Duet g-code page for the full details on how both these commands can be used.

Configuration

Command Identifier: The M291 R"###" value
Command Code: The M291 P"###" value
When both values match the node will trigger.

Input

The node requires the msg.payload.patchValue in the incoming msg. The node can also optionally accept msg.payload.cmdIdentifier and msg.payload.cmdCode within the incoming msg object. If these values are set in the incoming msg object, they will override any values set in the configuration interface.

Output

The node will pass through the original incoming msg object to the "Intercepted" output when triggered, with the following additional objects:

  • msg.dsf.cmdCode = the value of the matched object.