Follow SIMATIC_IOT2050_Setting_up.md for the following steps:
- Installing the SD-Card Example Image (in this example the image V1.2.1 was used)
- First commissioning of the SIMATIC IOT2050: Remote access with Putty SSH Connection
- Working internet connection on the IOT2050 (only necessary if not all required packages in Node-Red are installed)
The following illustrations show the complete Node-RED flow needed to read data from the PLC using S7 communication, Modbus TCP and OPC UA. In addition, the flow contains all components to create an OPC-UA server, to build a server structure and to store the read variables in it.
On the Example Image V1.2.1 (used in this manual) Node-Red is already preinstalled and autostart is enabled. To access it, open a browser on your PC connected to the IOT2050 and open the URL http://<IP of the IOT2050>:1880/
.
For the application some packages are required:
- node-red-contrib-s7 (V 3.0.0)
- node-red-contrib-modbus (V 5.14.1)
- node-red-contrib-opcua (V 0.2.265)
The packages are already installed on the Example Image V1.2.1. If not, they can be installed as follows: Open a browser on your PC connected to the IOT2050 and open the URL http://<IP of the IOT2050>:1880/
.
Menu -> Manage palette -> Switch to the tab "Install" -> Search for the package -> Click install
The "node-red-contrib-opcua"-package must be updated to the version 0.2.265. To do this, open a Putty connection and use the following command:
npm install -g [email protected]
You should see the following packages in the "Manage Palette"-Menu:
Download the ready-made JSON-FIle: IOTDataCollectorOPCUA-Flow.json
Import the flow:
Menu -> Import -> Select a file to import -> Press the Import-Button
If you used other network settings for the PLC, these must be adjusted in the following nodes:
The server settings for the local OPC UA Server (on the IOT2050) are set to localhost by default.
To implement changes press the deploy-button in the upper right corner.
After completing all settings press the "Deploy"-Button in the upper right corner.The flow now starts to read data from the PLC and tries to write them to the created OPC UA server. For this, the architecture of the server must be created (This must be done every time the flow or the server is restarted.): Press the inject button and wait a few seconds (If the debug output is activated, the following messages are displayed).
The following processes are now running in the background:
The process is running step-by-step through the three subflows "Modbus", "S7" and "OPC UA" until the whole structure is built. The structure can be viewed under Using UaExpert for monitoring. Afterwards, the values read from the local OPC UA server on the IOT2050 should be successfully displayed in the debug window.
This part is optional. With the help of UaExpert the server structure and the stored values of the OPC UA Server can be monitored live.
Download UaExpert here (in our example version V1.5.1 was used).
Complete all settings, start the OPC UA Server and create the structure of the server. Open UaExpert and create a new connection:
Accept the server certificate:
After a successful connection, the individual nodes can be dragged into the Data Access View with the mouse and viewed live there: