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
17 Jan 2026 11:58 #14549 by support
Hello,
thanks for the additional information.

Do we know that this is a client-side problem? I.e. have you tried to connect to the same OPC server from some other OPC client, and what were the results?

Regards

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

More
16 Jan 2026 12:18 #14548 by tosi_wte
Hi,

1. During development, it runs as a console application. However, the app can be compiled to run as a Windows service, console application or background process, mainly by using a different entry point to the executable file. In production, we don't use a Windows service for OPC-DA. There it always runs as the interactive user, as do the OPC-DA servers.
2. My app is running as the interactive user.
3. Not that I know of. The user account has administrative privileges, but it is managed by a different IT department.
4. "opcrtkit" only had one instance running before and after I started my app. It runs under the SYSTEM (local system) account and not the interactive user.

Just tested if changing account of "opcrtkit" to my user account (interactive user) did the thing but no.
 

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

More
16 Jan 2026 11:46 #14546 by support
Hello.

Thank you - the information about the error from Read is very useful. It is now clear that the problem with not getting anything in ItemChanged is the same thing. Essentially, the client code is stuck in making the connection to the server.

I have some more questions:

1. What kind of project is your program? E.g. Windows Forms app, WPF app, Web app, Windows service, Web service, console app, etc.

2. What is the user account it is running on? Is it "you" (the interactive, logged on user), or some other account?

3. Hasn't that account changed recently, or its permissions?

4. Please use Windows Task Manager, make sure it shows processes from all users, sort the list by process names, and then observe what happens with regard to "opcrtkit" (the OPC server process). Is there any such process before you start your app? If so, just one, or more? And, when you start your app, what happens? Does the count of "opcrtkit" processes change, and if so, how? What are the user accounts the Task Manager tells you the "opcrtkit" is running on? [If you are connecting to a differerent server, you need to use that server's executable name instead)]

Thank you, and best regards
 

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

More
15 Jan 2026 06:54 #14542 by tosi_wte
I just tested a normal EasyDAClient.ReadItem() call and i receive this error. 

15.01.2026 07:46:58 -> Exception: Name: OpcLabs.EasyOpc.OperationModel.OpcException
Message: An OPC operation failure with error ID 'RawEasyDAClient.HResult=0xC004C001' occurred, originating from '' and with depth of 1. The inner exception contains details about the problem.
HResult: -2146232832
StackTrace:    bei OpcLabs.EasyOpc.Internal.EasyUtilities.CheckSuccess(OperationResult operationResult)
   bei OpcLabs.EasyOpc.DataAccess.IEasyDAClientExtension.ReadItem(IEasyDAClient client, DAReadItemArguments readItemArguments)
   bei OpcLabs.EasyOpc.DataAccess.IEasyDAClientExtension.ReadItem(IEasyDAClient client, String machineName, String serverClass, String itemId)
   bei Self.OPC.DA.OpcDAProvider..ctor(OpcWrapper wrapper) in C:\Users\tom.siegel\Workspace\Code\WARIOS.Scada.Client\src\apps\OPC_Service\OPC\DA\OpcDAProvider.vb:Zeile 25.
   bei Self.OPC.OpcWrapper.RegisterProviders() in C:\Users\tom.siegel\Workspace\Code\WARIOS.Scada.Client\src\apps\OPC_Service\OPC\OpcWrapper.vb:Zeile 592.
   bei Self.OPC.OpcWrapper..ctor() in C:\Users\tom.siegel\Workspace\Code\WARIOS.Scada.Client\src\apps\OPC_Service\OPC\OpcWrapper.vb:Zeile 14.
   bei Self.OPC.OpcWrapper.Create(OpcConfigXML configuration) in C:\Users\tom.siegel\Workspace\Code\WARIOS.Scada.Client\src\apps\OPC_Service\OPC\OpcWrapper.vb:Zeile 617.
   bei Self.WTEB.OPC.Configuration.OpcConfigXML.CreateWrapper(OpcConfigXML poConfig) in C:\Users\tom.siegel\Workspace\Code\WARIOS.Scada.Client\src\apps\OPC_Service\Source\clsOPCConfigXML.vb:Zeile 85.
   bei Self.OPCService.StartNewWrapper(OpcConfigXML poConfig, Boolean pbRestart) in C:\Users\tom.siegel\Workspace\Code\WARIOS.Scada.Client\src\apps\OPC_Service\Service\OPCService.vb:Zeile 665.
InnerException: Name: System.TimeoutException
Message: Cannot connect Data Access client (timeout).
+ The client method called (or event/callback invoked) was 'ReadMultipleItems[1]'.
HResult: -2146233083
StackTrace:


Here's the code
Code:
  Dim vqt = m_Client.ReadItem("", "OPCLabs.KitServer.2", "Greenhouse.Temperature")   Debug.WriteLine($"OPC DA Provider created. Test read value: {vqt.Value} (Quality: {vqt.Quality}, Timestamp: {vqt.Timestamp})")

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

More
15 Jan 2026 06:21 #14541 by tosi_wte
Hi,
yes i misunderstood that. Unfortunately i am someone who clears this log frequently without saving it. However i can't remember seeing this specific log message before. We also have several production deployments where i don't remember encountering them. Hope that doesn't make it to hard.

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

More
14 Jan 2026 18:52 #14540 by support
Hello. Thank you for additional info. 

I think you misunderstood question #2. I was not asking about current behavior. I was asking about entries in Windows Event Log from the past - before you started seeing the problem. At that time, when no problem was manifesting itself, was the application logging warnings with RPC_E_TOO_LATE ? Usually the Windows Event Log goes many weeks, if not months, into the past, so it should be possible to find it out.

Best regards
 

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

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.145 seconds