Description
The "SubscribeTag" command subscribes one or more tags for monitoring. The following properties are monitored:
-
Tag value
-
Quality
-
Quality code
-
Time stamp
"NotifiySubscribeTag" always returns all monitored tags, even if only the value of one monitored tag changes. The change can be a change to the quality code, time stamp or tag value. The order of tags in the response corresponds to the order in the "SubscribeTag" request.
It is permitted to have the same tag monitored by multiple "SubscribeTag" calls.
Request
{"Message":"SubscribeTag","Params":{"Tags":["<Tag>","<Tag>"]},"ClientCookie":"<Cookie>"}
-
Tags: List of the tags to be monitored -
ClientCookie: Is used for "UnsubscribeTag" and to assign the notification to its monitoring.
For example:
{"Message":"SubscribeTag","Params":{"Tags":["Tag_0","Tag_1"]},"ClientCookie":"mySubscription1"}
Response
OnSuccess
{"Message":"NotifySubscribeTag", "Params":{"Tags":[{"Name":"<Tag>", "Quality":"<Value>", "QualityCode":"<Value>", "TimeStamp":"<Value>", "Value":"<Tag value>", "ErrorCode":<Value>, "ErrorDescription":"<Error text>"}, {"Name":"<Tag>", "Quality":"<Value>", "QualityCode":"<Value>", "TimeStamp":"<Value>", "Value":"<Tag value>", "ErrorCode":<Value>, "ErrorDescription":"<Error text>"}]}, "ClientCookie":"<Cookie>"}
For example:
{"Message":"NotifySubscribeTag", "Params":{"Tags":[{"Name":"Tag_0", "Quality":"Good", "QualityCode":"192", "TimeStamp":"2019-01-30T11:25:35Z", "Value":"16", "ErrorCode":0, "ErrorDescription":""}, {"Name":"Tag_1", "Quality":"Uncertain", "QualityCode":"76", "TimeStamp":"2019-01-30T11:25:35Z", "Value":"1", "ErrorCode":-2147483620, "ErrorDescription":"Tag does not exist"}]}, "ClientCookie":"mySubscription1"}
OnError
{"Message":"ErrorSubscribeTag", "ErrorCode":<Value>, "ErrorDescription":"<Error text>", "ClientCookie":"<Cookie>"}
For example:
{"Message":"ErrorSubscribeTag", "ErrorCode":-2147483621, "ErrorDescription":"Subscription could not be created", "ClientCookie":"mySubscription1"}