cancel
Showing results for 
Search instead for 
Did you mean: 

How to get counter value from Historian

shaji_chandran
Participant
0 Kudos

Hi Experts,

We have got a scenario to keep the number (counter) to see how many time a value of tag have been changed.

For Example:


If the values change from 1 to 0 and  0 to 1 for 25 times in a minute. We would like to get this number (25) from Historian (Wonderware).

Currently we are not using any Pco to fetch the value from Hisotrian since we are able to fetch the tag values from Historian database through SQLConnection.

I would like to know if we introduce Pco, will that help us to get this counter value.

We are working on MII 15.0 version.

Any help of this very much appreciated.

Thanks

Shaji

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

One of the easy way which i can think is get the values of tags in last 25 min using PCO HDA in and the number of records. I guess for each changes in values database must have different time stamps.

Otherwise when Pco is used we need to store each update count whenever PCo query is called to modify the data.

Hope it may help

former_member196557
Active Contributor
0 Kudos

Hi Shaji,

Are you using the MII InSQLPCo Data Server and a PCoQuery TagAgreggateMode to execute a Count Aggregate against this tag?

Regards, Steve


shaji_chandran
Participant
0 Kudos

Hi Steve,

Thanks for your quick response.

No we are not using InSQLPco and PcoQuery. We are relying on SQL Database connection (Jdbc Driver)  to Historian Database. I would like to know if we make a Pco connection through OPC DA Agent and I use PcoQuery with TagAggreggateMode will this help me?

Thanks

Shaji

former_member196557
Active Contributor
0 Kudos

Hi Shaji,

PCo OPC DA does not support  PCoQuery TagAggregateMode as it only has access to Current Values of OPC Tags, because OPC DA only provides Current Value access.

I know it is possible to execute SQL queries against the Wonderware Historian to retrieve counts aggregates, but don't have the details handy. Recommend that you deploy the InSQLPCo Data Server in MII and try using the PCoQuery TagAggregateMode method to retrieve the Counts aggregate first.

Regards, Steve

shaji_chandran
Participant
0 Kudos

HI Steve,

Thanks again for your support.

Is there any other Agent gives PCoQuery TagAggregateMode  apart from InSQLPCo ?

Thanks

Shaji

former_member202228
Active Participant
0 Kudos

Make a calculated tag in Wonderware to count the occurrences for you, when the value changed over a moving window .. then you read the current tag value via PCo / inSQLPCo.

You can't rely on the DB only because in the case of implementations transferring lots of data, the runtime table is getting updated with certain delays.