Jump to content

  • Log in with Facebook Log in with Twitter Log in with Windows Live Log In with LinkedIn Log In with Google      Sign In   
  • Create Account

Photo

How to write values to the PI System from Excel using PIPutVal

PIPutVal manual input write Excel Lab Data

  • Please log in to reply
1 reply to this topic

#1 myDorazio

myDorazio

    Master

  • OSIsoft (opinion) L8
  • 400 posts
85 upvotes
Rhodium
  • LocationUSA
  • Contact info:nick@osisoft.com
  • Company:OSIsoft, LLC

Posted 20 September 2012 - 05:06 PM

Here is a question that our sales force and our trainers get often: Can I write values to the PI System from within Microsoft Excel? Here's OSIsoft Account Manager Adrian Birkett with an answer derived from the longer KB article [tech support login required] about the various ways to write data to PI.
  • 0

#2 AdrianB

AdrianB

    Learner

  • OSIsoft (opinion) L1
  • 1 posts
1 upvotes
Silver
  • LocationSalt Lake City, Utah
  • Company:OSIsoft LLC

Posted 20 September 2012 - 05:07 PM

Here is a question that our sales force and our trainers get often: Can I write values to the PI System from within Microsoft Excel?


There are many circumstances in which you may want to enter values directly into PI; examples include data from lab results, analog gauges and equipment testing. In a majority of cases, the best solution is to use the PIPutVal function in PI DataLink. For a quick start, download these two Workbooks (PIEXAM32.XLS and PISAMPUT.XLM) here: .

http://community.osi...leworkbookszip/

The files are installed with PI DataLink and may be available in your \PIPC\Excel\ directory. Note that you cannot create the PISAMPUT.XLM spreadsheet in newer versions of Excel because Excel no longer enables you to do so. However, you can still run this spreadsheet.

Both spreadsheets use the macro function: PIPutVal. PIPutVal replaces an existing event with the same timestamp in the PI Data Archive with the new value supplied by the user. Note that the PIPutValX function will not replace data with the same timestamp; PIPutVal will.

PIPutVal() --


Arguments.jpg
  • Can be invoked from PISAMPUT.XLM or from an Excel VBA module using the Application.Run method as shown in PIEXAM32.XLS. Here's the basic syntax: PIPutVal(tagname, value, time stamp, PIServer, outcell)
  • Does not check whether the number to be written falls within the user-specified range for a tag. The range for a tag is from the zero to the zero + span, where zero and span are tag attributes specified by the user during point (tag) creation. PI DataLink will return a value written message even though "Over Range" or "Under Range" might have been entered into the PI Server.
  • Supports all PI 3 data types (including string input to string tags) as well as sub-second data. Timestamps are interpreted using client machine time zone information unless the "Use PI Server Time Zone" option is enabled or it is a PI 2 Server.
For complete PIPutVal reference, see PI DataLink User Guide in English for version 2010 and later (4.2.x) - Page 112. Click here to download. [Tech support login required.]
  • 1





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users