Skip to content
Menu
Menu

Knowledge Base

KB110005 | TIMERS IN CUSTOMITEM SCRIPTS

KB110005 | TIMERS IN CUSTOMITEM SCRIPTS

Summary

For timed operations, Elvis offers a whole range of ready-made elements (time programs, sequences, metronome). Sometimes, however, you also need time-dependent behavior for your own scripts. This article discusses the ways to make that happen.

Details

Option 1: Time Input

This method is suitable when it comes to times and accuracies from 10 seconds.

Define an input variable of type DateTime and bind it to a time data point (e.g. TimeUTC in the system port) when using the CustomItem. As a result, this input variable is updated periodically (usually every 10 seconds) and the Execute method is called accordingly.

Option 2: Using timers

It is also possible to use timers. This can be one of the Timer classes available in the .NET Framework, or better the TimedCallbackService available in the Elvis server, which calls a given method at a specified time. One difficulty here is that Elvis only evaluates changes in the output variables after an execute call, but not if it occurs “spontaneously”. Therefore, the script must inform Elvis of changes to output variables that occur within the method called by the timer.

Download Script

Support Area

KB110005 | TIMERS IN CUSTOMITEM SCRIPTS

Knowledge Base

Here you will find answers, solutions to problems and examples of our products.
KB110005 | TIMERS IN CUSTOMITEM SCRIPTS

Case Studies

Successful in use: practical examples of our products and individual developments.
KB110005 | TIMERS IN CUSTOMITEM SCRIPTS

Support

Describe your concern using our support form.
KB110005 | TIMERS IN CUSTOMITEM SCRIPTS

License registration

Register your Elvis license!

IT GmbH · An der Kaufleite 12 · D-90562 Kalchreuth

© Copyright 2024. IT GmbH | Webdesign by Appear Online