Main Content

cleareventlog

(To be removed) Clear event log, discarding all events

Support for the OPC Data Access (DA) standard will be removed in a future release. Instead use OPC Unified Architecture (UA). See Compatibility Considerations.

Syntax

cleareventlog(DAObj)

Description

cleareventlog(DAObj) clears the event log for opcda object DAObj. DAObj can be an array of objects. cleareventlog also discards any events stored in the EventLog property of the objects.

Examples

Create a connected client and configure a group with two items:

da = opcda('localhost','Matrikon.OPC.Simulation');
connect(da);
grp = addgroup(da,'ClearEventLogEx');
itm1 = additem(grp,'Random.Real8');
itm2 = additem(grp,'Triangle Waves.UInt1');

Run a 10-second logging task, and after 5 seconds perform an asynchronous read of the group:

grp.UpdateRate = 1;
grp.RecordsToAcquire = 10;
start(grp);
pause(5);
tid = readasync(grp);
wait(grp);

Examine the event log size:

el = da.EventLog

Clear the event log:

cleareventlog(da)
el2 = da.EventLog

Version History

Introduced before R2006a

expand all