Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Historian SDK

Deleting Tags

Tags can be deleted only when the historian server is available. Tag deletion can be performed by the DeleteTags() method of the HistorianAccess class. SDK applications are not allowed to delete tags belonging to IDASs or Wonderware Application Server.

Example

HistorianTagStatusList tagsToDelete = new HistorianTagStatusList();

HistorianTagStatus tag1 = new HistorianTagStatus();
tag1.TagName = "FirstTagToDelete";
tagsToDelete.Add(tag1);

HistorianTagStatus tag2 = new HistorianTagStatus();
tag2.TagName = "FirstTagToDelete";
tagsToDelete.Add(tag2);

HistorianAccessError error;
if (!historian.DeleteTags(ref tagsToDelete, out error))
    Console.WriteLine("Failed to delete tags: {0}", error.ErrorDescription);

if (!tag1.Pending && tag1.ErrorOccurred)
    Console.WriteLine("Tag deletion error: {0}", tag1.Error.ErrorDescription);

if (!tag2.Pending && tag2.ErrorOccurred)
    Console.WriteLine("Tag deletion error: {0}", tag2.Error.ErrorDescription);

The tag deletion procedure consists of building a list of tag status objects, one tag status object per tag to be deleted, and then verifying on a tag-by-tag basis whether deletion of any particular tag has succeeded, if necessary.