Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

Daily report of value greater than X for X minutes

$
0
0

Hi Guys,

Well this is my first question here...

I need to create a daily report (with DataLink) of one variable, grouped based on low limit, ignoring conditions based on time range.

My report must to be like this table:

 ---------------------------------------------------------
| Start		      | End                 | Status      |
|---------------------|---------------------|-------------|
| 15/02/2013 00:00:00 | 15/02/2013 02:05:48 | value >= 30 |
| 15/02/2013 02:05:48 | 15/02/2013 04:48:14 | value < 30  |
| 15/02/2013 04:48:14 | 15/02/2013 06:30:02 | value >= 30 |
| 15/02/2013 06:30:02 | 15/02/2013 08:05:43 | value < 30  |
| 15/02/2013 08:05:43 | 15/02/2013 12:25:08 | value >= 30 |
| 15/02/2013 12:25:08 | 15/02/2013 14:18:37 | value < 30  |
| 15/02/2013 14:18:37 | 15/02/2013 21:35:15 | value >= 30 |
| 15/02/2013 21:35:15 | 16/02/2013 00:00:00 | value < 30  |
 ---------------------------------------------------------

Remember when i have a values lower than 30 in the interval less than 5 minutes i must ignore and consider all period > 30.

To do this,
I made a auxiliar sheet with the following structure (minute by minute).

 --------------------------------------------------------------------------------------
|1 |COL A               | PITimeFilterVal                                              |
|--|--------------------|--------------------------------------------------------------|
|2 |14/02/2013 59:59:00 |                                                              |
|3 |15/02/2013 00:00:00 | PITimeFilterVal("'TAG' < 30",$A2,$A$3,"hours", 0,"X") = 0    |
|4 |15/02/2013 00:01:00 | PITimeFilterVal("'TAG' < 30",$A3,$A$4,"hours", 0,"X") = 0    |
|5 |15/02/2013 00:02:00 | PITimeFilterVal("'TAG' < 30",$A4,$A$5,"hours", 0,"X") = 0    |
|6 |15/02/2013 00:03:00 | PITimeFilterVal("'TAG' < 30",$A5,$A$6,"hours", 0,"X") = 0.15 |
|7 |15/02/2013 00:04:00 | PITimeFilterVal("'TAG' < 30",$A6,$A$7,"hours", 0,"X") = 1    |
|8 |15/02/2013 00:05:00 | PITimeFilterVal("'TAG' < 30",$A7,$A$8,"hours", 0,"X") = 1    |
|9 |15/02/2013 00:06:00 | PITimeFilterVal("'TAG' < 30",$A8,$A$9,"hours", 0,"X") = 0.13 |
 --------------------------------------------------------------------------------------

So, with VBA I run throught this sheet and build a report like first table.

Anyone has a better idea to do it? Or a natuaral way with PI tools?

Thanks a lot.


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>