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

sergio picture sergio · Aug 16, 2013 · Viewed 27.1k times · Source

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.

Answer

Andrew Cullen picture Andrew Cullen · Feb 26, 2014

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