0

Task - Program: with 'dirty variable'

Marco Fernandes 7 months ago in General updated 7 months ago 3

Good Morning.

I'm using a calculation to count the pulses and also to reset the record counter, but when the power goes out and the server shuts down, when the variable in question is restarted it starts with a random / dirty value.



So, I would like to get help on how I could solve this problem. Is there a possibility to use a global variable or an INIT, so when the server is restarted, does the LIMIT variable keep the required value [10,000]?

Thanks.

+3

Hi,


- Create a Task

- Set the trigger to General\Time.Minute OnChange (AllowRetrigger) for example

- On the command, Add, Set Value, choose your integer, set the value to a fixed value of 10000

This way, every minute the integer will be fixed to 10000

If the server restarts or something, right after the first minute elapses, your integer should be fixed to 10000 again

+1

Probably you can also add a second trigger to the Task, like Building.Started = True (AllowRetrigger)