cancel
Showing results for 
Search instead for 
Did you mean: 

Tag query:History Event Mode

Former Member
0 Kudos

Hi All,

I am handling many Tags in a single Tag Query.

I Want to pull the data which is at 5:30 am and if there is no data at 5:30 am,I want to get the ist record just before 5:30 am,

Using History event mode and passing SD and ED as same date 5:30 am and rowcount as 1.

Few Tags does have data at 5:30 am and few Tags does not have data at 5:30 am.

In result,it is happening like this:I am getting the data after 5:30 am for those Tags which does not have data at 5:30 am.

Is their any way to handle my requirement in Tag query.

Thanks & Regards

Manisha

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

There is no traditional way with standard tag query calls to accomplish this.  Each historian works a bit differently, and of course the recording frequency of an actual event may differ for each tag.  Sticking with HistoryEvent and not asking for enough time in your date range leading up to 5:30 may not yield any results, and it would be a bit of a guessing game as to what RowCount to set - either way, a high row count or an overly broad time window would likely be less than desireable for the tag(s) that are recorded quite frequently.

Perhaps a less desireable option is to simply use History mode and allow the Historian to do the effective interpolation for the desired StartDate/EndDate, and this would ideally be close to the value it would have been at exactly 5:30AM.

Some historians support a direct JDBC query interface, or an OleDB connection that you could write a direct query for this scenario, but that would of course be very data source specific.

Former Member
0 Kudos

Thanks Jeremy.

Currently I am using History mode and start date and end date same date with timestamp 5:30 and rowcount as 1.

e.g.I am passing 24th Oct 5:30 as start date and end date,rowcount as 1.So I am getting 5:30 am interpolated value for 24th Oct.

I would like to know few things:

I am using PI Historian.By using OLEDB connector,we can achieve my scenario by SQL query.But I am passing 40  to 50 Tags in tag query.As per my knowledge OLEDB SQL query is not recommended for handling multiple Tags.Also performance issue comes in OLEDB connector.So Tag Query is the best option for handling multiple Tags.

Are these correct?

Regards

Manisha

Former Member
0 Kudos

Hi Jeremy,

Can we pass 30 to 40 Tags to a single OLEDB Query?Is there any performance issue?I am using PI historian and xMII 11.5.

Suppose for a month,I would like to get each day 5:30 am data and if there is no data at 5:30 am,then I want to get the lat record before 5:30 am.can we achieve this by using OLEDB query?

What about performance?

Thanks & Regards

Manisha

jcgood25
Active Contributor
0 Kudos

The specific capability of the query, its underlying performance, and possibly the number of tags would really fall onto the datasource - in this case OSI Soft PI.  The OleDB request is handled like an SQL Query and passed through from MII to PCo/UDS to the data source, just like a query to a database.

The syntax and what query support exists for the specific scenario you're trying to accomplish will be OSI specific.  I've seen Proficy Historian requests like the one you describe, but you'll have to find the syntax in the help docs or online community.  Perhaps someone has already done a direct query to PI and can share a sample.

Former Member
0 Kudos

Thanks Jeremy.

Answers (0)