Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

cleareventlog

Clear event log, discarding all events

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

Introduced before R2006a

Was this topic helpful?