Callback function file to execute when error event occurs
You configure ErrorFcn to execute a callback function file when an error event occurs. An error event is generated when an asynchronous transaction fails. For example, an asynchronous read on items that cannot be read generates an error event. An error event is not generated for configuration errors such as setting an invalid property value, nor for synchronous read and write operations.
When an Error event occurs, the function specified in ErrorFcn 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 'Error'. The Data field contains a structure with the following fields:
The local time (as a date vector) the event occurred.
The transaction ID associated with the event.
The group name.
A structure containing information on each item that generated an error during that transaction.
The Items structure array contains the following fields:
The item name.
The error message.
The default value for ErrorFcn is @opccallback.
Note that error event information is also stored in the EventLog property.
string, function handle, or cell array
@opccallback is the default callback function.