Data Collection

Use Case #01

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.

The Challenge:

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.

MAnufacturing industry Unified Namespace Coreflux

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”.

UNS schematics

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.

The Coreflux Hub is free to download and use

It lets you install a local broker, which is also free to use.

Connect to it and inside we'll install an asset.

Coreflux Hub - Local Broker
Flux Asset Store

  

Go into the Flux Asset Store, find the one we want and install it.

We're looking for the S7 asset. 

Check some more details here. 

  

Asset installed

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"

Asset config part I

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.

Asset config part II

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.

Asset tags part I
UNS in MQTT Explorer

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"

Next step: Configuration of the storage.

This example was created in Microsoft SQL. 

It's a local database according to our Unified Name Space.

Database in MSSQL

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.

Installing the MSSQL Asset

  

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.

Some more information about this asset here.

  

2nd Asset installed

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.

Asset config part III

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

Asset tags part II
Press this button. We dare you.

Press play to start the Asset.

Success

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: 

Get the S7 + MSSQL assets for free by joining the Coreflux Discord. 

Just go to the Vouchers-and-Deals channel and tell us you read this Use Case article. 

You’re welcome.

This is not a joke.

  

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.  

Thirsty for more Confidential info?
More news
Home Page
Video content
Community
     
Built with