Cloud-based Data Logging Monitoring and...

Preview:

Citation preview

Cloud-basedDataLogging,MonitoringandAnalysis

Hans-PetterHalvorsen,M.Sc.

MeasurementSystem

Industry4.0,InternetofThings(IoT),CloudComputing

UsingWindowsAzure,SQLServer,LabVIEWandVisualStudio/C#

SystemOverview

DatabaseData

LoggingData

Monitoring

Sensors

PC,Arduino, RaspberryPi,…

PC,Tablet,Smartphone, …

Server

SystemOverviewDataLogging DataMonitoring

DAQ

Database

Trigger(s)

CalculateAverage,Max,MinTemperatureDataConvertTemperaturetoFahrenheit

StoredProcedure(s)

Viewsand/orStoredProcedure(s)

DAQmxDriver

DataAnalysis

CloudHostingandServices

Hans-PetterHalvorsen,M.Sc.

TheCloud

CloudHosting

TheyrentCloudbasedserviceslikeVirtualMachines(ComputerswithOSrunning intheCloud),WebServer,DatabaseSystemstoCustomersbasedonMonthlyFees

WindowsAzure

Hans-PetterHalvorsen,M.Sc.

WindowsAzure

SQLDatabases

VirtualMachines

CloudServices App

Services

Storage

“WindowsrunningintheCloud”

CreateSQLServerDatabaseinWindowsAzure

WindowsAzureDatabase

SystemOverview

DataLogging DataMonitoring

DAQ

DAQmxDriver

TheCloud

DataAnalysis Trigger(s)

SQLServer

Hans-PetterHalvorsen,M.Sc.

DatabaseImplementationandStructuredQueryLanguage(SQL)

WindowsAzureDatabase

Database

ConnecttoWindowsAzureDatabasefromLocalComputer

DataloggingusingLabVIEW

Hans-PetterHalvorsen,M.Sc.

DataloggingusingLabVIEW

MicrosoftSQLServerDatabase

TC-01Thermocouple

DAQ

Triggers

CalculateAverage,Max,MinTemperatureData

ConvertTemperaturetoCelsius/Fahrenheit

StoredProcedure(s)andTriggersinSQLServer

Data

TheCloud

LabVIEWHMIExample

TemperatureData:30

Exit

0

DataloggingApp

TheTemperatureDatafromtheTC-01DAQdeviceshouldbestoredintheDatabase.

Chart

Chart

Button

Time

SensorName MeasurementValue

DataMonitoringusingVisualStudio/C#

Hans-PetterHalvorsen,M.Sc.

DataMonitoringusingVisualStudio/C#

MicrosoftSQLServerDatabase Data

TheCloud

VisualStudioHMIExample

Date&Time Value[C] Value[F]2016.03.2214:45 22 71.6

... ... ...

... ... ...

... ... ...

TemperatureData:

0

30

DataMonitoring App

Average:

Min:

Max:

22

10

26

YoushouldgettheDatafromtheDatabase

TextBoxesLabels

DataGridView

Chart

TypicallyyougetDatafromtheDatabaseusingViewsand/orStoredProcedures

Time

WebServices

Hans-PetterHalvorsen,M.Sc.

Problem

ClientsDatabase

HowtoShareDatabetweenDevicesinaNetwork?

DirectConnectionbetweentheDatabaseandtheClientsthatneedtheDataisnormallynotpossible,duetosecurity,compatibilityissues,etc.(Firewalls,HackerAttacks,etc.)DirectConnectioninaLocalNetwork(behindtheFirewall)isnormallyOK– butnotovertheInternet!!

Solution:WebService

WebServiceInternet

HTTPClients

WebServicesusesstandardWebProtocolslikeHTTP,etc.HTTPissupportedbyallWebBrowser,ServersandmanyProgrammingLanguages

Database

NoProblemswithFirewalls

IfyouhaveaccesstotheWeb,youwillhaveaccesstoyourData

WebServices• AWebserviceisamethodofcommunicationsbetweentwo

devicesovertheWorldWideWeb.• WebAPI• StandarddefinedbyW3C• Cross-platform• WebServicescanbeimplementedandusedinmost

ProgrammingLanguages(C#/ASP.NET,PHP,LabVIEW,Objective-C,Java,...)

• UsesstandardWebTechnologyandWebProtocols– HTTP,REST,SOAP,XML,WSDL,JSON,...

WebServiceArchitectureExample

http://blogs.msdn.com/b/martinkearn/archive/2015/01/05/introduction-to-rest-and-net-web-api.aspx

EachappusesthesameAPItoget,updateandmanipulatedata.Allappshavefeatureparityandwhenyouneedtomakeachangeyoujustmakeitinoneplaceinlinewiththe‘Don’tRepeatYourself’(DRY)principleofsoftwaredevelopment.TheappsthemselvesthenbecomerelativelylightweightUIlayers.

WebServiceAPI

Server(s)Clients

SystemOverview

DataLogging DataMonitoring

DAQ

Database

DAQmxDriverWebService

BusinessLogic

DataLogic

TheCloud

WebServicesrunninginWindowsAzure

InWindowsAzureyoucanDeploy• WebSites• WebServicesetc.=>AppServices

CreateAppServicefromAzurePortal

Hans-PetterHalvorsen,M.Sc.

UniversityCollegeofSoutheastNorwaywww.usn.no

E-mail:hans.p.halvorsen@hit.noBlog:http://home.hit.no/~hansha/

Recommended