proberts

Unable to create the PISDK. PI Data References will not function.

Discussion created by proberts on Feb 9, 2012
Latest reply on Jul 26, 2016 by Guilherme Ferreira

Navigating down AF structure successfully, I've reached the AF object I wish to interrogate.
It has two attributes I'm interested in:-

 

1. maxLevel, which is just a value in the attribute
2. Lvl, which is a pi tag value.

 

The maxLevel returns the correct value, but the lvl is crashing with the above message, even
though there is a try-catch immediately surrounding it.

 

Does anyone have any idea how to correct this?

 

Failing that, how can I identify the Pi tag name in the Af object - I can then switch to PI SDK
and get the value myself...

 

Code snippet  listed below...
Peter

 

 

 
Dim maxLvl As OSIsoft.AF.Asset.AFValue
maxLvl = cell.Attributes("maxLevel").GetValue  ' this works

Try
  Dim lvl As New OSIsoft.AF.Asset.AFValue
  lvl = cell.Attributes("level").GetValue  ' this crashes spectacularly - Pi tag is involved....

Catch ex As Exception
  Debug.Print ex.Message
End Try

 

 

 

 

 

 

Outcomes