Wonderware Programming – A Step-By-Step Learning Guide

Posted by

Hello, Wonderware InTouch users. If you has spent some reasonable time in Wonderware InTouch in making simple applications, your next goal could be acing Wonderware Programming. But in order to ace it you must have basic knowledge of it.

In light of this, i have prepared this post for all of you. That is, especially for people who are new to Wonderware Programming. However, this post is written in such a manner that it covers basic to advanced programming concepts. So, if you are new to programming learn here mentioned concepts carefully to ace in programming. If you are at intermediate level, you can read these concepts to brush up your skills. Lastly, if you have enough confidence in your programming concepts you can just skip this post. Lets have a brief introduction about this programming before going in detail.

What is Wonderware Programming?

Well, this programming is not like other typical programming languages. Unlike those, it is very simple. Wonderware InTouch software includes window scripts feature in each window made by a user. This feature enables a user to write script for each component on the window. In other words, window scripts are written to define conditions which make particular actions to take place.

For example, suppose there is a buckets (b1) on the conveyor belt. And the task is to fill the bucket first. And then move it in forward direction. Now, script could be written as follows :

if b1<=100 then b1=b1+1; endif;
if b1==100 then t1=t1+1;endif;

Here b1 is the tagname given to the bucket for vertical percent fill. And t1 is the tagname for horizontal position. We will discuss later in the post about these italic written phrases. For now, lets understand this example. So, we see that until b1 doesn’t exceed value 100 it increments by one value. Which means, percent fill increases by value 1 in each increment. Similarly, when b1 or percent fill has reached value 100, t1 increments. That is, horizontal position of bucket increments by one in each step. This increment must be restricted by an upper limit (which is defined by user).

To more clearly understand the example see pictures below :

wonderware programming - scada programming wonderware intouch
Bucket Filling in Progress -Vertical Fill
wonderware programming - scada programming wonderware intouch
Bucket Filled – Horizontal position increment
wonderware programming - scada programming wonderware intouch
Upper limit of horizontal position reached – Bucket stops moving

You will understand Wonderware programming as easily as you understood this example. Moving ahead, lets see the step by step guide to learn wonderware intouch programming.

Note – If you didn’t understand this example have a look at it again. As I will use it as a reference in this step by step guide.

Step 1 – Decide the action or task

This step is prerequisite before writing window scripts. In the above discussed example, there were two tasks. First, to fill the bucket with water. Then, to move it on the conveyor belt to take it to its destination.

Similarly, you must be aware of the tasks or actions of the program. After you have decided what the program will do, prepare the conditions.

Step 2 – Decide Tagname

Tagname, as evident from its name, is the tag given to components on the window. In other words, it is a variable that has an initial value and a final value. For example, the bucket has tagname b1 for vertical percent fill and t1 for horizontal motion. Now, the obvious question that could arise here is, Why two tagnames for same bucket?

Well, in Wonderware programming it is possible. In fact, you can associate as many tagnames as you wish to a single component. But, there is a condition for it. You should associate multiple tagnames with a component only if that component is supposed to perform more than one task. For example, the bucket above performs two tasks. Filling and moving horizontally. In other words (technically), percent fill (vertical) and position change (horizontally). Therefore two tagnames are associated with this bucket.

wonderware programming - scada programming wonderware intouch
Tagnames – t1 and b1

In similar manner, you can choose tagnames and associate them with different components based on the task(s) they need to perform.

To know more about the actions available for components in Wonderware Intouch visit this post.

Step 3- Prepare the conditions

The conditions for above mentioned tasks are :

if b1<=100 then b1=b1+1; endif;
if b1==100 then t1=t1+1;endif;

b1 and t1 are the tagnames associated with vertical fill and horizontal position respectively. Assuming that you understood these conditions already i’ll move to the next step.

Step 4 – Write the scripts or program

The next step is to write the scripts in the window scripts.  (Don’t worry we have provided plenty of window scripts examples just to make you more familiar with the term.)

A window script window looks like :

wonderware programming - scada programming wonderware intouch
Scripts Window

This window has 3 tabs viz. On Show, While Showing and On Hide. In the On Show window we write the ideal conditions that each component should possess. That is conditions for ideal or normal behavior.

In the While Showing window we write code or conditions for change and subsequent behavior that a particular component should show.

In On Hide window we write scripts for hidden window. That is when window disappears. It is not as important as above two windows although has its significance on other applications.


For the above example On Show and While Showing scripts are :

wonderware programming - scada programming wonderware intouch
On show script
wonderware programming - scada programming wonderware intouch
While showing script

That’s all. After you have written the scripts validate them and save.

Implementing an Automated Parking System using a PLC

So, we see that Wonderware Programming is simplest of all the other programming languages. It only has initial conditions (On Show)  and some IF, THEN, ELSE IF, IF and ENDIF (While Showing). However, in a long and complex program it could become little tricky to use these statements.

See this video to have better understanding of Project code ‘Fault Detection in Overhead Transmission Lines‘ .

To have even better understanding of Wonderware Programming see this Wonderware InTouch project.

If you liked this post please like and follow us @Facebook.


    1. Hello Dinesh, Thank you for reaching us.
      Although I am not clear about your query, I got an idea that you must be asking about how to make an Digital Eight.
      If that is the thing, all you need to do is use the visibility function in the wonderware Intouch. To get an idea on how to use visibility function you can refer to Crane working mechanism Wonderware Intouch Programming Example
      All you need to do is arrange combination of 7 horizontal and vertical lines in the form of 8 and use visibility or blink function according.

      You can write to us and explain if this is not your query.
      Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *