Function nodes in Node-RED were designed to process messages as single entities. However, in some cases your functions might depend on two separate data sources. There are many ways to handle multiple inputs to a function node. This example shows one approach based on context data.
Continue reading “Node-RED: Lecture 6 – Example 6.7 Multiple inputs to a function node”Tag: context
Node-RED: Lecture 6 – Example 6.4 Using the context element to share a function and make it accessible to all functions in the canvas
This example shows how to use the context object and its global element to share data across function nodes. Continue reading “Node-RED: Lecture 6 – Example 6.4 Using the context element to share a function and make it accessible to all functions in the canvas”
Node-RED: Lecture 6 – Example 6.3 Using context to generate rolling averages
A special module called context, used to store data between function invocations, is available to function nodes. This can be useful when the function needs to retain state to do its processing. For example, in a typical Industrial IoT scenario, Continue reading “Node-RED: Lecture 6 – Example 6.3 Using context to generate rolling averages”