An interesting thread came up on the OSIsoft Users Community that I'd like to copy here that may be of interest to beginning users of the PI SDK.
A user posted this:
Hi. I am trying to use the PiCurrVal function from inside a vba macro. If I was the write the formula (below, eq1) into a cell, it will correctly return the tag value. However I am so far unable to call this from VBA. I believe the formula is from the pipc32.xll addin, and I have enables this in tools>refrences. I would expect the correct code to be as shown in (below, eq2), however this does not work. I am new to this forum, can anybody shed some light?
eq1. PICurrVal("gtt2515.fin", 0, "AUSLFDKN4")
eq2. Pipc32.PICurrVal("gtt2515.fin", 0, "AUSLFDKN4")
In references check PISDK 1.3 Type Library
Dim srv As Server
Dim pt As PIPoint
Set srv = PISDK.Servers.DefaultServer
Set pt = srv.PIPoints("sinusoid")
curval = pt.Data.Snapshot
Set srv = Nothing
Set pt = Nothing