| OPC Toolbox™ | ![]() |
opcreset
opcreset -force
opcreset disconnects and deletes all OPC Toolbox objects. Any data that is stored in the buffer is flushed, all asynchronous operations are canceled, and open log files are closed.
You cannot reconnect a toolbox object to the server after it has been deleted. Therefore, you should remove it from the workspace with the clear function.
Note that you cannot call opcreset if an opctool session is open, or if Simulink® models containing OPC Toolbox blocks are open. Close all opctool sessions and all open Simulink models containing OPC Toolbox blocks before calling opcreset.
opcreset -force closes all open opctool sessions and all Simulink models containing OPC Toolbox blocks, without prompting to save those sessions and models. You will lose any unsaved changes to those sessions and models if you use the -force option. Use the -force option only as a last resort.
This example creates an opcda object, and adds a group to that object. The OPC Toolbox objects are then deleted using opcreset, and all variables are cleared from the workspace.
da = opcda('localhost','Dummy.Server');
grp = addgroup(da);
opcreset; % Deletes all objects
% Clear the variables
clear da grp
opcfind
clear, delete, opcfind, opctool
![]() | opcregister | opcserverinfo | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |