Connectivity issue when reconnecting OPC server

411 views
Skip to first unread message

Manoj Santhakumaran

unread,
Aug 29, 2016, 7:03:07 PM8/29/16
to openSCADA
Hi All,

I'm facing an issue when using Utgard driver for OPC. I have a program which connects to an OPC server and poll data using Async20Access.

There are around 1400 tag points I registered with this access base.

Everything works fine for around 9/10 hours. Then suddenly no data received at my application. There was no error reported from the driver.

When this issue happened I thought I can resolve this by implementing a fix to disconnect and then re-connect the server and access base.

But that didn't work due to exceptions. It is showing different exceptions every time when application try to create a new Server and Async20Access.

One of the exceptions it received today is below.

Failed to change state (true)
org.jinterop.dcom.common.JIException: The RPC server is unavailable. Please check if the COM server is up and running and that route to the COM Server is accessible (A simple "Ping" to the Server machine would do). Also please confirm if the Windows Firewall is not blocking DCOM access. [0x800706BA]


I know this exception is not from Utgard, but from j-integop. But the doubt is why it is showing only when re-creating the connection.

First, I doubt that I'm shutting down existing connections properly or not. Following is my code to do that.

    // Properly shutdown and disconnect the existing connections.
   
public void disconnectOPCServer () throws Exception {
       
this.accessBase.unbind();
       
this.server.disconnect();
       
this.server.dispose();
       
this.accessBase = null
       
this.server = null;
       
try {
           
Thread.sleep ( 120000 ); // Wait for two mins
       
} catch ( Exception e ) {
       
}
   
}

Do you think this is sufficient to shutdown existing DCOM connections?

FYI, I'm already using the following configuration to turn off GC on DCOM objects, as suggested in many other posts.
   
 JISystem.setJavaCoClassAutoCollection(false);

I appreciate any solution/suggestion/pointers to resolve this re-connect issue.

Thank you very much.
Manoj

Jens Reimann

unread,
Sep 1, 2016, 5:27:41 AM9/1/16
to openSCADA
Hi,

to be honest, I never got Async running well. The cause for that was always that at some point the callback was not triggered anymore because the windows side did make some assumptions about the remote (jinterop) side and stopped the callback. Leaving Utgard in the situation that basically the service is working, but still no callback gets fired.

Simply switching to sync access worked fine. If anything goes wrong, shutting down the stack and startup up again always worked.

Now I also do know that 1400 tags may be a bit too much for that setup.

You can have a look at the source code how openSCADA does it for its own OPC DA driver module [1]. And when I look at this source code, it looks like you are missing a call to "JISession.destroySession ( session );"

Hope this helps

Jens

--
You received this message because you are subscribed to the Google Groups "openSCADA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openscada+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Manoj Santhakumaran

unread,
Oct 28, 2016, 5:22:05 PM10/28/16
to openSCADA

Hi Jens,

Thank you very much for your comments.

I have taken your suggestion to shutdown the stack and start up again, whenever I get a connection exception and after that no response from OPC server 10 minutes.

Best regards,
Manoj

Jens Reimann

unread,
Oct 31, 2016, 4:00:22 AM10/31/16
to openSCADA
Sometimes a clean restart just works .. I know it is not pretty!

Cheers

Jens

Reply all
Reply to author
Forward
0 new messages