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

Write to PI with Excel Formula? Options · View
milesUK
#1 Posted : Wednesday, December 21, 2011 4:05:12 PM
Rank: Advanced Member
Groups: Member

Joined: 5/28/2009
Posts: 75
Location: Cheshire, UK
I think I may already know the answer Sad but is it possible to write values to PI with Excel formulas only? That is without resorting to VBA, etc.

I only have a few values (text strings actually) to to write to a test server before we commit to tag build but I fear I may have to use some of the code on this site and tweak it a little.

Merry Xmas everyone. Smile
MilesUK
ProcessBook v3.0.15.3
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.
squatty
#2 Posted : Thursday, December 22, 2011 6:38:49 AM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
Hi milesUK

Good question, but I still think you will have to use either the SDK or PIPutVal() macro, see below an extract from the PI-Datalink help file

While standard PI DataLink functions retrieve data from a PI server, one function allows you to write a value from a worksheet to a PI server. The Excel macro function PIPutVal() replaces an existing PI archive event with a matching timestamp with a new value supplied by the user.

PIPutVal() can be run only in an Excel 4.0 macro sheet, or in VBA using the application.run method. See the putval_code module in the piexam32.xls distributed with PI DataLink, and in particular the tags marked PutVal and the VBA module PutVal_code, for an example of a VBA module used to enter PI functions in a spreadsheet.

Note that VBA does not recognize PI DataLink functions, but you can formulate a function as a text string, and then set the formula Array property of a range of cells to the text string value. The VBA code can then check the cell values for the PI function results. This yields the same results as manual entry of PI functions in the same range of cells.

Ditto on the merry Xmas
milesUK
#3 Posted : Thursday, December 22, 2011 8:16:44 AM
Rank: Advanced Member
Groups: Member

Joined: 5/28/2009
Posts: 75
Location: Cheshire, UK
sqautty, thank you for that info. you're quite right I'll have to resort to my meagre VBA skills again. We don't yet have any string type tags so these are all new to us.

cheers,
MilesUK
ProcessBook v3.0.15.3
squatty
#4 Posted : Thursday, December 22, 2011 8:26:45 AM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
We use PI to insert our downtime and losttime data. At the end of the month we use filter expression calculations to count frequencies and shift performances, we even go as far as to calculate production bonusses MTD, this really gets the operators into a frenzy as they can now see the impact of their actions on their bonusses.
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.