Occurs when a data source's value changes by more than the deadband limit or if the quality or error information associated with the data source changes.
The DataChange event occurs atthe end of data change processing, therefore, the animation or event object's internal state (properties) will reflect this change. The previous value is not stored in the object.
If the same events occur while the script is executing, the system queues one and only one event for this situation. That is, if multiple data changes occur, the next event firing reflects the newest information.
Syntax
object_DataChange(ByVal DataValue As Variant, ByVal TimeStamp as Date, ByVal Transition As Long, ByVal Reserved As Variant)
Properties
The DataChange event syntax has these parts:
Part |
Description |
Object |
An object expression that evaluates to an object in the Applies To list. |
DataValue |
The new data value. |
TimeStamp |
The time that this data arrived in the system. |
Transition |
Reserved, always 0. |
Reserved |
Reserved. |
Event Firing Definition
Value Transition |
Fire Event Sequence |
Uninitialized to True |
DataChange, OnTrue, WhileTrue |
True to False |
DataChange, OnFalse, WhileFalse |
False to True |
|
Uninitialized to Error |
DataChange |
Uninitialized to False |
DataChange, OnFalse,WhileFalse |
When data changes from an unknown state to a known state, the DataChange event triggers. Therefore, actions such as switching from the Configuration environment to the Run-time environment while an iFIX schedule is open will cause the DataChange event to trigger accordingly.
Using the DataChange Event in a Datalink
If you are attempting to use the DataChange Event in a data link, you cannot create the VBA object by selecting Edit Script from the right-click menu.
To create your own object:
- Create a data link.
- Open the VBA editor.
- Enter the Private Sub object_DataChange(ByVal DataValue As Variant, ByVal TimeStamp as Date, ByVal Transition As Long, ByVal Reserved As Variant) string and press Enter.
- Enter any desired code.
- Enter End Sub at the end of the subroutine.