473,378 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Exception frm HRESULT : 0x80040202 in OPC Client OnDataChange hand

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.
Dec 28 '07 #1
1 5408
"Prashant Khonde" <Prashant Kh****@discussions.microsoft.comschrieb
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

Dec 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Onega | last post by:
Hi I have problem raising COM exception with support_error_info("IMyinterface"). It is an ATL wizard generated COM Exe project(VC++2003) My interface looks like: __interface IMyinterface:...
4
by: Mark | last post by:
I have a COM object that calls into a C# Forms library. The library can throw exceptions and I want to handle the exceptions in COM. Adam Nathan wrote a Microsoft sponsored book titled .Net and Com...
4
by: Shimon Sim | last post by:
I just switch my asp application to .net 2 and got this error. Any reasons why? Thank you. Server Error in '/RAFEmployee' Application....
11
by: Don | last post by:
When using Visual Basic .NET with a reference to Interop.Outlook, is there a way to get more detailed information about an error other than Exception.Message or Exception.ToString? For example,...
0
by: Pieter | last post by:
Hi, When using clickOnce for a VB.NET 2.0 application it installs fine on every computer, except one (a new one...). Every is isstalled, Framework, Mdac, .... The error in the log file is:...
1
by: getelectronic | last post by:
Hi all I have a sample code to implement opc client in Python. i use a file .py making by makepy with pythonwin for Com Interface. i can get all server in machine, connect to server opc,...
8
by: sankar.vikram | last post by:
Hi I am using a com component in my C# application. But i getting error while i tried to call multiple events from my application. I'm getting the error "Exception from HRESULT: 0x80040202" ...
0
by: prashprince111 | last post by:
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...
4
by: yogarajan | last post by:
The specified module could not be found. (Exception from HRESULT: 0x8007007E) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.