Documentation Center

  • Trial Software
  • Product Updates

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:

set(grp, 'UpdateRate', 1, 'RecordsToAcquire', 10);
start(grp);
pause(5);
tid = readasync(grp);
wait(grp);

Examine the event log size:

el = get(da, 'EventLog')

Clear the event log:

cleareventlog(da)
el2 = get(da, 'EventLog')
Was this topic helpful?