With respect to error handling and event pipes - all of the SDK calls should throw proper COM exceptions which can be caught using the standard try-catch functionality of the ,NET languages. All of the exceptions from the SDK should be COM, so the COMexception object in .NET should be appropriate for accessing and interpreting them. Often we recommend a try-catch for specifically COM exceptions and then a second one for general system exceptions.
With respect to specific trappable errors - I would refer to the online help file (pisdk.chm) - the programmers guide lists the common trappable errors with each object's entry for a given method (and the standard errors are listed in a separate page called (appropriately) "Standard Errors"). The PI-SDK error codes (those that are defined in the PI SDK have an enumeration that is delineated by the "pse" prefix (for example, pseEVPIPENOTFOUND) for common access and defintion for PI SDK based applications.
Also note, an example of defining and using event pipes in VB.NET and C# (though they are event pipes for module DB events) are available through the techsupport website for download. This shows a basic error handler and all of the proper definition syntax for event pipe usage in .NET.
With respect to your question about reconnection, the event pipe will attempt reconnect under the hood - and with newer versions of the PI server, that connection should persist through disconnections minimizing missed events. You should not need to explicitly reconnect under normal circumstances. There could be some extreme errors where the event pipe was not created, created correctly, or been destroyed somehow, that might require clean up - but for the more common disconnection (and those happen with more frequency in real life than anyone cares to admit), the event pipe should recover its connection with out additional action by the application.
Hope this helps.
- Dave Oda, Software Developer, OSIsoft
Excellent, tells exactly whats needed. Thanks.