AnsweredAssumed Answered

C# Restful Service - How to Query PI

Question asked by jorgewong on Jun 18, 2015
Latest reply on Jun 18, 2015 by bshang

I'm trying to write a restful service that is in C# and I'm looking to query PI with queries like below.  I'm not finding any code snippets on how to accomplish then.  Does anybody have experience doing this?  For the particular query below I'm trying to get back the stale count of a interface based on the point source and stale range I have set.


SELECT count('a') as Stalecount


FROM piarchive..pisnapshot


WHERE tag IN (


SELECT tag FROM pipoint..classic


WHERE pointsource = 'XYZ'


and location1=5 and scan=1)


AND ((DATE('*') - time) BETWEEN RELDATE('30h') AND RELDATE('365d') OR status <> 0)


AND tag not like '**'