Professional Communication
Software Development Tools

OPC Foundation member and certified logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions or issues. You do not have to own a commercial license in order to use the OPC Labs supportOur team is actively monitoring the forums, and provides replies as soon as possible.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible.

Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

VB.NET app suddenly has no item changes | OPC-DA | COM

More
14 Jan 2026 13:26 - 14 Jan 2026 13:26 #14539 by support
Hello.

I have some additional questions/comments..

1. Are you connecting to an OPC server on the same machine as the client, or remote?

2. It is *critical* to know *with absolute certainty* whether the Windows Event log entries with RPC_E_TOO_LATE for this application have or have not appeared even *before* you started observing the problem. Please check that. It is quite possible that they were there before too, because they can indicate a harmless condition. And we do not want to be hunting for something that is not actually related to the current issue.

3. I do not see any logging at the code branch where it is needed most. For troubleshooting this, you should log e.Exception.Message as soon as .Succeeded is not True (in this case, the .Exception is actually never Nothing). Only then we can tell whether the ItemChanged was not called at all.

Best regards
 
Last edit: 14 Jan 2026 13:26 by support.

Please Log in or Create an account to join the conversation.

More
14 Jan 2026 11:11 #14538 by tosi_wte
Hi,

my OPC client developed with QuickOPC was working just fine until one day no item changes where processed anymore. I saw that my EventHandler for the
Code:
'EasyDAClient.ItemChanged'
didn't trigger anymore. I didn't change anything in that pipeline which was confusing. The application itself logs all the exceptions, but there was nothing. So i checked the Event log of Windows which prompts the following:

COM security initialization (process "OPC Interface WTEB" Id 38660, application domain "OPC Interface WTEB.exe" Id 1) for requestor 'ComSecurityInitializingEasyDAClient' failed; the initialization object was: (Default).
CoInitializeSecurity failure (0x80010119): Die Sicherheit muss initialisiert werden, bevor Schnittstellen gemarshallt oder unmarshallt werden. Änderungen können nach der Initialisierung nicht vorgenommen werden.
+ This error (RPC_E_TOO_LATE) is not uncommon in hosted .NET applications. Depending on various factors, it might be possible to prevent it, or safely ignore it (if COM works as intended). Consult the product documentation.
+ Current thread name: "", from thread pool: yes, managed thread Id: 19, apartment state: MTA.

After some digging around i found your thread about COM management:
COM management - OPC Labs Knowledge Base

I applied all the suggestions but nothing seems to restore the behaviour. So here is some code:
Startup:
Code:
  <MTAThread>   Public Shared Sub Main(s As String())       ComSetup.Initialize()       If Environment.UserInteractive Then           mvoService = New OPCService           mvoService.CanStop = True           mvoService.Type = OPCService.ApplicationType.Console           mvoService.RunAsConsole(s)           System.Console.ReadLine()       End If   End Sub

ComSetup (was first introduced after the issue occured but didn't change anything)
Code:
Public Class ComSetup     Private Shared lock As New Object     Private Shared initialized As Boolean = False     Public Shared Sub Initialize()         SyncLock lock             If initialized Then                 Return             End If             Try                 'ComManagement.Instance.Configuration.SecurityParameters.UseCustomSecurity = True                 'ComManagement.Instance.Configuration.SecurityParameters.TurnOffCallSecurity = True                 ComManagement.Instance.Configuration.SecurityParameters.EnsureDataIntegrity = True                 ComManagement.Instance.AssureSecurityInitialization()             Catch ex As Exception             End Try             initialized = True         End SyncLock     End Sub End Class

Handling subscriptions and item changes (i can guarantee that we have items being subscribed with Handles)
Code:
 Public Class OpcDAProvider      Implements IDataProvider      Public Const ciOPC_SERVER_FAILED As Integer = &HC0049001      Public Const ciOPC_SERVER_SHUTDOWN As Integer = &HC0049006      Public Const ciRPC_SERVER_UNAVAILABLE As Integer = -&H7FF8F946      Private m_Wrapper As OpcWrapper      Private m_State As OpcWrapper.SubscriptionState = OpcWrapper.SubscriptionState.Idle      Private m_Variables As New HashSet(Of OpcVariable)(VariableEqualityComparer.Default)      Private m_Client As EasyDAClient      Public Sub New(wrapper As OpcWrapper)          m_Wrapper = wrapper          m_Client = WTEB.OPC.Functions.CreateDAClient()          AddHandler m_Client.ItemChanged, AddressOf m_Client_ItemChanged      End Sub      Private Sub m_Client_ItemChanged(<NotNull> sender As Object, <NotNull> e As EasyDAItemChangedEventArgs)          Try              With e                  If .Succeeded Then                      If .Vtq.HasValue AndAlso HasAcceptedQuality(e) Then                          Wrapper.Process(OpcSubscriptionValue.FromDAItemChange(e, Me))                      ElseIf AppManager.ServiceSettings.VerboseLogs Then                          Logger.WriteWarning("DA-Provider", $"ignoring data change for {e.Arguments.ItemDescriptor.NodeId} because it has no value or the status was bad (status: {e.Vtq.Quality.InternalValue})")                      End If                  Else                      If .Exception IsNot Nothing Then                          CheckServerStatus(.Arguments.ServerDescriptor, .Exception)                          m_Wrapper.HandleSubscriptionError(DirectCast(.Arguments.State, IVariable), .Exception)                      End If                  End If              End With          Catch ex As Exception              Logger.WriteException(ex)          End Try      End Sub   Public Sub Subscribe() Implements IDataProvider.Subscribe       Dim subscriptions = buildDAItemList()       Dim subscriptionHandles = m_Client.SubscribeMultipleItems(subscriptions)       For i As Integer = 0 To subscriptionHandles.Length - 1           DirectCast(subscriptions(i).State, OpcVariable).Handle = subscriptionHandles(i)       Next       m_State = OpcWrapper.SubscriptionState.Listening   End Sub ...

Initialization of EasyDAClient
Code:
 Public Function CreateDAClient() As OpcLabs.EasyOpc.DataAccess.EasyDAClient      'ComManagement.Instance.Configuration.SecurityParameters.UseCustomSecurity = This.Configuration.UseCustomSecurity      'ComManagement.Instance.Configuration.SecurityParameters.TurnOffCallSecurity = This.Configuration.TurnOffCallSecurity      'ComManagement.Instance.Configuration.SecurityParameters.TurnOffActivationSecurity = This.Configuration.TurnOffActivationSecurity      Dim oClient As New OpcLabs.EasyOpc.DataAccess.EasyDAClient      oClient.Isolated = This.Configuration.IsolatedClient      oClient.InstanceParameters.Mode.AllowSynchronousMethod = True      oClient.InstanceParameters.Mode.AllowAsynchronousMethod = True      oClient.InstanceParameters.Mode.DesiredMethod = OpcLabs.EasyOpc.DataAccess.Engine.DAReadWriteMethod.Asynchronous      oClient.InstanceParameters.Timeouts.BrowseAccessPaths = This.Configuration.TimeoutClient      oClient.InstanceParameters.Timeouts.BrowseNodes = This.Configuration.TimeoutClient      oClient.InstanceParameters.Timeouts.BrowseProperties = This.Configuration.TimeoutClient      oClient.InstanceParameters.Timeouts.BrowseServers = This.Configuration.TimeoutClient      oClient.InstanceParameters.Timeouts.ReadItem = This.Configuration.TimeoutClient      oClient.InstanceParameters.Timeouts.WriteItem = This.Configuration.TimeoutClient      oClient.InstanceParameters.HoldPeriods.ItemDetach = This.Configuration.HoldClient      oClient.InstanceParameters.HoldPeriods.ServerDetach = This.Configuration.HoldClient      oClient.InstanceParameters.HoldPeriods.TopicRead = This.Configuration.HoldClient      oClient.InstanceParameters.HoldPeriods.TopicWrite = This.Configuration.HoldClient      Return oClient  End Function


More useful information
- When calling ComSetup.Initialize() directly after steping into Main() we still get the message with RPC_E_TOO_LATE
- The apartment state is MTA
- I have tried changing the Authentication level to Packet Integrity (haven't restarted the PC though)
- No errors are thrown after subscribing via the EasyDAClient
- im using the OpcLabs.QuickOpc nuget package version 5.83.477
- i have tried different combinations of the SecurityParameters
- i have reinstalled QuickOPC and with that the Kit server which i am trying to communicate with
- i have another QuickOPC application which is working just fine which makes this even less understandable


I am not an expert when it comes to COM and i assume this is the root cause as all of the other logic of my client is working just fine, so i would greatly appriciate your help.

Best Regards
Tom

Please Log in or Create an account to join the conversation.

Moderators: supportvaclav.zaloudek
Time to create page: 0.125 seconds