Timers and Timing
The functions listed here can help you write code that will execute on schedule. Developers who are creating tag-based expressions should note that the Trigger tag is designed for exactly this purpose, and in certain cases may be easier to use than an expression.
VTScada includes an application property at the \Code level named SecondFlasher. The value of this property changes from 0 to 1 once a second, as near as possible to the change of the second. In most cases, it is better to watch for the change of \SecondFlasher than to burden the system with an additional function to calculate one-second intervals.
AbsTime(Enable, Interval, Offset)
When enabled, becomes true when any multiple of Interval seconds since midnight has passed. Times that are not evenly divisible by Interval can be obtained by adding an offset. Because this function is tied into the real time clock, it is not subject to drift as is the TimeOut function. It is useful when you want to tie an event to a particular time of day rather than to a fixed time delay.
CurrentTime(Type)
Returns the number of seconds since Jan 1, 1970. Set Type to 2 for UTC time.
TimeArrived(UTCTime)
Becomes true when the specified time (in UTC format) arrives.
RTimeOut(Enable, NumSeconds)
A cumulative timer. Becomes true when NumSeconds have passed. This is similar to TimeOut, except that it remembers the elapsed time accumulated so far, even when the enable parameter is false. For example, it can be used to test when a certain piece of equipment reaches a specific total cumulative running time.
TimeOut(Enable, NumSeconds)
A continuous timer. Becomes true when an uninterrupted NumSeconds have passed. This function is often used in action triggers to cause an event to occur after a time delay. If the time of the event is meant to be relative to a randomly occurring event, TimeOut would be the most appropriate function to use.