I think this can be done by the combination of a PE tag and a Totalizer Tag. First I would create a PE tag call it "Fliptag1s", this tag is suppose to change value every second, and it will be used as the source tag for Totalizer tag later. Attributes for the PE tag:
exdesc: If 'Fliptag1s'=1 then 0 else 1
Then I will create a Totalizer tag to count the time of the condition when Digital tag A is True and Float32 tag B is between 5 and 10. Following are some important tag attributes for this totalizer tag:
EventExpr: ('A'=="True") And ('B'>5) And ('B<10')
Above totalizer configuration is not complete, you still need to specify the conversion factor, period, and offset. All these settings depend on the time unit you would like to have for the Totalizer tag. If you need some reference manual for configuring totalizer tag, please check the
"PI Server Application User Guide" in our TechSupport download center.