Parameter Notifications
|
<< Click to Display Table of Contents >> Navigation: Parameters > Parameter Notifications |
There are two mechanisms for attaching event handlers for parameters.
Firstly, the BncsFramework provides global events OnManagedParameterChange and OnMonitoredParameterChange.
Secondly, via IBNCSInstanceParameter, individual parameters also provide OnManagedParameterChange and OnMonitoredParameterChange. It is important to note, however, that parameters retrieved with GetInstanceParameter must be retrieved with the clone parameter set to false, an event handler associated with a cloned parameter will never fire.
The IBNCSInstanceParameter event will always be called in preference to the BncsFramework and BncsFramework will ONLY be called where a parameter has no event handler attached.
OnMonitoredParameterChange provides a notification only that a monitored parameter has changed.
OnManagedParameterChange has the ability to intercept and cancel a requested parameter change. The BNCSManagedParameterChangeEvent argument has an Action property that can be used to modify the event processing. There are three options:
•Continue - the change will have been deemed to be approved by the driver and will be notified to all internal dependencies.
•Cancel - the value is deemed not to have been approved or the driver has sent the value to the connected device and a separate device monitoring process will confirm the change and broadcast it to the BNCS network. Any further processing of the change is cancelled.
•Reverse - the value is deemed not to have been approved but, rather than cancelling further processing, the old value is instead re-asserted.
A full explanation of these different actions can be found earlier in this document under the Infodriver Notifications topic.