skip to content

PI Query of one tag based on the value of another

Hi, I've been trying to figure out how to get the value of a PI tag based on the value of a second tag into a cell in Excel.  I want to know the value of the second tag the entire time the first tag is a certain value.  Thanks...

Single quotes for tagnames

Single quotes for tagnames and timestamps, double quotes for strings.
E.g. '210-X-998'="GA3109"
Check out the extremely useful PEReference help file, usually found in C:\Program Files\PIPC\Help\PEReference.chm
 
PIAdmin.

Yes, that's exactly right,

Yes, that's exactly right, I've tried it when checking against numbers, I can't quite figure it out with a string value, I'm trying a filter expression like this:
'210-X-998'='GA3109'
but it does not like my syntax.

Hi Ryan C,   If you have

Hi Ryan C,
 
If you have DataLink then this should be pretty easy. Am I right thinking that you want to show the value of Tag B when Tag A is equal to a certain value? If so then you can use Compressed Data or Sampled Data with a filter. Request values for TagB but use a filter expression so that values are only returned when the expression evaluates to true.
If you check the 'Mark as Filtered' option you should see when one or more values were not returned because Tag A did not match your value.
For example:

See image
The filter expression here says only return values when TagA is exactly 100. Be sure to carefully wrap the tagname in single quotes!
HTH, PIAdmin.

Powered by Drupal. CrystalX theme created by Nuvio | Webdesign.