Main Content

isvalid

True for undeleted OPC objects

Syntax

A = isvalid(Obj)

Description

A = isvalid(Obj) returns a logical array, A, that contains false where the elements of Obj are deleted OPC objects and true where the elements of Obj are valid objects.

Use the clear command to clear an invalid toolbox object from the workspace.

Examples

Create two valid OPC data access objects, and then delete one to make it invalid:

da(1) = opcda('localhost','Dummy.ServerA'); 
da(2) = opcda('localhost','Dummy.ServerB'); 
out1 = isvalid(da)
% Delete the first object and show it is invalid:
delete(da(1)) 
out2 = isvalid(da)
% Delete the second object and clear the object array:
clear da

Version History

Introduced before R2006a

See Also