Creation of Node-RED
Node-RED is a flexible tool that can be run either directly on an edge device (ServiceRouter V3, ER1601) or as a standalone service in the cloud (ServiceRouter Compact). It enables data (measured values, messages, alarms) to be retrieved from a PLC and the data to be pushed to m2v Plattform.
Prerequisites
- Access to the Settings App
Node-RED-Flow
A node-RED flow is a collection of nodes that are connected to each other to perform a specific task. In this context, a flow is automatically generated by the m2v Plattform when a request is made. The generation is based on the machines that are connected to the router in the m2v.
Generation of a Node-RED flow
The request to generate a Node-RED flow can be made in two ways:
-
directly via the router's web interface for the edge device. To do this, the user must access the router web interface and make the corresponding settings.
-
via the service in the m2v. In this case, the user must access the m2v Plattform and make the request there.
- click on the entry "Node-RED : " in the navigation menu
- select the Node-RED you want to generate from the list and click on " Generate Node-RED"
In both cases, the flow is generated automatically and is ready for use as soon as the request has been processed.
Router comparisons
It is important to note that the m2v service (ServiceRouter Compact) can only retrieve data from the PLC if there is a VPN connection. It is therefore recommended to use Node-RED on the edge device with a ServiceRouter V3, or an ER1601.
Here is a comparison of the two ServiceRouters:
| Feature | ServiceRouter V3 | ER1601 | ServiceRouter Compact |
|---|---|---|---|
| Node-RED on the device | Yes | Yes | No |
| VPN connection required | No | No | Yes |
| Automatic flow generation | Yes | Yes | Yes |
Every ServiceRouter V3 is delivered with an active Node-RED instance as standard. As a basic requirement for use, a router with the corresponding MAC address of the ServiceRouter must already be registered in the m2v.
The MAC address of the ServiceRouter can be viewed in the user interface of the ServiceRouter under the menu item "Status logs" → "Network".
Node-REDs can be configured via the router user interface under "Devices" → "Node-RED". To obtain the configuration from the m2v Plattform, the corresponding URL (only the domain, without https://) must be entered under "Get Node-RED configuration from server".
To be able to send data to the m2v via a ServiceRouter Compact, the following requirements must be met:
- the ServiceRouter Compact must have a VPN connection.
- a router of type SR Compact must be created in the Settings app. The "Create Node-RED" option must be activated. When the router is created, a Node-RED instance is automatically generated for the corresponding router.
- a certificate for the same service network must also be uploaded in the Node-RED instance on the m2v. This can be done in the Settings app in the navigation menu under Node-RED on the corresponding line by clicking on "".