Welcome to the first Coreflux Use Case.
Since we develop software solutions for the Industry 4.0 paradigm, it’s only fitting that we debut the Coreflux Use Cases with the most basic topic of IIoT: Data Collection.
Read on or watch below for a special offer in the end.
Every manufacturer wants to increase their own production and quality. In order to achieve this, they need data and data analysis. In this Use Case, we're going to:
Connect a local PLC controller and store its data
Base it on a Unified Name Space architecture (a vanilla version)
Keep this data in a local database.
From there, it's possible to analyze the production output.
We’re using a simple Siemens S7 1200 that is simulating some production.
Each time we get a green light it's an unit output of simulated production, like filling bottles.
For the Unified Name Space we have:
the location, in this case "Plant1"
the Area is "Filling"
the Machine ID is "Line1"
the data we want to gather. In this case, it's the production of a “new bottle”.
For that end, in the “Line1” we're simulating a Siemens PLC with an S7-1200.
And for simulating the production of the new bottle, we're gathering the Output Q0.1.
All good? Let's dive in.
It lets you install a local broker, which is also free to use.
Go into the Flux Asset Store, find the one we want and install it.
We're looking for the S7 asset.
Give it a proper name. In this case it's "Line1_S7Connection".
Click the "options" button to change its configuration:
Choose an Anonymous connection.
Change the Debug Topic according to our Unified Name Space. So "Plant1/Filling/Line1/Debug"
Now for PLC parameters:
Fill in its location,
Check if everything else is correct, like the "ConnectionResource"
Keep the Restart Policy as "Always"
Save Configuration.
Now click on Tags:
First variable is "NewBottle"
Use the Unified Name Space for the MQTT Topic, so "Plant1/Filling/Line1/Production/NewBottle"
Keep it simple on the QoS
Variable Type is a Boolean, located on Output Q0.1
And Save the Tag.
Now we can check if the Topic is published in our Broker, on MQTT Explorer.
And here it is:
We have the Debug Topic for that line and the Production.
So far, everything is set-up correctly.
Plant1, Filling, Line1, then the Debug Topic associated with the proper machine, then Production and the Status of the Output changing from "True" to "False"
This example was created in Microsoft SQL.
It's a local database according to our Unified Name Space.
We have "Plant1" and then Production Data with the table and its fields for Identification, the time - that we are going to define as UTC - the Plant ID, the Area, the Machine and the State of the production that we are receiving.
Let's go back to Coreflux and integrate the respective Microsoft SQL asset.
Go into the Asset Store again, find the MSSQL Asset and install it.
And now let's configure it, starting with the name: Line1_MSSQLConnection
Configuration:
Start with the local connection of the broker.
Define a proper Debug Topic "Plant1/Filling/Line1/debugMSSQL"
For the database, define the location too. It's called "Plant1"
Then Username and Password.
Set the Restart Policy as Always.
Save Configuration.
Tags:
Name it “NewBottle”
Now, copy and paste the MQTT Trigger Topic that we defined for our PLC. This trigger sends the Event to the database.
We're not retrieving data from the Database, so you can keep the Feedback Topic empty.
In the Query, we're going to type "INSERT INTO ProductionData", followed by the fields for time, plant, area, machine and State. Make sure this is formatted correctly, it should look something like this INSERT INTO ProductionData (time,Plant,Area,Machine,State) VALUES ({utc},'Plant1','Filling','Line1','{value}');
The identification of the table is "auto-increase" so we don't need to worry about it.
Time will be "utc"
The plant is "Plant1", area is "Filling", machine is "Line1"
And then the value for the state True/False we want to gather.
Save Tag
Press play to start the Asset.
Check for feedback in MQTT Explorer, and check the database.
As you can see, Events are being registered in real time, each time that the variable is changing from "false" to "true" and back.
This simple example allows you to check if the machine is stopped, for how long it stopped, so that you can start to check its availability, and lets you begin to process the information that is relevant to your integration.
Hopefully you found this valuable, whether you're taking the first steps in IIoT or elevating your game to master the Industry 4.0 with Coreflux solutions.
If you read this far, here’s a reward:
Just go to the Vouchers-and-Deals channel and tell us you read this Use Case article.
You’re welcome.
See you in the next Use Case.
_________________________________
Use Case: Data collection and storage using Unified Name Space ( UNS ) for tag management
Target Audience: Manufacture industry, IIoT Integrator and support Engineering
Technology used: Coreflux Edge Broker, Siemens S72MQTT Coreflux asset ( Siemens to MQTT ), MSSQL2MQTT Coreflux asset ( MSSQL to MQTT ), Microsoft SQL Management Studio
Coreflux is on a mission to #democratizeIIoT and empower each human being to extract the maximum potential from the technology they use in their industry.
Visit coreflux.org to power-up your IIoT project.