PIAliasList2 Example

Option Explicit

Private Sub Command1_Click()
Dim aliasList2 As New PIAliasList2
Dim mod1 As PIModule
Dim mod2 As PIModule
Dim curMod As PIModule
Dim myAlias1 As PIAlias
Dim myAlias2 As PIAlias
Dim curAlias As PIAlias
Dim sinTag As PIPoint

Set sinTag = PISDK.Servers.DefaultServer.PIPoints("Sinusoid")

Set mod1 = PISDK.Servers.DefaultServer.PIModuleDB.PIModules.Add("Mod1")
Set mod2 = PISDK.Servers.DefaultServer.PIModuleDB.PIModules.Add("Mod2")

Set myAlias1 = mod1.PIAliases.Add("Sinusoid", sinTag)
Set myAlias2 = mod2.PIAliases.Add("Sinusoid", sinTag)

aliasList2.Insert myAlias1
aliasList2.Insert myAlias2

For Each curAlias In aliasList2
   Set curMod = curAlias.Parent
   MsgBox "Module name = " & curMod.Name & " Alias name = " & curAlias.Name
Next
End Sub

  
Enabling Operational Intelligence