OPC Automation

Hello,

I'want to create an OPC Client for any OPC Server in VB.NET. I use Visual Basic 2005 Express Edition.

So, I add a reference to my OPCDAAUTO.dll. And at this time, there is just this part of Code :

Public Class Form1

Dim WithEvents g_OpcServer As OPCAutomation.OPCServer

Dim WithEvents g_OpcGroups As OPCAutomation.OPCGroups

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

g_OpcServer = New OPCAutomation.OPCServer

g_OpcServer.Connect("KEPware.KEPServerEx.V4")

g_OpcGroups = g_OpcServer.OPCGroups.Add("Grp")

End Sub

End Class

When I Run the App, i go this Error message : Unable to cast COM object of type 'OPCAutomation.OPCGroupClass' to interface type 'OPCAutomation.OPCGroups'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{28E68F95-8D75-11D1-8DC3-3C302A000000}' failed due to the following error: Cette interface n'est pas prise en charge (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Anyone can help me




Answer this question

OPC Automation

  • Jack gillespie

    Michel;

    I would be happy to use the .net API. To be honest - endless searches never demonstrated its existence to me. Perhaps you could be kind enough to elaborate on how to do so from vb.net.

    Thanks;

    SteveJ



  • Capitán Cavernícola

    Hello,

    some important remarks on your post :

    1. OPCDAAuto.DLL cannot be use as a free dll. it's provide by the Fondation for OPC Foundation member which choose how to redistribute it. But in every case they have to rebuild, rename the DLL and support it.
    2. on the technical point of view it's really bad to use the automation wrapper in .Net. Sure it's possible and it's working but it wa smade possible just for the maintenance of existing project. It's one of the worst thing you can do for a new project.
    3. The best way to access OPC Server from .Net is to use the .NET API. The .Net API is an assembly to create OPC Client. Not only DA client but AE, HDA, DX, etc.

    Regards

    Michel4CE


  • Amol Gogate

    1. OPCDAAuto.DLL cannot be use as a free dll. it's provide by the Fondation for OPC Foundation member which choose how to redistribute it. But in every case they have to rebuild, rename the DLL and support it.

    OPCDAAutomation is installed at the same time you install your OPC Server, like RSLinx or Kepware Server for example .. so what's wrong

    2. on the technical point of view it's really bad to use the automation wrapper in .Net. Sure it's possible and it's working but it wa smade possible just for the maintenance of existing project. It's one of the worst thing you can do for a new project.

    3. The best way to access OPC Server from .Net is to use the .NET API. The .Net API is an assembly to create OPC Client. Not only DA client but AE, HDA, DX, etc.

    Perhaps but as you said earlier, OPC Foundation is not a philanthropist foundation, that's the less thing we can say when you see th price of a OPC member ship ;-) So how does students, and workers whom employer have some hedgehog in thier pockets but that is another debate, isn't it

    Regards,

    ZbooNet



  • Rafael Leonhardt

    Hi, I'm very interested in using KEPServerEx with .Net but cannot find any examples. I have emailed Kepware but have had no response.

    I'd be happy to test your class if that's ok - you can contact me at msdn.1.jamieo@spamgourmet.com

    Thanks,

    Jamie


  • PeterVrenken

    Its depends of the version of the library the version 2.0 presents this problem but the version 2.02 is so good



  • Marcel Lattmann

    Strangly enough,

    I just happen to be finishing up with an entire wrapper class that interfaces with the OPCDAAuto.Dll. It handles all the finite details of connecting with the Server (I am using Kepware as well), and reading / writing on seperate threads. I have about 100 hours into it. I wouldn't mind having someone else testing it.

    If you are interested, give me a way of contacting you and I can send it to you.

    SteveJ



  • Michael Wolff

    I have received several requests for this class - which is fine, I don't mind sharing it. Actually, I have now changed it into a component and have improved the documentation.

    If you do ask for it, though, I have one request. Please take the time to give some feedback - especially with respect to errors or improvements. I am using it for a business application and need it to be as error-free as possible.

    Thanks;

    steves_surfing_email@msn.com



  • Mike Vargas

    hey can you send me the code. umpate22@hotmail.com

    thank you



  • The MATRIX

    ZbooNet,

    The membership for university is $500 per year. This subscription allow students to access most of the foundation's SDK and specifications.

    The Foundation is a none profit organization. its tasks are to provide specifications, ensurefor OPC technology adoption and ensure the quality of OPC products.

    As i already say the Automation wrapper (OPCDAAuto.dll) is a sample to demonstrate that you can access OPC DA Server from Automation compliant language.

    Company that redistibute it must respect rule that come with the a source code, rename the DLL , change IIDs, support it,etc... This is on the legal point of view.

    On the technical point of view to access OPC server from .Net you have to use the .Net API, the Automation wrapper works with .Net application, but this is the worst kind of OPC DA client you could do.

    Finaly, as student you have contact your teacher and find $500. As employee in a company where employer have hedgehog in their pocket can i suggest to find a other company or maybe to kidnap the hedgehog. and put it on a road.

    Michel4CE


  • Justinas

    Could you please forward it to me, if still available
    mikebo01<at>hotmail<dot>com
    Thank You,
    Mike


  • owl666

    Sorry everyone,

    My .net beta expired last month, and its taken a while to get the Pro version ordered. I'm back now though.

    Whomever still wants a copy of this class, you can email me at steves_surfing_email@msn.com

    I need to do documenting and code cleanup, but it works.

    Steve Jackson



  • ShunterAlhena

    Hello Steve,

    Well .. as you wich, here is my msn adress : zboonet@hotmail.com

    see you later :-)



  • adolf garlic

    I'd like to test it to

    registrera.REMOVE@yahoo.se

    Regards

    JBu


  • OPC Automation