Like to know how to get the total count of a tag that changes from 0 to 25 and repeat the same count (0 to 25) 16 times. I tried Compress Data and Calculated data functions with no success.
Thank you for the support. This tag is to count the times a pusher moves forward to load rows of containers into shelves. The pusher moves 25 times per shelve. After that, the counter reset to 0 then start the count for the next shelve. There are a total of 16 shelves, so the total expected count is 25 pushes * 16 shelves = 400 counts.
As per the statement i believe tag is changing from 0 to 25 and would like to know if there is any intermediate values in the range between 0 and 25 to taken into account.Also could you please let us know your second requirement interms whether we need to take range or how many times it is going below 0 and above 25?
For your 1st query you can use the Calculated Data Function and try the below Filter expression to find out the count if the tag value is between 0 to 25,
=PIAdvCalcFilVal("sinusoid","y","t","tagval('Sinusoid')>0 and tagval('Sinusoid')<25","count","event-weighted","compressed","10m",0,1,0,"\\PI Server")
For more details refer KB01637 - How do I count the number of specific PI Point values in a time period?
As Lal Babu Shaik mentioned, can you please provide more details regarding your second query.
To count the number of times the height limit is exceeded you should use the calculated data function with the following settings:
PrevVal('TAG') < 25 AND TagVal('TAG') >= 25
I was able to resolve my problem!! Thank you!!
I have another question. Is there a VBA code to add Buttons on the worksheet to set the Compressed Data Start time to different values? For example, one button to retrieve the past 12 hours, another button to retrieve the past 48 hours.
Thanks again for your help!!
Request you to check Run Compressed Data Codes Multiple Times VBA and it is similar to your requirement.
Retrieving data ...