History Lists and Sampling

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
Kurtz
Posts: 12
Joined: Wed Jan 09, 2019 2:37 pm

Just can't quite figure this one out. I'm populating a history list every refresh (40ms), will be either 0s or 1s. Now I want to pop the sum of the entries for the last 1 second into another Stored Value which I use to trigger an alert.

It's the Sampling dropdown that's confusing me. What is its relevance?

I'm just after the sum of the entries in the last second. The dialog page does give me the option to sum a range from a History List and set the period of the sum i.e the last second. Seems good enough at this point.

However if I select every second for sampling what does this give me? There should be 25 entries for every second and I only seem to be getting the value of one of them.

It seems the sum won't work unless I add a sampling period, if I use 1 second the resulting sum is always 1 if I use 0.5 sec then its 2. The returns I am expecting can go from 0 to 25 (all 0s or all 1s) but all I get is 0s, 1s or 2s

Is there any way I can just get the sum without the sampling?
eatyourgreens
Posts: 302
Joined: Sun Feb 18, 2018 12:53 am

hi,
I think! you need to do something like this,

store the values you want 0 or 1 into say history list 1, rearm every refresh.

store a value in history 2 with value in history list 1, plus the value of history list 2, rearm every refresh.

if you then clear the values in history list 2 armed every second, I !think! you should end up with the total 1 or 0s in history list 2 for the previous 1 second.

hope I am right!, I am sure Dallas or James, or all worthier than me could confirm!

good luck!
Kurtz
Posts: 12
Joined: Wed Jan 09, 2019 2:37 pm

Thanks for having a go eatyourgreens.

If I understand you correctly, I build up a total in History List 2 and if it hits my target an alert is fired. Then after each 1 second period I reset History List 2 value to 0.

I'm not sure this is going to work for me as my aim is to have at every refresh (40ms) the sum of the prior values up to a second ago. If you like a rolling total every 40ms.

Your suggestion I think gives me only 1 second chunks and my worry is if the last half of one chunk and first half of the next chunk hit my target for an alert this will not be picked up as there is no rollover from one second to the next.

Much appreciate you chipping in, I think I'll sleep on this and see if I can think of something that might work.

At the moment I'm thinking 25 Stored values each updating from the previous at each 40ms refresh. Then Using the sum stored Values feature to get the total. Bit of a long way round though.
Post Reply

Return to “Bet Angel - Automation”