Professional OPC
Development Tools

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. You do not have to be a licensed user of our product.

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.

How to check OPC Server Status?

More
07 Oct 2011 11:00 #524 by support
From: .....
Sent: Friday, October 07, 2011 10:53 AM
To: Zbynek Zahradnik
Subject: RE: How to check OPC Server Status?

Hi,

Thanks for the quick reply,

No[w] I know how it works..... so we will implement some sort of "watchdog" item in the OPC Server that we can read without loading the PLC to much and read it to get the OPC Server status.

Best regards
J.

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

More
07 Oct 2011 08:34 #523 by support
The answer is Yes, you get this information - but indirectly.
One of the design principles of our product is that it makes the OPC Server itself "invisible"- i.e. you only work with objects such as OPC items, because that's what the application really needs - the item data. Status of the OPC Server is therefore "projected" into all OPC items you work with. The component checks the status of the OPC Server (among others, it calls IOPCServer::GetStatus periodically), and if it detects a failure, it reports it to the application for all items the application is working with.
If the OPC Server reports OPC_STATUS_FAILED in IOPCServer::GetStatus, the actual error code returned by the component is 0xC0049001L, and the error message is:

Server failed. This error originates in the OPC Data Access server. A vendor specific fatal error has occurred within the server.
The server is no longer functioning. The recovery procedure from this situation is vendor specific. The application will try to
reconnect to the server after a configurable period.

Technical information: The call to IOPCServer::GetStatus on the OPCServer object has returned OPC_STATUS_FAILED in the
OPCSERVERSTATUS structure.



Your application will receive this error in a way that depends on the method you used to interface with the component:

For "one-shot" method calls that work with a single item (such as ReadItemValue), this error will be the HRESULT returned by the actual function call.
For methods calls that work with multiple items at once (such as ReadMultipleItems), this error will be in Exception.HResult property of each of the operation results objects returned.
If you are subscribed to items and the server goes into this state, all subscribed items will receive an ItemChanged notification that bears this code in Exception.HResult property of the "event arguments" object passed to the notification handler.

Status codes other than OPC_STATUS_FAILED are currently not reported to the application, because they do not mean a "hard" failure and do not require the component to perform a disconnect and reconnect, and the OPC server also reflects the problem in the quality/errors associated with each item, so an indication that there is a problem will get to the client anyway. We can think of passing this information to the application in some upcoming version update, if that's your requirement.

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

More
07 Oct 2011 08:12 #522 by support
Hi,

[.....]. I have to integrate an OPC Client into one of our applications and dowloaded your toolkit for COM\C++ development.

I am right now evalutating your toolkit and i try to find any interface to get hold of the OPC Server state ie if it is RUNNING, NOCONFIG, FAILED and so on. It there any possibility to get hold of that information from the OPC Server?

Best regards
J.

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

Moderators: support
Time to create page: 0.044 seconds