Cicode Programming Reference > Cicode Function Categories > Tag Functions > SubscriptionGetTag

SubscriptionGetTag

Reads a value, quality and timestamps of a subscribed tag.

Syntax

SubscriptionGetTag(iHandle, sOffset )

iHandle

Integer handle of the subscription to read from.

sOffset

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

Returns a value, quality and timestamps of a subscribed tag. The type of the returned value depends on a type of the subscribed tag. The quality and timestamps of the subscribed tag are read and passed with the returned value.

Using SubscriptionGetValue gives similar results as using direct reference to a tag without item ex. tag1, tag1.Field.

On error, returns either 0 for numerical data types or an empty string for strings.

Related Functions

SubscriptionGetTimestamp, SubscriptionGetQuality, SubscriptionGetInfo, SubscriptionGetValue

Example

INT Value = SubscriptionGetTag(hSub);

See Also

Tag Functions

Published June 2018