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

Calculation of uptime for a TAG? Options · View
brmd
#1 Posted : Monday, October 10, 2011 1:23:28 PM
Rank: Newbie
Groups: Member

Joined: 6/17/2011
Posts: 3
Location: Denmark
Hi,


I'm building a control chart to monitor the stock status of a raw material in the facility I work. For a start, i'll build it in Excel, but it would be really nice, if I could set it up in ProcessBook as well.

In order to monitor and quantify the incoming amount of raw material to a storage tank, I need to set up a counter for the uptime of a pump (i.e. how many minutes has it been running the the last e.g. 7 days). I know that the pump will deliver about 1 tonne of the raw material per minute to the storage tank. Furthermore, I've set up a bit for the operation of the pump; 0 = off, 1 = on. How do I, for a defined period, where the number of operations is different over time, estimate the total uptime for the pump (in min.)?

I have a flow-meter at the output from the storage tank, and quantification of the output for the defined period of time is easy (using the DataLink | Calculated Data | Total function).


Thanks in advance
Brian Madsen



PI Datalink ver. 4.1.1.
MS Excel 2003 SP3.
PI ProcessBook 3.1.1.0.
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 : Tuesday, October 11, 2011 1:47:50 PM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
If you want to show this information in ProcessBook you will have to create a calculated tag or a dataset, each having their own pro's and cons.

I will build a calculated tag as this is a better long term solution.

Use the following format in the Exdesc attribute of the calculated tag, the timing of your calculation is based on your server configuration for the calculation subsystem.

TimeEQ('yourtagname','START_TIME','END_TIME',"YOUR_STATE")

Take care in "YOUR_STATE", notice the double quotes which you have to use since the tag is showing On/Off (Text). Give it a try and let us know if you run into any problems.
brmd
#3 Posted : Thursday, October 13, 2011 2:17:29 PM
Rank: Newbie
Groups: Member

Joined: 6/17/2011
Posts: 3
Location: Denmark
Now, I don't know if I did it right (VBA is quite new to me, but I'll learn every day!), and it might not be the way squatty suggested, but it seems to be working.

Placed the start_time, end_time end expression (''tag_name'=1) in different cells (A2, A4 and A6) and made a Time Filtered expression:

{=PITimeFilterVal($A$6;$A$2;$A$4;"minutes"; 0;"servername")}

This gives me the result I want! BigGrin
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.