Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Noob guide to OPC: how to write a C# Hello World client?

Tags:

.net

c#-4.0

opc

Here is my situation:

We have a software that is used to monitor solar power plants developed. I have to introduce OPC as a new way to acquire data from the physical devices themselves, so that's why I ended up trying to learn about OPC, which so far is being frustrating.

I have installed the Matrikon simulator and using the Matrikon explorer I can see that data is being simulated. What I need now is to create a very basic proof of concept that I can connect to it and print something using C#. As I understand it, I have to use some proprietary API/SDK. I'm only testing things so I don't want to commit to a proprietary way to do things right now. Wasn't OPC created to exactly avoid that?

Is there a simple Opensource DLL that I can use to connect to the OPC server, that supports DA, HDA and AE, allowing me to work without worrying about vendors/sdks?

To add to the confusion I have found OPC Xi and OPC UA.... and I haven't found a tutorial from ground zero up, which is what I'm looking for.

like image 862
sergio Avatar asked Aug 16 '13 14:08

sergio


People also ask

Can OPC UA talk to OPC DA and vice versa?

Can OPC UA talk to OPC DA and vice versa? OPC UA and OPC DA can't talk directly, but there are OPC Gateway applications that can share data in a single or bi-directional configuration between the 2 standards.

How can 2 OPC servers talk to each other?

The only way for two OPC Servers to communicate is to have an OPC Client application provide a bridge between the two servers, thus becoming an “OPC Bridge.” The OPC Bridge connects two or more OPC Servers together. The OPC Bridge requests data from one OPC Server, and writes the data to another OPC server.

What is OPC configuration?

OPC is a software interface interoperability standard that allows secure and reliable exchange of data between Windows programs and industrial hardware devices. It is platform-independent and ensures the continuous flow of information across multiple vendor devices.


3 Answers

I recommend you use the newest flavor of OPC, OPC UA.

You can build a simple HMI app in C# using these free tools:

1.Microsoft Visual Studio Express 2013 for Windows Desktop available from: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-for-windows-desktop.

2.The latest source from this site: https://github.com/convertersystems/opc-ua-samples

With this kit you can: Browse OPC UA servers directly from the Visual Studio IDE. Drag and drop the variable nodes to create a data subscription. Use bindings to animate your UI control's properties from the subscription's data values.

Check out the sample application 'Workstation'.

like image 124
Andrew Cullen Avatar answered Sep 22 '22 07:09

Andrew Cullen


First you need to know which OPC you want to use.

  • "Classical OPC" DA/HDA and A&E based on Windows COM/DCOM
  • OPC XML/DA, DA as a web service but with some limited performance.
  • OPC UA, the last specification allowing you to implement it on non Windows platform and merging DA, HDA and A&E.

After that, you could choose the language you want to use and so use some SDK free or not.

One good website for OPC : http://www.opcconnect.com/source.php has lists of Toolkits you could use.

like image 36
Camille G. Avatar answered Sep 23 '22 07:09

Camille G.


Providing you with a tutorial... but a little bit of information first:

OPC is everything but open (in an open source way)... the OPC foundation has specified a lot of things to standardize the way automation can communicate - on top of which you could build your own stack. Be warned, the stuf is HUGE(!). So to ease the workload a little, there is a hand full of companies providing you with stacks for different programming languages. Matrikon, Prosys, Unified Automation to name some of them.

However to connect to a demoserver you need to implement a provider and do still need a stack providing you with the basic functionality and to download such a stack, your company must register with the supplier. There is no way round I'm afraid. However there were OpenSource projects: http://www.openopcua.org/ never tried the code though.

BUT just to prove the usefulness check this tutorial http://doc.unifiedautomation.com/

And a book written by the company owner of UA (maybe your company has "Springerlink" access?) http://www.springer.com/computer/information+systems+and+applications/book/978-3-540-68898-3

like image 24
AnyOneElse Avatar answered Sep 23 '22 07:09

AnyOneElse