Use Case #01: Data Collection
Use Case 01 Data Collection | Coreflux Use Cases

Use Case #01: Data Collection

Welcome to the first Coreflux Use Case.?

Since we develop software solutions for the Industry 4.0 paradigm, it’s only fitting that we start with the most basic topic of IIoT: Data Collection.

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.

Integration schematics

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

Get it here

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

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

Flux Asset Store

Give it a proper name. In this case it's "Line1_S7Connection".

Asset installed

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

Now we can check if the Topic is published in our Broker, on MQTT Explorer. And here it is:

UNS in MQTT Explorer

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.

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.

Database in MSSQL

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.

Installing the MSSQL Asset

And now let's configure it, starting with the name: Line1_MSSQLConnection

2nd Asset installed

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 play to start the Asset.

Press this button. We dare you.

Check for feedback in MQTT Explorer, and check the database:

Success!

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



If you're interested in all things IIoT, follow for more:

linkedin.com/company/coreflux/

instagram.com/corefluxiot/

youtube.com/@corefluxiot

reddit.com/r/coreflux/

facebook.com/corefluxiot

coreflux.org


Coreflux, IoT, Innovation, Digital Transformation, iiot platform, iiot, edge, analytics, connectivity, industry 4.0, device management, network management, customer success, iiot, i4.0, documentation, growth, industry, DataHub, Data Pipeline, digital twin, digital twin technology, online broker, cloud broker, mqtt, mqtt broker, online data, mqtt data, cloud database, mqtt, tutorials, Linux, Daemon Service, free trial, online mqtt, cloud mqtt, online mqtt broker, cloud mqtt broker


#Coreflux #IoT #Innovation #DigitalTransformation #iiotplatform #iiot #edge #analytics #connectivity #industry40 #devicemanagement #networkmanagement #customersuccess #iiot #i40 #documentation #growth #industry #DataHub #DataPipeline #digitaltwin #digitaltwintechnology #aicreativity #onlinebroker #cloudbroker #mqtt #mqttbroker #onlinedata #mqttdata #clouddatabase #IoTIntegration #Digitalization #commandline #usecase #datacollection

要查看或添加评论,请登录

Coreflux的更多文章

社区洞察

其他会员也浏览了