We have developed a .NET application (a service) that is quering PI records from piarchive..picomp2 for records periodically. We use PI OleDB interface towards PI. Today we use the following kind of query:
SELECT tag, time, value, status, DIGSTRING(status) statusText FROM piarchive..picomp2 WHERE tag = '18DYP1071A' AND time > CAST('2011-09-27 23:51:31.0000000' as DateTime) AND time <= CAST('2011-09-27 23:53:31.0000000' as DateTime) ORDER BY time ASC
The application does not know the tag type to be queried.
We have a problem related to digital tags. Using the query above, the sql will return the 'code' column value for the digital tags. We are basically interested in the 'offset' value. Anyone knows if this can be retrieved such that the query also could be executed for tags of type float?
For information: The digital tags might be configured such as:
code offset name digital set
-196608 0 Manual Manual
-196609 1 Auto Manual
Does anyone have a good description of digital tags, digital sets that also describes the columns of pids..pids?