Scripts
- Last UpdatedJan 03, 2023
- 1 minute read
You can use the InTouch scripting language, QuickScript, to build more robust applications. There are eight types of scripts and many built-in script functions available.
Scripts can be classified by when they are run and whether they run independently of other ongoing application processes. Scripts can generally be run in two different ways:
-
Event-based scripts run once when an event occurs. For example, an event-based script can run after an operator presses a key or a tag value changes.
-
Time-based scripts run periodically while a condition is fulfilled. For example, a time-based script can run while a window is open or a button is kept pressed.
You can configure multiple event-based and time-based scripts to run with the same trigger. For example, you can configure a script to run once when a key is pressed and another script to run periodically every 5 seconds while the same key remains pressed.
You can use conditional statements, loops, and local variables in the scripting language to create complex effects in your application.
For condition scripts you can either run a script synchronously or asynchronously.
-
When a synchronous script runs, all InTouch animation and tag value updating stops. Then, animation and tag value updating resumes after the script stops.
-
When an asynchronous script runs, all InTouch animation and tag value updating continues during the period when the script runs.
The built-in script functions include mathematical functions, trigonometric functions, string functions, and others. Using these functions saves you time in developing your application.
InTouch scripts can include Object Linking and Embedding (OLE) objects and ActiveX controls.