| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → OPC Toolbox |
| Contents | Index |
| Learn more about OPC Toolbox |
start(GObj)
start(GObj) starts a data logging task for GObj. GObj can be a scalar dagroup object, or a vector of dagroup objects. A dagroup object must be active and contain at least one item for start to succeed.
When logging is started, GObj performs the following operations:
Generates a Start event, and executes the StartFcn callback.
If Subscription is 'off', sets Subscription to 'on' and issues a warning.
Removes all records associated with the object from the OPC Toolbox software engine.
The Start event is logged to the EventLog.
GObj will stop logging when a stop command is issued, or when RecordsAcquired reaches RecordsToAcquire.
Configure and start a logging task for 30 seconds of data:
da = opcda('localhost', 'Matrikon.OPC.Simulation');
connect(da);
grp = addgroup(da, 'StartEx');
itm1 = additem(grp, 'Triangle Waves.Real8');
itm2 = additem(grp, 'Saw-toothed Waves.UInt16');
set(grp, 'LoggingMode', 'memory', 'UpdateRate', 0.5, ...
'RecordsToAcquire', 60);
start(grp);Wait for the logging task to finish, then retrieve the records into a double array and plot the data with a legend:
wait(grp); [itmID, val, qual, tStamp] = getdata(grp, 'double'); plot(tStamp(:,1), val(:,1), tStamp(:,2), val(:,2)); legend(itmID); datetick x keeplimits
flushdata | getdata | peekdata | stop | wait
![]() | showopcevents | stop | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |