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

Historian SDK

Reusing Existing Historian Server Tags

If there is some tag already created on the historian server, and the SDK application should just use that tag to send data, then it needs to get the tag metadata instance from the server.

This can be accomplished by the GetTagInfoByName() method of the HistorianAccess class.

Example

HistorianAccessError error;
HistorianTag serverTag;                  
if (!historian.GetTagInfoByName("MyServerTag", true, out serverTag, out error))
    Console.WriteLine("Server tag query error: {0}", error.ErrorDescription);

After the tag metadata instance was successfully fetched from the historian server, it could be used directly as the first argument for the AddTag() method call. The managed HCAL tag metadata synchronization mechanism will determine that the tag metadata is identical to the one already existing on the historian server and will not attempt to overwrite it.