Search code examples
asp.netvb.netdll.net-assemblyopc

can not connect to OPC DA Server from web server IIS7


i've got a big problem. I developed a Website in vb.NET with Visual Studio 2013 Ultimate. The Website shows OPC Values from an OPC DA Server. If i debug the Website with Visual Studio, it works fine, without any problems, everything great. But if i publish the Website to the IIS 7 Webserver directory, it doesn't.

So i have minimized the Website to locate the problem and i found out that i can't connect to the OPC Server via the Webserver(IIS7). So i tried a different opc class to connect to the Server - Same result. It works in visual studio, but not via IIS.

i also have the reference in my web.config file from the GAC ( Global Assembly Cache ) for the Assemblys i need.

<add assembly="OpcRcw.Da, Version=3.0.2.22, Culture=neutral, PublicKeyToken=9A40E993CBFACE53"/>
<add assembly="OpcRcw.Comn, Version=1.10.1.21, Culture=neutral, PublicKeyToken=9A40E993CBFACE53"/>

the code is very simple

 If (opccon.Connect("OR.WcfTunnel.1", "localhost", 1000, 3)) Then
  debug.Text = "connected"
  Else
  debug.Text = "disconnected :-("
 End If

But if i am using the Matrikon.OPC.Simulator as OPC Server, i can also connect via the WebServer!! But this is the only one, i have tried other OPC Server, like the Graybox.Simulator.1 or OPCWare.OPCDaServer.1 and this Servers are also like my OPC Da Server, i can't connect via the Webserver. No Error Message or Something like That.

I'm really at a loss, very strange error image. I hope that one of you has any one idea. I think its not a problem in the Code. I used the OPC Connection Class from here

i am using the DANsrv as OPC Server.

Best Regards Kevin


Solution

  • The Reason why i can't connect to the OPC via the IIS7 is not the IIS7 or my Programm Code.

    I think it's possible that some OPC Server needs an active user or maybe admin rights to establish a connection.

    my experience with some OPC Server :

    OPC Server i can connect over IIS7/Webserver

    Matrikon.Opc.Simulation.1 - Matrikon OPC Server
    OPCLabs.KitServer.2 - OPC Labs Server
    Cogent.Datahub.1 - Cogent Datahub OPC Server
    

    OPC Server i can't connect over IIS7/Webserver:

    DANSrv.exe - Advosol OPC Server
    Greybox.Simulation - Greybox OPC Server
    OPCWare.OpcDaServer.1  - OPCWare Server