Exception frm HRESULT : 0x80040202 in OPC Client OnDataChange hand

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.
 
A

Armin Zingler

Prashant Khonde said:
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.



0x80040202 is:

HRESULT: 0x80040202 (2147746306)
Name: DIERR_MOREDATA
VFW_E_NEED_OWNER
DMO_E_INVALIDTYPE
Description: Not all the requested information fit into the buffer. & This
object can only be created as an aggregated object.
Severity code: Failed
Facility Code: FACILITY_ITF (4)
Error Code: 0x0202 (514)


I'd ask the author of the failing component. Obviously you don't have a
problem with the VB.Net language.


Armin
 
Top