|
|
Rank: Newbie Groups: Member
Joined: 2/1/2011 Posts: 7 Location: Santiago, Chile
|
Hello guys: I'm learning the PI Systems and i really want to know how can i get the % of all the points captured in a tag where the pctgood is = 100 I've found on the PI Datalink manual that i could use : ('PCTGOOD'('tag')=100,'start_date','end_date') But all i get is an invalid syntaxis error. Of course... i'm doing something wrong, but what?!?! Thanks for the help!! Greetings from Chile
|
|
|
|
|
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: 5/28/2009 Posts: 75 Location: Cheshire, UK
|
krillin837, hi and welcome to the board. The PI historian database will hold both the valid data (GOOD numerical values for example) that you want plus non-value data items ("No Data", "Bad", etc) . %Good therefore indicates the split of good (numerical for exampe) values as opposed to the non-good(!). Code:PCTGOOD('tag','start_date','end_date') would return such as percentage. That is, the proportion of database entries that are useful values as opposed to entries that are warnings, errors, etc. I could not find the syntax you used Code:('PCTGOOD'('tag')=100,'start_date','end_date') Which document and page is it in? There are more experienced guys on this forum than myself so expect other responses. happy PI'ing. regards, miles MilesUK ProcessBook v3.0.15.3
|
|
|
Rank: Newbie Groups: Member
Joined: 2/1/2011 Posts: 7 Location: Santiago, Chile
|
Hi Miles! Thanks for your response. I've found that code on the PI DataLink User Guide.pdf downloadable from the OSISOFT website I'm sorry, but i can't give you right now the full URL because the login website from OSISoft is blocked on my network... This is on the Users Manual, so i adapted to PCTGOOD instead of ABS "The expression below evaluates to true (non-zero) if the absolute value of the tag mytag is at least 14.65. (abs('my:tag') >= 14.65)". This is on page 84  How can i use the code that you provided me?. I'm really a newbie on this system.... sorry :( Thanks so much!!
|
|
|
Rank: Advanced Member Groups: Member
Joined: 5/28/2009 Posts: 75 Location: Cheshire, UK
|
krillin837, Some PI Formulas in DataLink can return the Percentage Good as part of the results - just tick the box. This gives the user an indication of how many good data values there are (as opposed to “Bad Input” for example). For example: Code:PICalcVal(tag,"*-1h","*","maximum", 1, 4,"server") Will return the Maximum value from those stored in ‘tag’ in that last hour (*-1h to *) and will also show the percentage of values that are usable (or Good) within that hour. I looked for one our tags that gave a %Good <100 and here are the results for the max calculation shown above. Code:03-Feb-11 08:06:41 3.6MW 99.83% The tag had a Bad Value for 6 seconds of the hour. Why I'm not sure – something I'll have to look into. regards, miles (PS I'm off Friday to Monday) MilesUK ProcessBook v3.0.15.3
|
|
|
Rank: Newbie Groups: Member
Joined: 2/1/2011 Posts: 7 Location: Santiago, Chile
|
Quote:The issue is that, that TAG has at least 40% of questionable, bad or shutdown data so it's really weird that PI shows me a 83.83378546% of good data. Is your 40% event weighted or time weighted? PCTGOOD is time weighted so it will give you the % of time over your time range the data was good rather than the % good of events. EDIT: Apologies, I edited your post by accident...could you re-post
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Excellent examples there from Miles! (Thanks) Maybe I am missing something in the translation but are you saying you have a single PI tag that you want to know what % of the PI values were good for a time range? In Datalink you could all use an archive PI expression: Code: =PIExpVal("pctgood('sinusoid','*-1h','*')","*", 1,"server")
If you really just wanted a Boolean if you have 100% good values then you could use: Code: =PIExpVal("pctgood('sinusoid','*-1h','*')=100","*", 1,"server")
Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 2/1/2011 Posts: 7 Location: Santiago, Chile
|
Hi!! I've tried with your PI Expression by modifiying that Code: =PIExpVal("pctgood('sinusoid','*-1h','*')","*", 1,"server")
to this Code: =PIExpVal("pctgood('SAG:NIVLLENX','31-12-08 23:00:00','01-10-10 22:59:59')","*", 1,"Teniente")
And all i've got was a beautiful Invalid Expression Syntax The issue is that i've used it before without the long date ('31-12-08 23:00:00','01-10-10 22:59:59') and it worked... but it was showing me a value of 4023.xxxxxxx when it supposed to be a %. I really don't know what am i doing wrong. Can you help me guys step by step?? Like.... Go to the PI Menu and select Advanced Calcuation, then.... blah blah blah. Thanks so much and i'm sorry, but i'm learing
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Best to use month names... Code: =PIExpVal("pctgood('SAG:NIVLLENX','31-Dec-08 23:00:00','01-Oct-10 22:59:59')","*", 1,"Teniente")
In Excel... PI -> Archive Value Select PI Expression Enter pctgood('SAG:NIVLLENX','31-Dec-08 23:00:00','01-Oct-10 22:59:59') Enter timestamp as * Hit OK. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Advanced Member Groups: Member
Joined: 5/28/2009 Posts: 75 Location: Cheshire, UK
|
Not wanting to step on Rhys' toes after his kind words about me above  but there may be an extra "*" in the function. Code:=PIExpVal("pctgood('SAG:NIVLLENX','31-Dec-08 23:00:00','01-Oct-10 22:59:59')","*", 1,"Teniente") Code:=PIExpVal("pctgood('SAG:NIVLLENX','31-Dec-08 23:00:00','01-Oct-10 22:59:59')", 1,"Teniente") However I have used that function and it returns the current date date so I suspect that the syntax is correct. MilesUK ProcessBook v3.0.15.3
|
|
|
Rank: Advanced Member Groups: Member
Joined: 5/28/2009 Posts: 75 Location: Cheshire, UK
|
Ah, the perils of simultaneous posting! Rhys, does that function/syntax then return the %Good for the period between the two dates but timestamps it with the time of evaluation? MilesUK ProcessBook v3.0.15.3
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
It does indeed. Using the Archive value function in this way is just a round about way of executing a performance equation that returns a single result. You can use it though to provide a relative % good by using relative times in the expression too. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 2/1/2011 Posts: 7 Location: Santiago, Chile
|
I've followed the Admins solution and again... i've got an Invalid Syntax I use copy / paste on the expression
|
|
|
Rank: Newbie Groups: Member
Joined: 2/1/2011 Posts: 7 Location: Santiago, Chile
|
Guys.... Let me refrase it. I've realize that the calculation that i was previously doing was correct. It gave me the pctgood average of all GOOD point.... The thing is that i need to include the bad ones too. We need to improve things to prevent as much as we can bad data from getting into the DB. According to COUNT, i've got in the previous time range (from 31-12-08 to 01-10-10) 55 millions of points that nearly 40% is questionable, bad, I/O Timeout, etc. Is there a way to count that bad data?? That way i can do: good data  = Total data - bad data and then... good % = good data * 100 / total data Thanks so much and sorry for bothering you guys 
|
|
|
Rank: Advanced Member Groups: Member
Joined: 5/28/2009 Posts: 75 Location: Cheshire, UK
|
krillin837, Surely the %Good of ALL the good points is 100%. The average of that would also be 100%. If 40% of the data is questionable (Bad, etc) then that means that you have 60% Good data. Percentage Good = 60%! 60% of 55million = 33million. Too simplistic I'm sure. So, how do you define Good Data if Good Data is not all Good? Or are the bad ones those PI points that have never had data at all? These show up on our system as "Pt Created" I think. I am of course basing my thoughts/comments on my understanding of my own system and data. This may not be comparable to your own. I can only apologise that I cannot fully understand your circumstances. regards, miles MilesUK ProcessBook v3.0.15.3
|
|
|
Rank: Newbie Groups: Member
Joined: 2/1/2011 Posts: 7 Location: Santiago, Chile
|
Hi Miles!! Quote: Surely the %Good of ALL the good points is 100%. The average of that would also be 100%.
If 40% of the data is questionable (Bad, etc) then that means that you have 60% Good data. Percentage Good = 60%!
60% of 55million = 33million. Too simplistic I'm sure. Think
Actually no... If you are using the Compress Data function to retrieve PI points you will see that not all values have a 100% of PCTGOOD. They might actually get 99% or less. But if you are using (like me) the Advanced calculation function to retrieve data from a non totalizer PI point, you may actually get less than 80% or less. If you are using this function all PI points captured on the day will get an average. If the range qualify as good data (more than xx%) you might be getting the calculation even with a 50% of PCTGOOD. If the data isn't enough "trustable". The calculation will tell you "Not enough good values". Quote: So, how do you define Good Data if Good Data is not all Good?
Or are the bad ones those PI points that have never had data at all? These show up on our system as "Pt Created" I think.
I was thinking on a way to count every value within the date range that i need. Something like the Count option within the Compress Data function, and then nest a formula in Excel by cheking first if the value as something different than a number > 0. I've read this on the PI Datalink Manual (page 18) "Good values are event values determined to be valid by the PI server, and not in an error state. The percentage of good values helps in assessing the reliability of calculations built on PI point values, particularly if calculated values are to be used in further calculations." So, according to that, all bad values are text (excluding the ones you have created like ON or OFF) and all good values are numbers. The Pt Created is defined as a bad data but it shouldn't be because that values shows the user or admin that a PI point has been created and after that the PI point can retrieve data from the DCS or anything connected to it. Quote: I am of course basing my thoughts/comments on my understanding of my own system and data. This may not be comparable to your own. I can only apologise that I cannot fully understand your circumstances.
Hehehhe.... Don't worry... you've been an amazing help. We will figure it out Greetings!!
|
|
|
|
Guest
|