|
|
Rank: Member Groups: Member
Joined: 12/29/2010 Posts: 10
|
Hello, is it possible to create a PI calculation to retrieve a value at the current starttime from the processbook-display? Maybe something like: Code: TagVal('<tagname>','STARTTIME')
|
|
|
|
|
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.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
tompkins wrote:Hello, is it possible to create a PI calculation to retrieve a value at the current starttime from the processbook-display? Maybe something like: Code: TagVal('<tagname>','STARTTIME')
Can you give more details as to what you want to achieve? PI Calculation? Within Pbook as dataset or as a configured pi tag. Current StartTime? This is confusing, current = now, starttime could be anything
|
|
|
Rank: Member Groups: Member
Joined: 12/29/2010 Posts: 10
|
I have a processbook display with some values and trends. With the TimeRange-Command in then Toolbox, i can change the start- and stoptime for the complete display. I want to create a value-field wich depends on the given startime for the display.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
The display by itself does not have a starttime, the object inside processbook might have, depending on the object.
Example: A value only shows the current value, but a trend object will have a start and end time.
Scenario: When the display is actived\opened\updated you can write the startime of a trend into a control of your choice.
Solution: Click on Help in processBook and select "PI ProcessBook VBA Language Reference". I'm not sure what version of PBook your running, but the later version has a VBA guide. Look into the following
object.SetTimeRange "-1h" "*"
where object is the name of your trend. Once again, I don't like posting VBA code on here, but I'm always willing to help.
|
|
|
Rank: Newbie Groups: Member
Joined: 8/26/2011 Posts: 8 Location: California
|
Hello again, I need to do something similar to what was posted above.
Is there a command in pi processbook that will return a tag's value at a given time?
I tried to do this through PI datalink, but it's not ideal and I'm now encountering problems with it. I have tried: myGhost = Excel.Application.Run("PIArcVal", TagName1, myTimes(i), 0, myServer, "auto") myValues(i) = myGhost(1) (this was within a for)
Basically, I'm trying to allow the end user to move the trend start and end times around, then calculate the slope of one of the traces on the trend, and then automatically make some calculations off of that. I can do the above with just the points in the trace, however, I noticed that the number of points varies significantly based on the time window chosen (even 3 mins longer changes the number of points in a trace significantly). This changes the slope of the trace, and therefore the final calculation.
Any help would be greatly appreciated..
|
|
|
|
Guest
|