Retrieving General Connection Information
This section describes additional connection methods for retrieving connection information and making connections. These methods include CanConstruct, Construct, GetPropertyAttributes, and ValidateSource.
GetPropertyAttributes Method
The GetPropertyAttributes method retrieves a list of property attributes for the specified Data Item object. For a tag reference, these are properties such as new alarm status and property range information (EGU limits, list of strings alarm strings (HIHI, LOLO, etc.)). Each property queried may have a different set of attributes. For more information on this method, refer to the iFIX Automation Interfaces Electronic Book.
Object.GetPropertyAttributes(FullyQualifiedName As String, _
Attribute As Long, (Returned) Results, (Returned) _
AttributeNames, (Returned) Status As Long)
Example: Script Using the GetPropertyAttributes Method
The following example fetches the attribute information for the HighEGU attribute of the AI1 block on node NODE1.
Dim vtResults
Dim vtAttributes
Dim lStatus As Long
Dim strLoEGU as String
Dim LoEGUval
Oval1.GetPropertyAttributes "FIX32.NODE1.AI1.F_CV", 3, vtResults, vtAttributes, lStatus
strLoEGU = vtAttributes(0)
LoEGUval = vtResults(0)
In the above example, the variable strLoEGU will now hold the string "FIX32.NODE1.AI1.A_ELO" and the variable LoEGUval will hold tag AI1's low EGU value.
CanConstruct Method
The CanConstruct method checks a data source reference for valid syntax. The CanConstruct method must have the default data system defined as part of the object name. For example, the object name AI would not work correctly.
Object.CanConstruct(ObjectName As String, (Returned)_
CanConstruct As Boolean)
Example: Script Using CanConstruct Method
The following example determines whether the datasource AI1 for NODE1 has valid syntax for the Picture TestPicture.
Dim bCanConstruct As Boolean
TestPicture.CanConstruct "FIX32.NODE1.AI1", bCanConstruct
Construct Method
The Construct method launches the Quick Add user interface and prompts you for information needed to create the tag. If Status returns 0, then the tag has been created:
Object.Construct(ObjectName As String, (Returned) Status _
As Long)
Example: Script Using Construct Method
The following example displays the QuickAdd user interface that prompts the user for the information needed to create the tag NewAI1 for the Oval object Oval1 on node NODE1.
Dim lStatus As Long
Oval1.Construct "FIX32.NODE1.NEWAI", lStatus
ValidateSource Method
The ValidateSource method determines if a data source exists:
Object.ValidateSource(Object As String, (Returned) Status _
As Long, (Returned) Object As Object, (Returned) _
PropertyName As String)
Example: Script Using ValidateSource Method
The following example validates the AI1 source for the Oval Oval1.
Dim iStatus As Long
Dim iObj As Object
Dim sPropName As String
Oval2.ValidateSource "AI1", iStatus, iObj, sPropName