arash.khoddamy

ttsym.GetTagName return the Wrong Pi Tag

Discussion created by arash.khoddamy on Mar 17, 2009
Latest reply on Mar 26, 2009 by arash.khoddamy

I have written a custom tooltip application. But we noticed that for Tag names that that have a period in them the ttsym.GetTagName(TrendTraceNo) returns the wrong Tagname. I have to note that this only happens for tags with period in the name for all other tags everything works fine.

 

The tag names in question all have the form Tag.modifier.

 

So Here are the Tag names that we have trended

 

SCA_RES_Forebay_Lvl_00
SCA_RES_Forebay_Lvl_00.NMin
SCA_RES_Forebay_Lvl_00.NMax
SCA_RES_Forebay_Lvl_00.DSNotice
SCA_RES_Forebay_Lvl_00.DSIncident

 

It seems that the ttsym.GetTagName(TrendTraceNo) does not get the full Tagname and stops at the period. When I put a message box on display the output form ttsym.GetTagName(TrendTraceNo) I only get “SCA_RES_Forebay_Lvl_00” no matter what tag I am on.

 

My code is as follows

 

For Me.TrendTraceNo = 1 To ttsym.PtCount 
   
   If InStr(Left(Tooltip, InStr(1, Tooltip, "=") - 2), Right(CStr(ttsym.GetTagName(TrendTraceNo)), (Len(CStr(ttsym.GetTagName(TrendTraceNo))) - InStr(3, CStr(ttsym.GetTagName(TrendTraceNo)), "\")))) > 0 Then
   
        Exit For
    
    End If
    
Next TrendTraceNo

' Get PI server and Tagname for this value.
PIServerNameTagName = ttsym.GetTagName(TrendTraceNo)
    
' Get this value's PI Server name
PIServerName = Mid(PIServerNameTagName, 3, (InStr(3, PIServerNameTagName, "\") - 3))
    
' Get this value's PI Tagname
PITagName = Right(PIServerNameTagName, (Len(PIServerNameTagName) - InStr(3, PIServerNameTagName, "\")))

 

The problem comes when I use the TrendTraceNo to get the Tagname. For all traces I get the base Tagname ending at the period. So for the example above no matter what tag I hover over I only get “SCA_RES_Forebay_Lvl_00” as the Tagname

 

It seems that the ttsym.GetTagName(TrendTraceNo) does not get the full tagname and stops at the period. When I put a messebox on display the output form ttsym.GetTagName(TrendTraceNo) I only get “SCA_RES_Forebay_Lvl_00” no matter what tag I am on.

 

Is there another way i can get the tagname that won't haev this problem?

Outcomes