<div style={{float: ‘left’, paddingRight: ‘40px’}}>10 minutes to read
This tutorial shows how you can stream sensor data into StreamPipes from a simulation environment (Factory I/O). The simulation environment is controlled by a “Siemens S7-1200” PLC and shows a conveyor belt which sorts packages by their height. The tutorial is based on the upcoming version 0.70.0 and teaches you how to load the sensor data, build a pipeline, preprocess the data and create visualizations.
<img class=“blog-image” style={{maxWidth: ‘75%’}} src=“/img/blog/2022-09-05/plc.jpg” alt=“plc”/>
Factory I/O is a 3D simulation for virtual factories and is commonly used as a PLC training platform. We will need it to simulate the live data.
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/factory.io.png” alt=“dataView”/>
The next step is to connect the PLC to StreamPipes. To achieve this we need to create an adapter.
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/adapter1.png” alt=“adapter1”/>
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/adapter2.png” alt=“adapter2”/>
?
symbol in the connect menu and clicking on VALUES to see a live preview).<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/adapter3.png” alt=“adapter3”/>
A dashboard is used to monitor live data from a data stream. We will use it to make sure that the sensor values are updated when the simulation runs.
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/dashboard1.png” alt=“dashboard1”/>
The Data View is used to create visualization for persisted data in a Data Lake. You can choose various visualization to explore your data. We will create a table to see the stored data and a bar chart to take a closer look at a single sensor.
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/dataView1.png” alt=“dataView1”/>
+
symbol on the top left to add a new widget.<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/dataView2.png” alt=“dataView2”/>
The next step is to change the pipeline to add some preproccessing steps. We want to count the number of large packages which get transported to the right side and we want to measure the time between two arriving packages.
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/pipeline.png” alt=“pipeline”/>
After we created two new data field in the last step, we will monitor them in the dashboard.
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/dashboard2.png” alt=“dashboard2”/>
Finally we want to improve the Data Explorer and create visualizations with the preprocessed data. We will create a time series to verify when a new package arrived and a heat map to check the time between two packages.
<img className=“blog-image” style={{maxWidth: ‘90%’}} src=“/img/blog/2022-09-05/dataView3.png” alt=“dataView3”/>
In this tutorial we learned how to connect a PLC to StreamPipes, monitor the data stream with a dashboard, create a pipeline with different preprocessing steps and visualize the data in the Data View. But we just focused on the basics, so feel free to try out your own ideas and use different preprocessing steps, create new visualizations or try out another simulation environment.
Runtime Name,Path,Data Type,Node Name,Comment,Hmi Visible,Hmi Accessible,Hmi Writeable,Typeobject ID,Version ID I_High_sensor,Tag table_1,Bool,%I0.0,,True,True,True,, I_Low_sensor,Tag table_1,Bool,%I0.1,,True,True,True,, I_Pallet_sensor,Tag table_1,Bool,%I0.2,,True,True,True,, I_Loaded,Tag table_1,Bool,%I0.3,,True,True,True,, I_At_left_entry,Tag table_1,Bool,%I0.4,,True,True,True,, I_At_left_exit,Tag table_1,Bool,%I0.5,,True,True,True,, I_At_right_entry,Tag table_1,Bool,%I0.6,,True,True,True,, I_At_right_exit,Tag table_1,Bool,%I0.7,,True,True,True,, O_Conveyor_entry,Tag table_1,Bool,%Q0.0,,True,True,True,, O_Load,Tag table_1,Bool,%Q0.1,,True,True,True,, O_Unload,Tag table_1,Bool,%Q0.2,,True,True,True,, O_Transf_left,Tag table_1,Bool,%Q0.3,,True,True,True,, O_Tranf_right,Tag table_1,Bool,%Q0.4,,True,True,True,, O_Conveyor_left,Tag table_1,Bool,%Q0.5,,True,True,True,,