PIAsynchStatus Object



This object is created and supplied by a caller as an argument to methods that are time consuming and allow asynchronous operation. When the user places the call, it returns immediately. The caller retains the PIAsynchStatus object and the arguments returned by the call. The PIAsynchStatus object will generate events as the call progress changes and as the status of the call changes. When the call status indicates the call has completed successfully the user examines the contents of the collections returned in the original call  or refers to the Results property.


The completion status of a call that passed a PIAsynchStatus object can be determined in several ways. 



Not all objects that take a PIAsynchStatus object as an argument currently support the asynchronous behavior described above. Those calls will update the Status property, however they behave in a synchronous fashion, essentially blocking until the call is complete.


Important Note:

Asynchronous calls with "out" parameters that are not objects, must remain in scope until the call has actually finished. Objects can be kept alive during processing by the PIAsynchStatus object through reference counting but native types, for example a pointer to a float, can be deleted by the caller before the call is complete and when the PIAsynchStatus object attempts to write the result to that memory it can cause a crash.  It is the caller's responsibility to keep these arguments in scope.

Arguments returned from an asynchronous call are allocated for the user and become the responsibility of the user to cleanup.


Calls currently supporting true asynchronous behavior:

This object is independently creatable.

ProgID: PISDKCommon.PIAsynchStatus

Enabling Operational Intelligence