AdvancedHMI Software

General Category => Support Questions => Topic started by: andrew_pj on June 09, 2015, 02:03:42 AM

Title: InvalidComObjectException - OpcDaCom
Post by: andrew_pj on June 09, 2015, 02:03:42 AM
Dear Archie,

I am using V398m, and OpcDACom communication protocol.
I got this InvalidComObjectException error 'sometimes', right after I execute Application.Exit()
It's actually not a major problem as in this case User wants to exit anyway.
But, it would be better if it's not happening at all.

Code: [Select]
Try
   Application.Exit()
Catch ex As Exception

End Try

Please advise if you have explanation or trick to prevent this error.
Thank you.

Best regards,
Andrew
Title: Re: InvalidComObjectException - OpcDaCom
Post by: Archie on June 09, 2015, 06:38:24 AM
That is something down in the OPC Server wrapper, so I don't have any way of knowing exactly what it is. I would modify the code like this to ignore the exception:

           If DLL.IsConnected Then
                Try
                    DLL.Disconnect()
                Catch
                End Try
            End If
Title: Re: InvalidComObjectException - OpcDaCom
Post by: andrew_pj on June 10, 2015, 12:08:36 AM
So far no more error, Thanks.