Using the Workbench to define a Timer Variable
The Timer Variable is a Timer functionality that helps with scheduled triggers, counting runs and computing elapsed time.
The feature helps with time processing, measuring time in operations and other adaptable uses.The Timer can only be created in a Global Variable Device. To create one, follow the steps listed bellow:
When creating a timer, first select the Global Variable Type;
Under Variables, click on Configure and create a new variable called "Timer", or other name that you might prefer. Select the type TIMER from the Type Dropdown. Add the new variable and save before closing the window.
Finish the process of creating the new device and Start it. The new timer Global Variable Timer will appear, with 6 variables for the timer object. Those would be:
Variable Type Description Acc INT8 The time, in milliseconds, accumulated the moment the timer is started. Done BOOL Determines if the timer has reached its predetermined time. It is set to True once the timer has reached the end of its count. Elapsed INT8 Time in milliseconds accumulated the moment the timer is started. The Elapsed variable will continue to count in the background even if the timer is stopped, updating to how much time has passed from when the timer has stopped and resumed. Enable BOOL A boolean that determines the current status of the timer. True if the timer is currently running. False if it isn't. Preset INT8 The time in milliseconds of how long the timer should run before enabling the Done boolean. State String(16) A String that describes the current state of the timer. Options are: Stopped, Started and Done.