Wednesday, 30 March 2016

My Simple OPC Client

As request from our friends, here we create a simple VB application/project to communicate with OPC Server.

Previously, we create My OPC Client project, the latest is version 5, with some advanced feature. But some friends need more simple application, so we create this project. The purpose of the application is to connect to OPC Server, Read data and Write data. So here is MySimpleOPCClient..

For testing, we use Matrikon OPC Explorer, you can download from here.
Please download MySimpleOPCClient project source code from here.

The steps:
1. Run Matrikon OPC Explorer
2. Create group, and add some items to monitor, ie "Bucket Brigade.Int1"
4. Run MySimpleOPCClient
5. Write "Matrikon.OPC.Simulation.1" on OPC Server Name textbox
6. Click Connect button
7. On OPC Item textbox, write "Bucket Brigade.Int1"
8. Click on Add Item button
9. The value of item is automatically loaded to the Read Value textbox
10. Try to write new value on Write Value textbox, then click on Write button

Before opening the project, please make sure you have OPCDAAuto.dll installed/registered on your system. Please follow these steps to register the DLL:
> download DLL from here
> copy file to /System32 folder
> open CMD (command prompt)
> write this command: "regsvr32 OPCDAAuto.dll"

We create this project with MS Visual Studio Express 2010, and we targeted to .NET Framework 4. If you get some problem, please let us know.

See you next time.. Thank you...

16 komentar:

  1. Wow! Thanks a lot!
    So simple and functionally ;)

  2. hello,can you help me Mister hadi hidayat,i went to send data from c# to labview so i will use ni opc server from national instrument and in c# i need to build opc client how can communicacat with ni opc server,please i need a help

  3. i need a code of opc client in c# witch i can send data to ni opc server im sorry im not native speaker

    1. Hi,
      you can convert the source code here from VB to C using this tool:


  4. Hi

    I can't install the OPCDAAuto.dll
    I'm always getting "The specified module can not be found"
    I must say that I'm using a 64-bit WIN7 operating system
    Can you help me out?

    1. Hi..

      > copy OPCDAAuto.dll to folder C:\windows\syswow64
      > open Command Prompt with "Run as Administrator"
      > type: "cd \windows\syswow64"
      > type: "regsvr32 OPCDAAuto.dll"


    2. Thanks! Now going to try to communicate with Simatic NET OPC Server.

  5. Hello Hadi,
    Your blogs are wonderful and very much supportive for me.
    I need documentation of the dlls (OPCDAAuto.dll and Interop.OPCAutomation.dll) you used in the project.

    1. Hello,
      Thanks for your appreciation.
      Please visit OPC Foundation website here:

      or you can ask to OPC Foundation support by email.

  6. Hi Hadi, thank you for the codes, they are very useful and precious.

    1. Hi Mateus... You are welcome.

    2. Thanks, I'm a benginner in, do you know if is possible to convert your code to a console aplication?

      I'm trying but if this not possible I will stop to try it.

    3. Hi..
      Sorry, I dont know about that. But I think, it's better for you to try.. so you will know the answer..
      Good luck!

  7. This comment has been removed by a blog administrator.

  8. This comment has been removed by a blog administrator.


Copyright © . HadiSCADA - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger