Examples for Node-RED
112/258
10 Examples for Node-RED
The following sections describe examples for data flows.
10.1 Example 1: Inject and debug node
This example shows a simple flow with an inject node (input node) and a
debug node (output node).
The inject node allows you to insert messages into a flow, either by clicking
once a button at the node or regularly by using a time interval between the
sending of two messages.
The debug node allows you to display any messages (or the entire
message object) in the sidebar. When the default settings of the debug
node are used, the payload of the message will be displayed only.
Prerequisites
1. A connection with the Edge Gateway is established (see section
the web browser to establish a connection with the Edge
Gateway
page 18]).
2. The Node-RED workspace is open.
Step-by-step instructions
1. Inserting an inject node:
Ø
Drag an
inject
node from the node library and drop it in the worksheet.
2. Showing the sidebar:
Ø
Show the sidebar with the key combination
Ctrl+spacebar
or via the
Node-RED menu
View
>
Show Sidebar
.
Ø
Click the tab
Info
.
Ø
Click the
inject
node to show its properties and function description in
the tab
Info
.
3. Inserting a debug node:
Ø
Drag a
debug
node from the node library and drop it in the worksheet.
4. Connecting the nodes
Ø
To connect
inject
node and
debug
node, hold down the left mouse
button and draw a connecting line (wire) from the output port of the
inject
node to the input port of the
debug
node.
ð
The inject node can send messages to the debug node.
Edge Gateway | NIOT-E-TPI51-EN-RE (Connect)
DOC170502UM04EN | Revision 4 | English | 2018-08 | Released | Public
© Hilscher 2017 – 2018