Main Content

save

Save OPC objects to MAT-file

Syntax

save FileName
save FileName Obj1 Obj2 ...
save('FileName','Obj1','Obj2',___)

Description

save FileName saves all variables in the MATLAB® workspace to the specified MAT-file, FileName. If an extension is not specified for FileName, then a .mat extension is used.

save FileName Obj1 Obj2 ... saves OPC objects, Obj1, Obj2, ... to the specified MAT-file, FileName. If an extension is not specified for FileName, then a .mat extension is used.

save('FileName','Obj1','Obj2',___) provides the functional form of syntax. When using the functional form, you must specify the file name and toolbox objects as character vectors or 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.

Examples

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

Version History

Introduced before R2006a

See Also

Functions