Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

Using VBA To Get A Value Of A PI Tag Associated With PIAlias

$
0
0

Using VBA in ProcessBook I am trying to get the value of a PI tag that is associated with a PIAlias in the module database. Is there a way to get the current value or snapshot value of a pi tag associated with a PIAlias without creating an object in ProcessBook? My objective is to look at the value of a PIAlias in the Module Database, and based on its value I would then like to perform other programming tasks.

 

In a related question is there a way to avoid using the Module Database altogether? I would very much prefer to find a way to link and loop through the elements in the Asset Framework using VBA in ProcessBook.

 

Here is some pseudocode of the loop I am trying to create:

iCountPIAliases = iSubMod3.PIAliases.Count
Do While n <= iCountPIAliases
    strAttribute = iSubMod3.PIAliases.Item(n)
    strAttributeName = strAttribute.Name
    If strAttributeName Like "[target tag name]" Then
        
        F I N D   T H E   V A L U E
        
        If (the value fits the condition) Then
            D O   S O M E T H I N G
        End If
        
    End If
n = n + 1
Loop

Any tangible help to either solve this riddle or go a new direction with AF is greatly appreciated.


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>