| OPC Toolbox™ | ![]() |
M-file callback function to execute when asynchronous write completes
You configure WriteAsyncFcn to execute an M-file callback function when an asynchronous write operation completes. You execute an asynchronous write with the writeasync function. A write async event occurs immediately after the server notifies the client that data has written to the device.
When a write async event occurs, the function specified in WriteAsyncFcn 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 'WriteAsync'. The Data field contains a structure with the fields defined below.
FIeld Name | Description |
|---|---|
LocalEventTime | The time, as a MATLAB® date vector, that the event occurred. |
TransID | The transaction ID for the asynchronous write operation. |
GroupName | The group name. |
Items | A structure containing information about each item whose value or quality was written. |
The Items structure contains the fields defined below.
FIeld Name | Description |
|---|---|
ItemID | The item name. |
Write async event information is stored in the EventLog property.
Access | Read/write |
Applies to | dagroup |
Data type | string, function handle, or cell array |
Values | The default value is @opccallback. |
![]() | Value | Block Reference | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |