| 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 |
When you finish using your OPC Toolbox objects, use the delete function to remove them from memory. After deleting them, clear the variables that reference the objects from the MATLAB workspace by using the clear function.
Note When you delete an opcda client object, all the group and item objects associated with the opcda client object are also deleted. Similarly, when you delete a dagroup object, all daitem objects associated with that dagroup object are deleted. |
To illustrate the deletion process, this example creates several opcda client objects and then deletes them.
Step 1: Create several clients
This example creates several opcda client objects using fictitious host and server ID properties.
da1 = opcda('Host1','Dummy.Server.1');
da2 = opcda('Host2','Dummy.Server.2');
da3 = opcda('Host3','Dummy.Server.3');
Step 2: Delete clients
Always remove toolbox objects from memory, and the variables that reference them, when you no longer need them.
You can delete toolbox objects using the delete function.
delete(da1) delete(da2) delete(da3)
Note that the variables associated with the objects remain in the workspace.
whos Name Size Bytes Class da1 1x1 636 opcda object da2 1x1 636 opcda object da3 1x1 636 opcda object
These variables are not valid OPC Toolbox objects.
isvalid(da1)
ans =
0
To remove these variables from the workspace, use the clear command.
Note You can delete toolbox object vectors using the delete function. You can also delete individual elements of a toolbox object vector. |
![]() | Configuring OPC Toolbox Object Properties | Saving and Loading Objects | ![]() |

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 |