Syntax
BOOL Start(BOOL bAsync=FALSE );
Parameters
bAsync |
Flag that determines whether synchronous or asynchronous processing will be used by the XASMgr. TRUE = Asynchronous processing will be used. FALSE = Synchronous processing will be used. |
Remarks
It is anticipated that an XASMgr is going to be a multi-threaded application. The start method provides two means for this multi-threading to be accomplished.
If you pass the parameter as FALSE, functionality continues to run in the main thread and will not return until the CIMPLICITY project shuts down.
If you choose this method, then you will probably either already have created your own thread, or anticipate doing it within OnInited. The need for your own thread is anticipated as it is expected that the alarms you will be managing are probably occurring in an asynchronous fashion, and you will need to interact independently with external devices in a fashion that could not be supported by the unpredictability of callbacks from the CExternalAlarmManager internals.
If you pass the parameter as TRUE, then CExternalAlarmManager creates its own thread of execution, and the Start call returns after that thread has been spawned.
The next normal action to occur will be a call to the OnInited method. At the point CExternalAlarmManger calls this method all preparations have been successfully completed to allow this XASMgr to generate alarms. Do not attempt to generate or otherwise modify alarms before OnInited has been called. If you do, those actions will not be handled appropriately, as initialization has not been completed.
CExternalAlarmManager methods and command handlers. |