YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Obtaining value from Datapoint in PI an easier way? Options · View
Jboy
#1 Posted : Wednesday, May 04, 2011 12:47:21 PM
Rank: Member
Groups: Member

Joined: 4/12/2011
Posts: 10
Location: Uk
Hello All,

Dont forget, using an old version of PI here.

Right at present, I can get a value from a current data point in PI by doing this:

Code:

Dim PIdatapoint1 As Variant
Value18.SetName ("\\workserver\Tank1.FS")
PIdatapoint1 = Value18.GetValue(vrDate, vrStatus)

Msgbox PIdatapoint1


However, that means I must have "Value18" already on the workbook.

Is it possible to get the data for Tank1.FS without needing it as a value already on the workbook?

Thanks

J
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
OlJo69
#2 Posted : Tuesday, June 14, 2011 2:40:44 PM
Rank: Newbie
Groups: Member

Joined: 3/4/2011
Posts: 6
Location: France
Hi JBoy,

It's not a big deal using PISDK :

Code:
Dim myPoint As PIPoint
Set myPoint = PISDK.Servers.DefaultServer.PIPoints("CDT158")
MsgBox myPoint.Data.Snapshot.Value

or even easier
Code:
MsgBox PISDK.Servers.DefaultServer.PIPoints("CDT158").Data.Snapshot.Value


But I saw on another of your post you don't have access to it.
Have you tryed to dynamically create a value object ?

Code:
Dim Obj As Value
Set Obj = Application.ActiveDisplay.Symbols.Add(pbSymbolValue)
Obj.Enabled = True
Obj.SetTagName ("\\" & PISDK.Servers.DefaultServer & "\CDT158")
(replace the "PISDK.Servers.DefaultServer" by your server's name)
The code here drops you a value symbol at the top left corner of the current display.

Hope that helps Smile

O.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.