SubscriptionGetAttribute
- Last UpdatedJul 18, 2023
- 2 minute read
Reads the specified attribute value of a subscribed tag. Similar to TagRead.
Note: This function has been superseded and may be deprecated in a future release. Please use the following functions: SubscriptionGetInfo, SubscriptionGetTimestamp, SubscriptionGetQuality, SubscriptionGetValue or SubscriptionGetTag as substitutions in new projects.
Syntax
SubscriptionGetAttribute(iHandle, sAttribute [, iOffset] )
iHandle
Integer handle of the subscription to read from.
sAttribute
Attribute of the tag to read. Supported Attributes are:
ClusterName - Returns the resultant cluster context of the subscription. For example, for the tag subscribed as "cluster1.tagname", the return value is "cluster1".
There are several possible outcomes where no cluster is specified in the subscription:
• If the tag is a local tag, an empty string will be returned.
• If the tag is a variable tag and the system only contains one cluster, this cluster will be returned.
• If the tag is a variable tag and there is a default cluster being run in the Cicode, the default cluster will be returned.
• If none of these options are true, an empty string will be returned.
FullName - Return the full subscription name. For example, for the tag subscribed as "cluster1.tagname", return value is "cluster1.tagname". If the tag was subscribed without a cluster the return value will be the tagname.
TagName - Return the tagname for the subscription. For example, for the tag subscribed as "cluster1.tagname", return value is "tagname".
Value - The current value of the tag.
ValueQuality - An indication of the current quality of the tag as an integer number.
Note: The return value is not compatible with the QUALITY data type or the quality Cicode functions. Use SubscriptionGetQuality.
ValueTimestamp - The time when the tag last changed. It is returned as an integer value compatible with a time/data variable.
Note: The return value is not compatible with the TIMESTAMP data type. Use SubscriptionGetTimestamp.
ValueTimestampMS - The millisecond part of the time when the tag last changed.
iOffset
Optional integer expressing the zero based index of an array attribute. This is only valid for the Value attribute. Default value is 0.
Return Value
String representation of the cached value for a subscribed tag. On error, an empty string and an error is set.
Related Functions
SubscriptionGetInfo, SubscriptionGetTimestamp, SubscriptionGetQuality, SubscriptionGetValue, SubscriptionGetTag