OPC Client and the Dreaded 0x80040200 Exception

recondaddy

Member
Join Date
Apr 2006
Location
Atlanta, GA
Posts
77
Not a question...just a post to help out anyone else who might someday waste hours on this same issue.

I'm building a data logging application in VB.NET that contains an OPC client to read data from a Cognex OPC Server. Whenever a part fails inspection, a fail bit in the vision program goes high. The OPC client application watches for a data change event with this bit and performs an asynchronous read of the failure data for logging.

Every time I would perform the AsyncRead, however, I would get the Microsoft version of the "Check Engine" light -- HRESULT 0x80040200 -- with no explanation of what was causing it. I discovered the problem.

Because I was doing an asynchronous read of the failure data and did not require data change events from this data group, I had the IsSubscribed property of the failure data group set to False.

Apparently, the Async calls depend on a ConnectionPoint callback. If the client does not provide the callback there is nowhere to send the results when they complete.

I hope this helps someone else, someday.
 

Similar Topics

I have a Win10 64 bit host for my OPC DA server, which is Indusoft (Studio,Scada.OPC.3). Locally OPC works, Matrikon OPC Explorer. On my Win7...
Replies
5
Views
1,174
Hello, I am trying to connect kepServerEx v5 in parallel with RSLinx Classic lite but kepserver will not connect to the PLC if RSLinx is active...
Replies
4
Views
2,106
Hi! We have an existing RSView32 (project made by others). It is already configured as an OPC server. Is it possible for a CLX5380 or S71500 to...
Replies
2
Views
1,497
Hello everyone ! Is there any PLC module (vendor is irrelevant at this point), that acts as an OPC client and can be used to request data from...
Replies
17
Views
5,686
Ohh hai! Is there a clever way to detect if there is a UA Client connected in the UA Server. Using iX Developer 2.40 if its of any help. The idea...
Replies
8
Views
3,368
Back
Top Bottom