Save OPC Toolbox objects to MAT-file
save FileName Obj1 Obj2 ...
save can be used in the functional form as well as the command form shown above. When using the functional form, you must specify the file name and toolbox objects as strings.
Any data associated with the toolbox object will not be stored in the MAT-file. The data can be brought into the MATLAB workspace with getdata and then saved to the MAT-file using a separate variable name.
The load command is used to return variables from the MAT-file to the MATLAB workspace. Values for read-only properties will be restored to their default values upon loading. For example, the Status property for an opcda object will be restored to 'disconnected'. You use propinfo to determine if a property is read-only.
Create a connected client and configure a group with two items. Then save the group.
da = opcda('localhost', 'Matrikon.OPC.Simulation'); connect(da); grp = addgroup(da, 'ClearEventLogEx'); itm1 = additem(grp, 'Random.Real8'); save mygroup grp