Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

Count bags from a weight tag

$
0
0

I have a PI-tag for a weight (PI-WEIGHT) and want to find how many bags I am weighing from this weight. 

 

The weight is giving data from every 4 second until every 30 second. A exemple would be like this:

 

100

140

170

150

200

250

300

150

0

 

As you can see the weight can go down at one point without the weighing is finished (from 170 to 150 and up to 200). in reality from these numbers there where only one bag finished there had a weight of 300 KG.

 

I have tryed to use this formula to count the bags:

=PIAdvCalcExpVal("(prevVal('PI-WEIGHT') > 200 and TagVal('PI-WEIGHT') < 200)";Starttime;Endtime;"total";"event-weighted";"interpolated";"1m";0;1;0;"PISERVER")

this give an error: Failed to retrieve events from server.  [-11110] Error with sample time array specification

 

The values I want to know:

  1. What are the bags weight?
  2. How many bags are finished between starttime and endtime?

Hope any can help :)


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>