Type: BCS.Sym3.Operator.Server.IServerTagService
Tag service
Methods
Subscribe(System.String,System.Object,System.Object)
Subscribe to a tag value update event and specify a function as the callback when an update occurs.
- Parameters:
- tagName: The tag name, this must exist within the tag manager. The name is case sensitive.
- theObject: An object that is associated with the subscription, this object will be passed to the callback function. If no object is required then ’null’ may be passed.
- function: Reference to the callback function that will be invoked when an update occurs
- Returns:
- The return value is a numeric identifier that is unique for this subscription; it may be saved for later use. It is required parameter of the function used to unsubscribe to updates.
- Example:
Server.Tags.Subscribe("Tag1", "my object", Tag1Callback)
...
function Tag1Callback(tagName, id, value, quality, theObject)
{
System.Windows.Forms.MessageBox.Show("Value Changed: " + tagName + " - " + id + " - " + value + " - " + quality + " - " + theObject)
}
UnSubscribe(System.Int32)
Called to unsubscribe to tag value update event
- Parameters:
- id: The return value from a previous call to ‘Subscribe’. The value uniquely identifies the subscription to the system