save

Save OPC Toolbox objects to MAT-file

Syntax

save FileName
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 Toolbox™ objects, Obj1, Obj2, ... to the specified MAT-file, FileName. If an extension is not specified for FileName, then a .MAT extension is used.

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.

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

See Also

| | |

Was this topic helpful?