OPC Lab - The Technical Guy

1y ago
12 Views
2 Downloads
4.31 MB
105 Pages
Last View : 13d ago
Last Download : 3m ago
Upload by : Aiyana Dorn
Transcription

https://www.halvorsen.blogOPC LabHans-Petter Halvorsen

Contents Introduction to the Lab WorkIntroduction to OPCMatrikon OPC SoftwareTC-01 ThermocoupleOPC DA in LabVIEW– OPC DA Write– OPC DA Read Introduction to OPC UA OPC UA in LabVIEW (LabVIEW OPC UA Toolkit) OPC DA Client Alternatives (Choose one)– Visual Studio Measurement Studio– MATLAB MATLAB OPC Toolbox– Python OC DA in a Network (using OPC Tunneler Software)

OPC Lab OverviewYou can create OPC Servers and Clientsin different Programming Languages,and all should work together if you usethe same OPC SpecificationOPCClientMatrikon OPC bVIEWMeasurement DataPythonOPCClientOPCClientOPCMATLABClientVisual Studio withMeasurement Studio

Lab OverviewOPC UAServerOPC DAServerOPC DAClientOPC DAClientOPC UAOPC DAClientNetworkOPC UAClientOPC UAClientOPC UAClient

Lab Assignment OverviewA.B.C.D.E.F.Read Temperature Data into LabVIEW using NI USB-TC01Thermocouple deviceOPC DA: Send Temperature Data using LabVIEW and send data to OPCServer and use Matrikon OPC Server & Explorer (OPC Client)OPC DA: Read Temperature Data from OPC Server using LabVIEWOPC UA using LabVIEW (OPC UA Server OPC UA Clients)OPC with Visual Studio, MATLAB or Python. Select one of the followingI.II.Trend OPC DA Data using Visual Studio Measurement StudioGet Temperature Data into MATLAB using MATLAB OPC ToolboxIII.Get Temperature Data into PythonOPC Network: Send OPC data between different computers in anetwork using OPC Tunneller Software (voluntary challenge) Make sure to “Add Value” to all the Tasks!See next slides for details.

Learning Goals Learn key concepts within OPCLearn practical skills and implementation of OPCLearn more Programming (LabVIEW, C#, etc.)Learn about Hardware-Software InteractionsLearn Practical Skills and Implementations ingeneral Learn Software Installation in general, which can becumbersome with many pitfalls Learn to use and create Software in general

Lab Assignment This Lab Assignment consists of a mix of Theory,Examples and actual Tasks you should solve. Just follow the Assignment page by page (Step byStep) and do the Tasks insideWhen you see this Symbol, you should do asthe Task description says. But make sure to“Add Value” to these Tasks.

Necessary Software LabVIEW– DAQmx Driver Software– LabVIEW OPC UA Toolkit MatrikonOPC Simulation ServerOther Software Visual Studio– (Measurement Studio) (or MATLAB OPC Toolbox) (OPC Tunneller Software)– OPC Tunneller from MatrikonOPCor– Cogent DataHub Tunnelling SoftwareMake sure to install the necessary Software before you go to the laboratory!Software

OPC Servers In the Assignment there is not important which OPC Server you are using. The Matrikon OPC Simulation Server is widely used as an OPC Server forDevelopment and Test purposes. This alternative is recommended. Other OPC Servers you can use? I found this list on Internet: http://www.opcconnect.com/freesrv.php– From the list above I may recommend (I have not used them myself, but heardpositive things about them) the following: “Cogent OPC DataHub” “KEPServerEX”– These Servers offers a “time-limited” demo - which should be enough in thisassignment. Another alternative may be NI OPC Server - you may already have this– a Demo version is included with LabVIEW DSC Module or LabVIEW Real-Timemodule)– This one can also be downloaded separately (just search for NI OPC Server inGoogle)

HardwareHardwareIf you don't have the Hardware,you may create a Simulatorinstead, or use another Hardwareif you haveNI USB-TC01 Thermocouple Measurement DeviceYour Personal ComputerSwitch

OPC DA Lab Part OverviewOPC ClientTemperature Measurement1LabVIEWRead Temperature DataApp #1Write to OPCUSB-TC01 Thermocouple Measurement Device2Read from OPC3OPC ServerMatrikonOPC Simulation ServerRead from OPC4OPC ClientLabVIEW App #2Visual Studio/MATLAB/PythonOPC ClientApp #3

The teacher have not doneall the Tasks in detail, so hemay not have all theanswers! That's how it is inreal life also!Very often it works on one computer butnot on another. You may have otherversions of the software, you may haveinstalled it in the wrong order, etc.In these cases Google is your best friend!The Teacher dont have all the answers (very few actually )!! Sometimes you just need to “Google” inorder to solve your problems, Collaborate with other Students, etc. Thats how you Learn!

Troubleshooting & DebuggingVisual StudioUse the Debugging Tools in yourProgramming IDE.Visual Studio, LabVIEW, etc. have greatDebugging Tools! Use them!!“Google It”!You probably will find theanswer on the InternetAnother person in the world probablyhad a similar problemMy Systemis notWorking?Use available Resourcessuch as User Guides,Datasheets, Textbooks,Tutorials, Examples,Tips & Tricks, etc.UseMicrosoftTeamsCheck your electric circuit, electrical cables, DAQ device, etc. Check ifthe wires from/to the DAQ device is correct. Are you using the sameI/O Channel in your Software as the wiring suggest? etc.

Lab Assignment Guidelines Make sure to read the whole assignment before you start tosolve any of the problems. If you miss assumptions for solving some of the problems, youmay define proper assumptions yourself. The Tasks described in the Assignment are somewhat looselydefined and more like guidelines, so feel free to interpret theTasks in your own way with a personalized touch. Feel free to Explore! Make sure to Add Value and Creativity toyour Applications! Try to add some extra value and be creative compared to thesimplified examples given by me, in that way you learn somuch more.

Lab Assignment Guidelines Think about the Lab Assignment as a small real-life industrialProject, and not a set of tasks or exercises. What does the company that hire you expect from you whenyou deliver this project? What kind of Quality is expected? Try to see your work in a larger context than just a LabAssignment or a set of exercises. Try to see the big picture. The tasks within the assignmentare just just small building blocks that ends up with a fullyworking system. It is recommended that you make a Work Plan and a SystemSketch that gives you an overview of what YOU should do

Lab Work Requirements Make sure to see the “big picture” – you don’t need to document every single step youhave made. Focus on what’s important.Your GUIs is important! - make sure to make them user friendly and intuitive. You createthis on behalf of someone that are going to use your applications.Make sure to always add units in your GUI, charts, documentation, etc.Presenting values with 4 decimals makes no sense! E.g., a temperature sensor is notthat accurate. You can easily change number of decimals that you present in your GUI inLabVIEW, C#, etc.The quality of the LabVIEW code is important. Make sure to use "straight lines" in yourLabVIEW code, etc. The code should also flow from left to right, not opposite direction.You create this on behalf of someone that are going to use your applications. Neat codemakes it easier to develop, maintain, find code errors, etc.In general, make sure that you take some pride in your applications and the work thatyou do. It's not about getting finished as soon as possible. The mission is to learn asmuch as possible within a given timeframe. Try to change the mindset.To improve the LabVIEW code, please see this video: LabVIEW Applications using StateMachine: https://youtu.be/-b9St8wNhpQ16

Introduction to OPCHans-Petter HalvorsenTable of Contents

What is OPC?Theory OPC - “Open Process Control”/“Open Platform Communications” A standard that defines the communication of data betweendevices from different manufactures Requires an OPC server that communicates with the OPC clients OPC allows “plug-and-play”, gives benefits as reduces installationtime and the opportunity to choose products from differentmanufactures Different standards: “Real-time” data (OPC DA), Historical data(OPC HDA), Alarm & Event data (OPC AE), etc.

TheoryOPCOPC ClientOPC ClientOPC ServerOPC ClientData RepositorySend Data (Write) to OPC Serveror Retrieve Data (Read) from OPC Server

OPC SpecificationsTheory OPC DA (Data Access)The most common OPC specification is OPC DA, which is used to read and write “real-time”data. When vendors refer to OPC generically, they typically mean OPC DA. OPC HDA (Historical Data Access) OPC A & E (Alarms & Events) . (many others)These OPC specification are based on the OLE, COM, and DCOM technologies developed byMicrosoft for the Microsoft Windows operating system family. This makes it complicated tomake it work in a modern Network! Typically you need a Tunneller Software in order to sharethe OPC data in a network (between OPC Servers and Clients) OPC UA (Unified Architecture)OPC UA eliminating the need to use a Microsoft Windows based platform of earlier OPCversions. OPC UA combines the functionality of the existing OPC interfaces with newtechnologies such as XML and Web Services (HTTP, SOAP)

TheoryData AcquisitionPLC, PAC, DCS, SCADAProcess OPC-ClientOPC-ClientOPC-Client

“Next Generation” OPC“Classic” OPC“Next Generation” OPCOPC DAOPC HDAOPC A&E. (Many others)OPC UA

OPC SpecificationsWe will implement and use both in this Assignment“Next Generation” OPC“Classic” OPCOPC DAOPC UAOPC HDAOPC A&E. (Many others)

OPC DAMatrikonOPCSimulation ServerHans-Petter HalvorsenTable of Contents

Matrikon OPC Explorer – Connect to ServerProblems with Matrikon Installation?Try Disabling the Firewall1225

MatrikonOPC Explorer Troubleshooting Problem: “When starting MatrikonOPC Explorer, Iget an error indicating there are no serversinstalled”. Solution:– In OPC Explorer select View - Options from the menubar.– On the General Tab select both OPCEnum and Registry asthe Browse Methods.– Exit OPC Explorer and restart.– Upon restarting, you should see a listing of locallyregistered OPC servers.– If this still does not work, remove OPCEnum as a browsemethod and restart.

Matrikon OPC Explorer - Add Tags4315Finished2Double-clickNote! Use the BucketBrigade Items – because they can be used for both reading and writing

MatrikonOPC Explorer (OPC Client)The MatrikonOPC Explorer is useful for testing. You can use it for writing and reading OPC Tags

AliasesIn the “Matrikon OPCServer for Simulation” you can create Aliases. Aliases is handy whenyou want to describe your OPC items using more realistic names.Students: Create an alias called, e.g., “Temperature” which we will use to write andread the temperature data from our NI USB-TC01 Thermocouple MeasurementDevice. You should use this Alias in the next Tasks.

Congratulations! - You are finished with the Task

TC-01Read Temperature Data using NI USB-TC01Thermocouple deviceHans-Petter HalvorsenTable of Contents

DAQ – Data AcquisitionYour App createdwith LabVIEWTheorySensors, etc.A DAQ System consists of 4 parts:NI TC-01 Thermocouple Device1. Physical input/output signals, sensors2. DAQ device/hardware3. Driver software4. Your software application (Application software)NI DAQmx Driver

Getting Started with TC-01The following window should pop up automatically when you plug in your NI USB-TC01device in your USB port (if not, select “TC01Launcher.exe”):Students: Plug in the device into your USB port and see if this window appears

NI TC-01 Built-in Temperature LoggerBuilt-in Temperature Logger (No Driver or programming needed)Students: Test the Built-in Temperature Logger, Log Data to File, etc.

MAX – Measurement & Automation ExplorerStudents: Make sure that your device can be located in MAX. Run a “Self-Test” anduse the “Test Panels” to make sure the device works properly.

LabVIEW DAQ AssistantWhen you place the DAQAssistant on the BlockDiagram, a Wizardautomatically pops upwhere you configure whatyou want to do, i.e., if youwant to Read or WriteData, Analog or Digitalsignals, which channel youwant to use, etc.

Select Input/Output TypeLabVIEW DAQAssistantSet PropertiesSelect Channel

Read Data from TC-01 DeviceStudents: Create this Example and Run the Program. Improve the program. Add Value!

Not working after you got a new Device?Solution, Alt 1: Open MAX (Measurement & Automation Explorer) in order to Fix-it!1Delete Old Device2New Device3Rename the New Device with thesame Name as the Old one

Not working after you got a new Device?Solution, Alt 2: Change the Settings in the DAQ Assistant in your LabvIEW ApplicationRight-click on the DAQ AssistantRight-click and select “Change Physical Channel”13Select the New Devicein the List and click OK2

Congratulations! - You are finished with the Task

OPC DA in LabVIEWHans-Petter HalvorsenTable of Contents

OPC WriteWrite Temperature Data to the OPC Serverusing LabVIEWOPC DAHans-Petter HalvorsenTable of Contents

OPC DA in LabVIEWYou can use LabVIEW as an OPC client by connecting to an OPCserver through a DataSocket connection.The DataSocket palette in LabVIEW:Write Data to OPCRead Data from OPCBrowse OPCServers and OPCItemsOpen Connectionto OPC ServerClose Connectionto OPC ServerStudents: Use the DataSocket VIs in order to write Temperature Data to the OPC Server

Write to OPC Server using LabVIEWWhile Loop132Or specify URL directly:Use the BucketBrigade Items – because theycan be used for both reading and writingWhile Loop4

Use OPC Explorer to Check CommunicationRun the LabVIEW program and use the MatrikonOPC Explorer to check if the data is correctlywritten to the OPC server from LabVIEW

Temperature Simulator Example If you do not have the TC01 device available, you can create and use aA simple SubVI that simulates a Temperature value using asimple “Temperature Simulator” insteadRandom Generator:While LoopUse e.g., an “Enum”Control (or just a Stringor Numeric Control)Case StructureWhile LoopIn this way you can easily switch betweenthe real Temperature sensor (TC-01) andthe SimulatorCase StructureStudents: Create a “Temperature Simulator”.Here you just see a simple example - feel free tocreate a more realistic Temperature Simulator

How to create an “Enum” in LabVIEW(used in theTemperature SimulatorExample)123546

Convert fromDynamic DataIf your Program crash whensending data to OPC serverfrom DAQ device, makesure to use the “Convertfrom Dynamic Data” block

Congratulations! - You are finished with the Task

OPC ReadRead Temperature Data from the OPC Serverusing LabVIEWOPC DAHans-Petter HalvorsenTable of Contents

Read from OPC Server using LabVIEWWhile Loop12Or specify URL directly:34While LoopStudents: Create a LabVIEW Program that reads Data from the OPC Server

Log Datato FileSimple Example of how to log data toa Measurement File using the “WriteTo Measurement File” function inLabVIEWIn this example we justgenerate some random data.In your case you shall log thedata received from the OPCServerStudents: Save tha data from the OPC Server to a FileYou can turn logging On/Off

Log Data to File - PropertiesRecommended Settings in the Properties Window (Right-click on the Write To MeasurementFile icon):

Measurement File – Data VisualizationOpen the File with Logged Data ine.g. Notepad:Open the File with Logged Data in MS Exceland create a ChartMake sure to format number of Decimals55

SubVI – Scaling from Celsius to FahrenheitTf (9/5)Tc 32Students: Extend you program so it it possible tosee the temperature both in degrees Celcius and indegrees Fahrenheit. You should create a SubVI thatdoes this conversion. Send the data using OPC.Front Panel:Define Input and Output TerminalsBlock Diagram:Create an Icon in the Icon Editor

Congratulations! - You are finished with the Task57

OPC UAOPC Unified ArchitectureThe Next Generation OPCHans-Petter HalvorsenTable of Contents

Next Generation OPCCOM/DCOMXML, HTTP, SOAPOPC ClassicNext Generation OPCOPC DAWindows onlyOPC HDAOPC A&EOPC A&E ServerOPC UAAll specificationsWindows, Linux, Mac,collected in one (DA,Embedded, VxWorksHDA, A&E)Protocols: “UA Binary” or “UA XML”Cross-platformSimpler!!OPC DA ServerOPC HDA ServerTheoryOPC Client(DCOM)OPC UA Server(everything built into one)OPC UA Client

TheoryNext Generation OPCOPC Classic ServerNetworkOPC Classic ClientTo open DCOM through firewalls demanded a large hole in the firewall!Impossible to route over Internet!OPC UA ServerNetwork/InternetOPC UA ClientNo hole in firewall (UA XML) or just a simple needlestick (UA Binary) is necessaryEasy to route over Internet!

Classic OPC vs. OPC UAClassic OPC (DCOM)WindowsOPC ClientWindowsWindowsOPC ServerOPC ClientWindowsOPC ClientTheoryOPC UAThe server (or clients) canbe an embedded system,LINUX, Windows, etc.OPC UA ServerOPC UA ClientOPC UA ClientOPC UA ClientClassic OPC requires a Microsoft Windows operating system to implement COM/DCOM server functionality. By utilizing SOA and Web Services,OPC UA is a platform-independent system that eliminates the previous dependency on a Windows operating system. By utilizing SOAP/XML overHTTP, OPC UA can deploy on a variety of embedded systems regardless of whether the system is a general purpose operating system, such asWindows, or a deterministic real-time operating system.http://www.ni.com/white-paper/13843/en/

OPC UA (Unified Architecture)Theory OPC UA solves problems with standard/classic OPC Works only on Windows Cumbersome to use OPC in a network due to COM/DCOM OPC UA eliminating the need to use a Microsoft Windows basedplatform of earlier OPC versions. OPC UA combines the functionality of the existing OPC interfaceswith new technologies such as XML and Web Services (HTTP,SOAP) Cross-platform No dedicated OPC Server is no longer necessary because theserver can run on an embedded system

OPC UA (Unified Architecture)Theory OPC UA supports two protocols.– “UA Binary” protocol opc.tcp://ServerThis uses a simple binary protocol– “UA XML” protocol http://ServerThis used open standards like XML, SOAP (- Web Service) This is visible to application programmers only viachanges to the URL. Otherwise OPC UA works completely transparent to theAPI.

OPC UA (Unified 3843/en/

OPC UA SecurityTheoryOne of the most important benefits of eliminating the reliance on COM/DCOMtechnology is the expanded security features.[Figure: http://www.ni.com/white-paper/13843/en/] OPC UA requires handshaking between clients and servers using X.509 Web standard certificates forauthentication before they are able to talk with one another.To communicate between the server and client, the user can choose from three kinds of messagingmodes: None, Sign, Sign and Encrypt.OPC UA can communicate through any standard HTTP or UA TCP port. Through this standardization,OPC UA can connect securely over a VPN and through firewalls to allow seamless, remote client-toserver n/

Classic OPC and OPC UA CompatibilityTheoryBecause of the shift in data communication technology, the OPC UA protocol is not inherentlybackwards compatible with Classic OPC data access (DA) models!!Classic OPC COM-based Clients require a UA Proxy to communicate with UA Servers:Classic OPC COM-based Servers require UA Wrappers to interact with UA Clients:http://www.ni.com/white-paper/13843/en/

OPC UA in LabVIEWHans-Petter HalvorsenTable of Contents

OPC UA in 618J-1/TOC9.htmNote! You need to installthe LabVIEW OPC 376230B-01/

TC-01 ThermocoupleOPC UAServerWriteLV App 1ReadLV App 3LV App 2OPC UAClient 1OPC UAClient 2Students: Create an OPC UA Server. Create an OPC UA Client that reads TemperatureData from a TC-01 device and sends them to the OPC UA Server. Create another OPCUA Client that reads the Temperature Data from the OPC UA Server.Make Plots, save Data to File, etc.

OPC UA ServerExample in LabVIEW70

LabVIEW: OPC UA Client - Write Data

LabVIEW: OPC UA Client - Read Data

LabVIEW OPC UA ChallengesVoluntaryOPC UAServerWriteLV App 1ReadNetworkLV App 2OPC UAClient 1OPC UAClient 2LV App 3#1: Students: Change your Apps so you can write and read theTemperature Data both in degrees Celsius and in degrees Fahrenheit#2: Students: Are you able to read Historical Data from the OPCServer and Plot them?#3: Group Work: Install App 1, 2 and 3 on different computers in a Network(e.g., using a Switch) and see if the communication between them works.

VoluntaryOPC UA Clientwith SubscriptionThis is a more complex example whereyou read data on the client only whenthe value on the server is changedStudents: Implement the "Subscription" model in your Application.Right-click in order to create thisStep-by-Step Guidelines: /In this example we just subscribefor one item, the benefits with thesubscription model will increase ifwe subscribe for many items74

Congratulations! - You are finished with the Task

OPC DA Client AlternativesYou can create OPC Servers and Clients in different Programming Languages, and all should work together if you usethe same OPC Specification.To prove that we will create an OPC DA Client in one of the following Languages (You choose). You find task details onthe next pages.Alt 1Alt 2MATLAB OPC ToolboxAlt 3OpenOPC for PythonTable of Contents

Visual StudioRead Temperature Data from the OPC Server usingVisual Studio Measurement Studio (OPC DA)OPC DAHans-Petter HalvorsenTable of Contents

Measurement Studio 2019Software Measurement Studio is an add-on to Visual Studio. Measurement Studio is used for development ofmeasurement, control and monitoring applications using.NET and Visual Studio. Measurement Studio has a library (NetworkVariable) thatmakes it possible to communicate with OPC DA serversthat we will use is this lab work Download Software here:https://www.ni.com/download78

LabVIEW DSC Module LabVIEW DSC Module is an additional modulefor LabVIEW DSC – Datalogging and Supervisory Control Exchanging data between MeasurementStudio applications and OPC servers requiresLabVIEW DSC.

OPC with NetworkVariableThe following paragraphs explain how to use NetworkVariable with an OPC server using the LabVIEW DSC Run-Time System.1.Install LabVIEW Datalogging and Supervisory Control (DSC) Run-Time System.2.Install your OPC server. Only OPC2 and higher are supported by LabVIEW DSC Run-Time System.3.Select Start»All Programs»National Instruments»Distributed System Manager to launch the application.4.Right-click localhost and select Add Process to create a new process. Type Test Process in the Add Process dialogbox and click OK. Grouping variables by process allows you to organize your variables. You can start and stopprocesses independently, which allows you to easily manage your variables.5.Right-click on Test Process and select Add I/O Server.6.For the I/O Server Type, select OPC Client and click Continue.7.Type Test OPC in the Enter IO Server Name dialog box and click OK.8.Select the OPC server that you want to access through the Network Variable API from the list of Registered OPCServers you installed in step 3 and click OK.9.Right-click on Test Process and select Add Variable to launch the Shared Variable Properties dialog box.10.In the Shared Variable Properties dialog box, select the Enable Aliasing checkbox and click the Browse button.11.In the Browse for Variable dialog box, select one of the OPC items from the OPC I/O server you configured in step 6.12.Click OK to bind the new variable to the OPC source.13.Click OK to return to NI Distributed System Manager. Use the new variable as you would any other shared variable.You can access the variable you have configured through the .NET NetworkVariable class library, as you would anyother network 75857B-01/mstudionetvar/netvar opc/

Distributed System Manager

C# Example

using NationalInstruments;using NationalInstruments.NetworkVariable;namespace OPCExample{public partial class Form1 : Form{private NetworkVariableReader float reader;private const string NetworkVariableLocation @"\\localhost\Test Process\opctempdata";Students: Read Temperature Data from theOPC Server using Visual Studio. Create a GUI.public Form1(){InitializeComponent(); .private void ConnectOPCServer(){reader new NetworkVariableReader float ate void btnGetData Click(object sender, EventArgs e){NetworkVariableData float opcdata null;try{opcdata reader.ReadData();reader.Connect();txtStatus.Text reader.ConnectionStatus.ToString();}private void Form1 FormClosing(object sender, FormClosingEventArgs e){reader.Disconnect();}txtOpcData.Text opcdata.GetValue().ToString();}catch (TimeoutException){MessageBox.Show("The read has timed out.", "Timeout");return;}}}} Note! This Code Snippet reads only one value once when clicking the button. You can use e.g. a Timer in order to read values at specific intervals.

1Timer2Initialization:In Visual Studio you may want to use a Timer instead of a While Loop inorder to read values at specific intervals.Select the “Timer” component in theToolboxProperties:3public er Event:Double-click on the Timer object inorder to create the Eventprivate void timer1 Tick(object sender, EventArgs e){ //Read from OPC //Scaling //Plot Data}You may specify the TimerInterval in the Properties WindowStructure your Codeproperly!!Define Classes and Methodswhich you can use here

Trending DataStudents: Trend the Data in a PlotYou may use the“WaveformGraph” Controlincluded with MeasurementStudioYou only need one line of code, e.g. in the Timer Event: { waveformGraph.PlotYAppend(analogDataIn);}Name of your WaveformGraph controlName of the Method to useName of the variable withTemperature data

Example:1OOP: Classes, Fields and Methodsclass Car //Class{public string color; //Field//Methodpublic void ShowCarColor(){MessageBox.Show("My Car is: " color);}You should use OOP techniques in yourapplication! Create your own classes, fieldsand Methods3OOP: Object Oriented ProgrammingCar myCar new Car(); //We create an Instance of the Class}2myCar.color "blue"; //We set a value for the color FieldmyCar.ShowCarColor(); //We call the MethodStudents: Make sure to use OOP (Object Oriented Programming) in your solutions

Congratulations! - You are finished with the Task

OPC DAMATLABRead Temperature Data into MATLAB usingMATLAB OPC Toolbox (OPC DA)Hans-Petter HalvorsenTable of Contents

MATLAB OPC ToolboxFor more information about the MATLAB OPC Toolbox:www.mathworks.com/products/opcAcquire Data from an OPC Data Access Server (with ?prodcode OT&language enStudents: Read Temperature Data from TC-01 into MATLABusing MATLAB OPC Toolbox. Analyze the Temperature Data(mean, standard deviation, etc.) in MATLAB and make a Plot.

You may need to Run thiscommand in the MATLABCommand windowAcquire Data from an OPC Data Access Server (with Examples): datafrom-an-opc-data-access-server.html?prodcode OT&language en

clearclc% Connect to OPC Serverda opcda('localhost', 'Matrikon.OPC.Simulation.1');connect(da);% Create Groupgrp addgroup(da, 'DemoGroup');%Add TagsitmIDs {'Random.Real8'};itm additem(grp, itmIDs);% Retrieve Datadata read(grp);opcdata data.Value%Clean Updisconnect(da)delete(da)MATLAB OPC DAReadExample 1This simple Example reads onlyone value from the Server

% OPC Exampleclearclc% Connect to OPC Serverda opcda('localhost', 'Matrikon.OPC.Simulation.1');connect(da);MATLAB OPC DAReadExample 2This simple Example reads values fromthe Server.This Examples reads N values using aFor Loop% Create Groupgrp addgroup(da, 'DemoGroup');%Add TagsitmIDs {'Random.Real8'};itm additem(grp, itmIDs);% Retrieve DataN 10;for i 1:Ndata read(grp);opcdata(i) data.Value;pause(2)end%Clean Updisconnect(da)delete(da)plot(opcdata)

MATLAB OPCDA ReadExample 3This simple Example uses some ofthe more advanced features inthe MATLAB OPC Toolbox.No For/While Loop needed!clear, clc% Connect to OPC Serverda opcda('localhost', 'Matrikon.OPC.Simulation.1');connect(da);% Create Groupgrp addgroup(da, 'DemoGroup');%Add TagsitmIDs {'Random.Real8'};itm additem(grp, itmIDs)% Set PropertieslogDuration 60;logRate 0.2;numRecords ceil(logDuration./logRate)grp.UpdateRate logRate;grp.RecordsToAcquire numRecords;% Acquire Datastart(grp), wait(grp)% Retrieve Data[logIDs, logVal, logQual, logTime, logEvtTime] getdata(grp, 'double');% Plot Dataplot(logTime, logVal);axis tightdatetick('x', 'keeplimits')legend(logIDs)%Clean Updisconnect(da)delete(da)

Congratulations! - You are finished with the Task

OPC DAPythonRead Temperature Data into Python usingOpenOPC for PythonHans-Petter HalvorsenTable of Contents

OpenOPC for Python OpenOPC for Python is a free, open sourceOPC toolkit designed for use with the Pythonprogramming language. http://openopc.sourceforge.net If you prefer, you can use one of the manyother OPC libraries that exist for Python

Congratulations! - You are finished with the Task

(Voluntary challenge – but recommended!)OPC DAOPC DA NetworkSend OPC DA data between differentcomputers in a network using OPC TunnellerSoftwareHans-Petter HalvorsenTable of Contents

OPC TunnellerProblem: Sending OPC Data between 2 (or more) Computers in a Network, or even worse,over Internet. OPC DA uses COM/DCOM. This makes it complicated to make it work in amodern Net

D. OPC UA using LabVIEW (OPC UA Server OPC UA Clients) E. OPC with Visual Studio, MATLAB or Python. Select one of the following I. Trend OPC DA Data using Visual Studio Measurement Studio II. Get Temperature Data into MATLAB using MATLAB OPC Toolbox III. Get Temperature Data into Python F. OPC Network: Send OPC data between different .

Related Documents:

May 02, 2018 · D. Program Evaluation ͟The organization has provided a description of the framework for how each program will be evaluated. The framework should include all the elements below: ͟The evaluation methods are cost-effective for the organization ͟Quantitative and qualitative data is being collected (at Basics tier, data collection must have begun)

Silat is a combative art of self-defense and survival rooted from Matay archipelago. It was traced at thé early of Langkasuka Kingdom (2nd century CE) till thé reign of Melaka (Malaysia) Sultanate era (13th century). Silat has now evolved to become part of social culture and tradition with thé appearance of a fine physical and spiritual .

2.2 OPC Scout V10 2.2.1 OPC client for test purposes SIMATIC Net OPC Scout V10 OPC Scout V10 is a standard OPC client that is supplied with SIMATIC NET. OPC Scout V10 can be used as a test tool when commissioning and checking an OPC system. Note For more information about

OMRON Guide to Using CX-Server OPC in Microsoft .Net Page 4 About this Manual This manual describes the CX-Server OPC client application and its ability to interface with OPC servers. It does not provide detailed information concerning OPC itself, or the CX-Server OPC server.The main CX-Server OPC user

On an exceptional basis, Member States may request UNESCO to provide thé candidates with access to thé platform so they can complète thé form by themselves. Thèse requests must be addressed to esd rize unesco. or by 15 A ril 2021 UNESCO will provide thé nomineewith accessto thé platform via their émail address.

̶The leading indicator of employee engagement is based on the quality of the relationship between employee and supervisor Empower your managers! ̶Help them understand the impact on the organization ̶Share important changes, plan options, tasks, and deadlines ̶Provide key messages and talking points ̶Prepare them to answer employee questions

Dr. Sunita Bharatwal** Dr. Pawan Garga*** Abstract Customer satisfaction is derived from thè functionalities and values, a product or Service can provide. The current study aims to segregate thè dimensions of ordine Service quality and gather insights on its impact on web shopping. The trends of purchases have

The present resource book is designed as a supplement to Peter Roach’s (2010) textbook English Phonetics and Phonology: A Practical Course and may be used to accompany lecture courses on English Phonetics at university level. It is equally suitable for self‐study and for in‐class situation