Callback function file to execute when data change event occurs
You configure DataChangeFcn to execute a callback function file when a data change event occurs. A data change event occurs for subscribed active items within an active group when the value or quality of the item has changed. The events will happen no faster than the time specified for the UpdateRate property of the group. The DeadbandPercent property is used to determine what percentage change in the value or quality initiates the callback. A data change event is only generated when both the Active and Subscription properties are 'on'.
When a data change event occurs, the function specified in DataChangeFcn is passed two parameters: Obj and EventInfo. Obj is the object associated with the event, and EventInfo is an event structure containing the fields Type and Data. The Type field is set to 'DataChange'. The Data field contains a structure with the fields defined below.
The time, as a MATLAB® date vector, that the event occurred
0, or the Refresh transaction ID if the data change event was generated by refresh
The group name
A structure containing information about each item whose value or quality updated
The Items structure contains the fields defined below.
The item name
The data value
The time, as a MATLAB date vector, that the server's cache was updated
Data change event information is not stored in the EventLog property
string, function handle, or cell array
The default value is an empty matrix ().