P
Prashant Khonde
Hi all,
I am developing OPC Client in VB.net. I have developed the code and reading
OPC Items on Sampling as well as event based (OnDataChange). When I am
working with local machine then my code works fine with both Sampling as well
as OnDataChange, but when I am trying to read data from Remote OPC Server
then Sampling works fine but I am not able fetch data on event based process.
I am able to connect to the OPC Server but when i am adding subscription to
it then i am getting error.
HRESULT : 0x80040202.
Public NetCredentials As New System.Net.NetworkCredential
Dim connectdt As Opc.ConnectData
Public WithEvents Subscription As ISubscription = Nothing
Public State As New Opc.Da.SubscriptionState
State = New Opc.Da.SubscriptionState
State.Active = True
State.UpdateRate = 500
Subscription = OpcServer.CreateSubscription(State)
results = Subscription.AddItems(Items)
AddHandler Subscription.DataChanged, New DataChangedEventHandler(AddressOf
OnDataChange) ' Here is the error.
I appreciate if anybody suggests some solution.
I am developing OPC Client in VB.net. I have developed the code and reading
OPC Items on Sampling as well as event based (OnDataChange). When I am
working with local machine then my code works fine with both Sampling as well
as OnDataChange, but when I am trying to read data from Remote OPC Server
then Sampling works fine but I am not able fetch data on event based process.
I am able to connect to the OPC Server but when i am adding subscription to
it then i am getting error.
HRESULT : 0x80040202.
Public NetCredentials As New System.Net.NetworkCredential
Dim connectdt As Opc.ConnectData
Public WithEvents Subscription As ISubscription = Nothing
Public State As New Opc.Da.SubscriptionState
State = New Opc.Da.SubscriptionState
State.Active = True
State.UpdateRate = 500
Subscription = OpcServer.CreateSubscription(State)
results = Subscription.AddItems(Items)
AddHandler Subscription.DataChanged, New DataChangedEventHandler(AddressOf
OnDataChange) ' Here is the error.
I appreciate if anybody suggests some solution.