Products & Services Solutions Academia Support User Community Company

Learn more about OPC Toolbox   

Saving and Loading Objects

Using the save command, you can save an OPC Toolbox object to a MAT-file, just as you would any workspace variable. This example saves the dagroup object grp to the MAT-file myopc.mat.

save myopc grp

When you save a toolbox object, all the toolbox objects in that object hierarchy are also saved. For example, if you save a dagroup object, the client, all groups associated with that client and all items created in those groups are saved along with the dagroup object. However, only those objects you elect to save will be created in the MATLAB workspace. Other objects will be created with no reference to them in the workspace. To obtain a reference to an existing OPC Toolbox object, use the opcfind function.

To load a toolbox object that was saved to a MAT-file into the MATLAB workspace, use the load command. For example, to load grp from MAT-file myopc.mat, use

load myopc

  


Recommended Products

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