Connect Method Example

The following example ties the value of the TEMP1 output string to the Caption property of the Text object Text1.

A connection is a one-way mechanism. Therefore, changes to the caption property directly (via OLE automation) will not be written to the connected source. Also, it may be necessary to transform the data from one type or range to another to create the appropriate user interface (i.e. numeric to string, numeric to color, numeric to screen coordinates). To accomplish this, an animation object should be used (Linear, Lookup, Format).

Dim objAnim as Object

Dim lngStatus as Long

'Create the animation object

Set objAnim = Rect1.BuildObject("Linear")

'Initialize the Linear object's properties

objAnim.Source = "Fix32.Scada1.AI1.F_CV"

'Set up transformation in and out range parameters

objAnim.AutoFetch = True 'Set it to fetch limits

objAnim.UseDelta = True 'Set it for relative movement

objAnim.LoOutValue = 0 'Set low output value

objAnim.HiOutValue = 15 'Set high output value

'Connect the animation object's output to the rectangle's position

Rect1.Connect "HorizontalPosition", objAnim.FullyQualifiedName & ".OutputValue", lngStatus