The following example connects an AI tag to the Horizontal Fill Percentage of a rectangle when you click it in the run-time environment. To connect an AI tag to the Horizontal Fill Percentage of a rectangle when you click it:
Dim lstatus as Long Rect1.Connect "HorizontalFillPercentage", _ "Fix32.Thisnode.AI.F_CV", lstatus
Before you click the rectangle, it is solid. After you click it, the rectangle starts to fill based on the AI tag's value. You have dynamically connected the rectangle's fill level to the database tag. Example: Changing the Data Source of an Animation Connected to an ObjectAs we discussed in the Working with iFIX Objects chapter, there are three different types of animation objects — Lookup, Linear, and Format. The example below shows you how to set an object, and change the source of the animation object that is connected to it while you are in the run-time environment. To set an object and change the source of the animation object that is connected to it:
Dim AllObj As Object Dim SingleObj As Object Dim Count As Integer Dim ObjCount as Integer
'Set AllObj equal to the collection of contained objects 'in the picture. Set AllObj = _ Application.ActiveDocument.Page.ContainedObjects
'Check how many objects are in the picture. For Each SingleObj In AllObj Count = AllObj.Count 'Look through all of the objects in the picture. While Count > 0 'If the current object (shape) has contained objects, 'check the number of objects (animations) it contains. If SingleObj.ContainedObjects.Count > 0 Then ObjCount = SingleObj.ContainedObjects.Count 'For each object contained in the current object, 'check its class name. While ObjCount > 0 Select Case _ SingleObj.ContainedObjects._ Item(ObjCount).ClassName 'If the contained object is a Lookup '(table), change the data source to 'FIX32.THISNODE.AI2.F_CV
Case "Lookup" SingleObj.ContainedObjects._ Item(ObjCount).Source = _ "Fix32.Thisnode.AI2.F_CV" 'If the contained object is a Linear object, 'change the data source to 'FIX32.THISNODE.AI2.F_CV
Case "Linear" SingleObj.ContainedObjects._ Item(ObjCount).Source = _ End Select
ObjCount = ObjCount - 1 Wend End If Count = Count - 1 Wend Next SingleObj
Both the Fill and Color animations change from the current value of AI1 to the current value of AI2. See AlsoChanging a Text Object's Caption Changing a Variable Object's Current Value Changing the Data Source of a Data Link How Do I... |
Important Notice You do not have the latest version of iFIX! You are missing out on the newest capabilities and enhanced security. For information on all the latest features, see the iFIX product page. For more information on upgrades, contact your GE Digital sales agent or e-mail [email protected]. For the most up-to-date documentation, go here. |