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:
- What are the bags weight?
- How many bags are finished between starttime and endtime?
Hope any can help