Wonderware InTouch Tutorials - Types of Script

InTouch QuickScripts

All InTouch Quick Scripts are event driven. The event may be a data changer, conditional, mouse click, timer, and so on. the order of processing is application specific.

Script type and Description

Application script - Linked to the entire application.

Window script - Linked to a specific window that you have Opened.

Key script - Linked to a specific key or combination on the keyboard key.

Condition script - Linked to a discrete tagname or expression

Data Change script - Linked to a tagname and / or tagname.field only

Action Push button script - Associated with an object that you link to an Touch Link - Action Push button

Application Script

The Application Scripts are linked to the entire application. You can use application scripts to start other applications, create process simulations, calculate variables, and so on. There are three types of Application Scripts that you can apply to an application

On Start up : Executes one time when the application is initially started up.

While Running :

On Running : Executes continuously at the specified frequency while the application is running.

On Shutdown : Executes one time when the application is exited.

image

Double click on Application in Script menue

image

You can change condition type from while running to On Startup or On Shutsown as per your requirement

Window Scripts

Window Scripts are linked to a specific window. There are three types of scripts that you can apply to a window:

Window Script and Description
On Show : Executes one time when the window is initially shown.
While Showing : Executes continuously at the specified frequency while the window is showing.
On Hide : Executes one time when the window is hidden.

You can also right-click a blank area of an open window, and then click Window Scripts. If a script exists for the selected window, it will be displayed.

image

Key Scripts

Key Scripts are linked to a specific key or key combination on the keyboard. You can use them to create global keys for the application.

For example, returning to a main menu window, logging off the operator, and so on. There are three types of Key Scripts that you can apply to a key:

On Key Down : Executes one time when the key is initially pushed down.
While Down : Executes continuously at the specified frequency while the key is held down.
On Key Up : Executes one time when the key is released.

Application Explorer under Scripts, double-click Key. The Key Script editor
appears.

image

By clicking on key select action key from keyboard

(Open in Full Screen)

Condition Scripts

Condition Scripts are linked to a discrete tagname or expression that equates to true or false. You can also use discrete expressions that contain analog tagnames. There are four types of scripts that you can
apply to a condition

On True : Executes one time when the condition transitions to true.
On False : Executes one time when the condition transitions to false.
While True : Executes continuously while the condition is true.
While False : Executes continuously while the condition is false.

To Check create Following window by Shown objects and assigned tags
Slider --> slider
light --> light

image

In On True Condition type condition is “slider>50”
that means when slider value is higher than 50 light will be turned on

image

In On False Condition type condition is “slider>50”
that means when slider value is not higher than 50 means condition is False light will be turned Off

image

Result Preview

image

image