Accessing Animated Objects

Another method of performing efficient reads is accessing the value of an object that is already connected to a tag in the database. When you animate an object's property to a tag in the database, it creates a subscription to the database. Whenever this tag changes, that property will be changed to the tag's new value. If you read this property, you will be reading the value that is in the database without adding any additional overhead. You can use any object in any picture or in the globals page including event objects, variable objects, rectangle objects, and so forth.

Example

This example assumes that there exists a picture ("Picture") that contains an animated rectangle ("Rect1"). Rect1's horizontal position is animated to thisnode.tag.f_cv

Dim AO As Object

Dim Y As Single

 

Set AO = System.FindObject_

     ("Picture.Rect1.AnimatedHorizontalFillPercentage")

 

Y = AO.InputValue

'Get the current value of the animated horizontal position input

'which gets the value of thisnode:tag.f_cv