You are on page 1of 72

U90 Ladder Tutorial

Table of Contents
Learning U90 Ladder
The Sample Application
Getting Started

4
5
6

Displays: Operator Log-in

How to Build a Net

21

Ladder: Operator Log-in


Condition 1
Condition 2
Condition 3
To reset coils
To Reset MI 4
To download a project

27
27
31
32
34
36
37

Displays: Entering Parameters


Setting the Box Count
To Create and Link a Variable
Setting Maintenance Time

39
39
40
45

Displays: Displaying Run-Time Data


Displaying a Running Box Count
To Create and Link Variables
Jump conditions
Defining the Operator Message Display

53
53
54
57
60

The Ladder Application


Starting the Bundling Machine
Creating a Counter
Initializing the Counter

65
65
67
68

LadderMonitoring the System

69

U9 0 La dde r Tutor i a l

Chapter 1

Learning U90 Ladder

T he Unitronics M90 OPLC is a micro-controller used to automate industrial and domestic


processes. U90 Ladder software is used to create the automation project. T his tutorial is to be
used together with:


T he enclosed sample application

U90 Ladder software

An M90 OPLC controller

After completing this tutorial, you will be familiar with the use of:


Displays

Variables

T imers

Counters

Math Functions

Compare Functions

Store Functions

Once you are familiar with these principles and how they are used in U90 software, you will
be ready to begin writing and running your own project application.

U9 0 La dde r Tutor i a l

The Sample Application


In this application, you write an application that automates a box-counting machine.
T his machine counts boxes before they are packaged into bundles. A photocell is installed at
the machines entrance. T he boxes are counted as they pass the photocell. T he photocell
also detects when a box is stuck, and detects when there are no boxes in the system.
Machine operators will log in to the system.
Approved operators can then use the M90s keypad to set:


T he number of boxes per bundle

1 hour each day when the system will not be able to run

When the machine is running, the M90s LCD screen will display:


A running box count

A message when the set number of boxes per bundle is reached

Error messages

Your program will also prevent the machine from running over the weekend.

Note that the function of the photocell in this application is filled by the +/- key on the M90
keypad. This allows you to download the tutorial into your M90 controller and run it without
connecting the M90 to anything other than your PC.

U9 0 La dde r Tutor i a l

Getting Started
First, you need to open a new project.

To open a new project:


1

Open U90 Ladder.

Click the New icon on the HMI toolbar.

Figure 1.

New Icon

You can have only one U90 project open at a time. Before a new project will open, you will
be prompted to save any changes to a currently open project.
A new project will open with the M90 Hardware Configuration window.
3

Select your controller model from the M90 list. T he selected model name now appears
above the M90 picture.

Figure 2.

Hardware Configuration Window

For this project you will not be using the Digital and Analog expansion options.
4

Close the Hardware Configuration window.

U9 0 La dde r Tutor i a l

Before you begin programming, save your new project.

To save a project:
5

Select Save As from the Project drop-down menu.

T he Save As window opens.

Select the desired folder.

Enter Factory Tutorial as the file name. Note that the file
extension will be .U90.

Figure 3.
9

Save As Dialog Box

Click Save.

You are now ready to begin writing your project.

U9 0 La dde r Tutor i a l

Chapter 2

Displays: Operator Log-in

T o allow operators to log in, you create an interactive user interface. T his means that the
messages displayed on the M90s screen tell the operator to enter certain information. T he
operator then enters the information using the M90s keypad.
How can y ou create an interactiv e user interface?

You need:


An initial Display

A Display to approve ID entry

A Display to deny ID entry

A way to convert a positive ID into an activated coil.

T o do this you will use Display screens, Variables, List Variables and Display Jumps.

To create an initial Display


Make an initial Display that displays Enter ID no. on the M90 display panel.
1

Click the Display icon on the Ladder toolbar. Display 1 opens in the Display
editor.

Name the Display Initial Log-in Display by typing this title in the title bar and then
pressing ENTER. You will see the Display 1 title in the Project Navigation window.

Figure 4.
3

Initial Display

Enter the Display text Use r ID no. in the Display window.

U9 0 La dde r Tutor i a l

Figure 5.

Enter ID Number

You have now created a Displaybut this Display is not yet an inte ractive Display. Your
initial Display asks the operator to enter his/her ID number. T o register the ID number, you
create a Linked Variable.

To create a Linked Variable


T he company has 90 workers. T here are three people that are approved to log in and start
the system. T hese three people have ID numbers 10, 11 and 12.
You need to link a Variable to your Display. T his Variable will hold the space in your Display
where the operator will enter his/her ID number.
1

Select two spaces in the display text by clicking and dragging.

Figure 6.

Select Variable Space

Click Attach Variable on the HMI toolbar.

T he Attach Variable dialog box opens.

U9 0 La dde r Tutor i a l

Figure 7.
4

Enter VR 6 Worker ID no.

Press OK

Figure 8.
6

Attach a Variable

Enter Variable Number and Address

Display 1 now appears with the Variable-linked spaces as red pound signs.

Figure 9.

Display 1 with Attached Variable

You have attached a variable to a Display. Now you need to format the Variable for its use.

To format a Variable
T his Variable will accept a two-digit number between one and ninety. T he operator enters the
number using the M90 keypad.
1

10

Open Variable 6 from the Project Navigation Window.

U9 0 La dde r Tutor i a l

Figure 10.
2

Select Inte ge r from the Variable T ype list, then click on the Link To button. T he Se t
Link to Int box opens.

Figure 11.
3

Enter MI 4 Worker Nam e List. Click OK. We will format MI 4 later.

Figure 12.
4

Select Keypad Entry from the Variable Information list.

11

U9 0 La dde r Tutor i a l
5

Select Start w ith Clear Field. T his will erase any previous user ID numbers
entered, and prevent them from being viewed on the M90 display screen. If you do not
select Start w ith Clear Field, the last ID number entered will be displayed.
Set Entry Lim its from one to ninety.

Figure 13.
You have a Display. You have an attached Variable. T ogether, the Display and the attached
Variable create an interactive Display.
Now, after an operator has entered an ID number, you must approve the ID entry.
T o do this, you must create a Jump condition.

To create a Jump condition


After an operator enters an ID number (s)he presses the ENTER key. T he ENTER key pressed
will be the Jump condition.
1

Select Display 1 from the Project Navigation Window.

Figure 14.

12

U9 0 La dde r Tutor i a l
2

Click to open the first Jump Condition. T he Define Jump to Condition box opens.

Figure 15.
3

Enter SB30 Keypad entries complete. Click OK .

Figure 16.
4

T he Define to Display Jump box opens.

Enter DS 2 Number Confirmation. Click OK .

13

U9 0 La dde r Tutor i a l

Figure 17.
6

T he Display now appears with the linked Variable and Jump condition.

Figure 18.

To review:
For one Display, you have created:


A fixed text Display.

A keypad-enabled Variable.

A Jump condition to respond to the keypad entry.

Now you want to create a Display that will verify the entered ID number. T his will be Display
2. T here are two options for the ID number: access okayed or access denied. T hese two
options are similar to a bit option: on (1) or off (0). Depending on access permission, you
want to continue on to Display 3 or return to Display 1. Display 2 will contain two types of
text:

14

Fixed this text will be part of all Display 2 screens.

Variable this text will vary with the conditions in Display 2.

U9 0 La dde r Tutor i a l

To format Display 2:
1

T itle Display 2 Number Verification.

Enter the text Access. T his will be Fixed text in the message.

Enter the text verify. T his will be variable text in the message.

Select verify.

Click the Attach Variable icon on the HMI toolbar.

Figure 19.
6

Attach Variable 9 Number verification.

Figure 20.
Next, you want to set your JUMP Condition. Your JUMP Conditions will not depend on an
external keypad entry. T hey will be internal conditions in the Ladder project.
7

Click to open the first Jump Condition. T he Define Jum p to Condition box opens.

Enter MB 7 Tim e to jum p to 3. Click OK .

15

U9 0 La dde r Tutor i a l

Figure 21.
9

T he Define to Display Jump box opens.

10

Enter DS 3 Present the w orker name. Click OK .

Figure 22.
Repeat the same process for Jump Condition 2 using MB 8 Time to return to 1 with Display 1.

16

U9 0 La dde r Tutor i a l

Figure 23.
Now you need to format the Variable attached to Display 2.

To format Variable 9:
1
2

Open Variable 9 through the Navigation editor.

Select Bit for the Variable T ype list. T he Set Link to Bit box
opens.
Enter MB 20 System can w ork. Click OK .

Figure 24.
4

Enter denied in the T ext for off (0) box.

Enter okayed in the T ext for on (1) box.

17

U9 0 La dde r Tutor i a l

Figure 25.
You have created two Displays. If you will remember, at the beginning, you needed:


An initial Display

A Display to confirm ID entry.

A Display to deny ID entry.

Now you see that the Display to confirm and the Display to deny ID entry are only one
Display with Variable conditions to change part of the text message.
Create one final Display for the log-in process. T his Display will read Welcome ______ with
the Operators name. T his is another Display where part of the text is constant and part is
variable. You cannot use a Bit Variable in this instance because you do not have an on or off
condition. Instead, you will use List Variables for the Operators names.

To format Display 3:
1
2

18

T itle Display 3 Present w orker name.

Enter the fixed text Welcome.

Select eight spaces for the variable text and attach Variable 7
Name of w orker.

Set one Jump condition for an active keyboard to jump to


Display 4 using SB 6 Keyboard is Active.

U9 0 La dde r Tutor i a l

Figure 26.
Now you format the Variable attached to Display 3. You have ninety factory workers but
only three that are permitted to operate the conveyor belt. For the sake of expediency, you
will not enter ninety names in the List Variable.

To format Variable 7:
1

Open Variable 7 from the Project Navigation Window.

Select List from the Variable T ype list. T he Set Link to List box
opens.

Enter MI 4 Worker Name List. You will remember that we created


this Memory Integer for Variable 6, page 11.

Figure 27.
4

5
6

Enter 90 in the Variable Information: Lines box. You will


remember that the factory has 90 workers
Click APPLY.
Enter names in List Variables 0, 1 and 2. You do not need to
enter ninety worker names in this sample program.

19

U9 0 La dde r Tutor i a l

Figure 28.
7

Scroll down to List Variables 10, 11 and 12. T hese will be the
three workers allowed to operate the conveyor belt.
Enter names in List Variables 10, 11 and 12.

Figure 29.
You have created all of the Displays needed for the Log-in process. If you download your
Factory T utorial project at this point, you will see your first Display: Enter ID no. _. No
matter what two-digit number you enter, you will see Display 2: Access denied. You have
not written Ladder conditions that could turn MB 20 ON, the Memory Bit linked to Display
2. T herefore, MB 20 remains OFF (logic 0).
You also have not written Ladder nets that could turn ON either MB7 or MB 8, your Display
2 Jump conditions. MB 7 and MB 8 remain OFF (logic 0). You cannot jump out of Display 2.
Now, you need to write the Ladder program that will create the conditions 6 to turn MB 7,
MB 8 and MB 20 ON.

20

U9 0 La dde r Tutor i a l

Chapter 3

How to Build a Net

In this section, you learn how to select Ladder elements and place them within a net. T o
learn about Ladder elements and their functions, please refer to U90 Ladders on-line help.
T he Ladder net in this example contains:


T wo Equal function blocks (If and and)

One Set coil.

Click on the Compare menu, and then click on Equal as shown below. The Equal
function block is now attached to your cursor.

Figure 30.
2

Place the function block on the left side rung of the Ladder as shown below. Note that
in order to allow power to flow from the rung, the function block must touch the left
rung.

Figure 31.
3

Click on the rung. The Equal function block drops into place. The Select Operand and
Address box opens as shown below.

21

U9 0 La dde r Tutor i a l

Figure 32.
4

Click on the rung. The Equal function block drops into place. The Select Operand and
Address box opens.

Enter SI 2 Current HMI Display for the A integer value as shown below, then click OK .
The Select Operand and Address box opens.

Figure 33.

22

Select #, constant value as the B operand type. Constant values are values that you
enter when you create your project. They are not affected by your application.

Enter the constant integer value by typing 2, and then click OK as shown below.

U9 0 La dde r Tutor i a l

Figure 34.
8

The Equal function block now appears with both integer values in place as shown
below.

Figure 35.
Now create another Equal function block.
9

Click on the Compare menu, then click on Equal as shown below. The Equal function
block is attached to your cursor.

10 Place this function block so that it touches the first one as shown below. Note that in
order to allow power to flow between them, the function blocks must touch

Figure 36.
11 Enter MI 4 Worker Name List for the A integer value, then click OK . The Select
Operand and Address box opens.
12 Select #, constant value as the B operand type. Enter the constant integer value by
typing 10, then click OK .

Figure 37.
23

U9 0 La dde r Tutor i a l
13 The net now appears as shown below.

Figure 38.
Now you place a Direct Coil in the net.
14 Click on the Set Coil button as shown below. The Set Coil element is now attached to
your cursor.

Figure 39
15 Click in the net to place the Set Coil. The Select Operand and Address box opens.
16 Enter MB 10 Worker number 10 is in as shown below.

Figure 40
17 Click OK. The Set Coil now appears with its operand and address.

24

U9 0 La dde r Tutor i a l

Note the space between the Set Coil and the function block. If the elements do not touch,
there will be no power flow to the Set Coil. You can use the Draw Line tool to connect them.
18 Click on the Draw Line button as shown below.

Figure 41
19 Use the pencil to draw a line between the two elements as shown below.

Figure 42
Note that you can also use the Draw Line tool to use one condition to drive a number of coils
by connecting parallel elements within a net.
Net One, shown below, is now complete.
Net One reads:
If the Current Display (SI 2) is Display 2 (#2) and the entered integer value in MI 4 equals
10, then turn MB 10 ON.

Figure 36
25

U9 0 La dde r Tutor i a l

T his net is the first net used in the Ladder: Operator Log-in , section of this tutorial.

26

U9 0 La dde r Tutor i a l

Chapter 4

Ladder: Operator Log-in

Display 1 comes up as soon as you turn on the controller and download your project. Display
1 does not need a Ladder net to work. Display 2 does. Display 2 has no Ladder conditions for:


MB 20

Conveyor system can work

MB 7

Jump to Display 3 for an approved worker ID number

MB 8

Jump to Display 1 for an denied worker ID number

You need to write the Ladder conditions for:


1. If you are in Display 2 and worker ID number is approved
then turn MB 20 ON.
2. If you are in Display 2 and MB 20 is ON then turn ON MB 7
and jump to Display 3.
3. If you are in Display 2 and MB 20 is not ON then turn ON
MB 8 and jump to Display 1.

Condition 1
If y ou are in Display 2 and work er ID number is approv ed
then turn MB 20 ON.
Ladder net for worker ID number 10 consists of:


T wo Equal function blocks (If and and)

One Set coil.

Figure 44.

Log-in Ladder

Net One reads:


If the Current Display (SI 2) is Display 2 (#2) and the entered integer value in MI 4 equals
10 then Set MB 10 ON.
Using a Set coil means that MB 10 remains ON, and you can use it to drive further
conditionseven after the Current Display changes to Display 3.
Use the COPY and PASTE functions to build Ladder nets for worker ID numbers 11 and 12.
Remember that Copy and Paste operate differently in U90 Ladder.

To Copy and Paste:

27

U9 0 La dde r Tutor i a l
1

Select the element(s) you want to copy by clicking and dragging the mouse.

Figure 45.

Figure 46.

The Elements selected

Click COPY on the Standard toolbar.

Click PASTE on the Standard toolbar.

Move the pointer to the net in which you want to paste, then click.

Figure 47.

28

Selecting the elements to copy

Placing the pointer in the net

U9 0 La dde r Tutor i a l

Figure 48.
5

Copying the elements to the net

Now change the worker ID number 10 to 11.

Figure 49.

Figure 50.

Changing #10 to #11

Updated Net Two

Repeat the same process for worker ID number 12.

29

U9 0 La dde r Tutor i a l

These three nets create:

Figure 51.

Nets for worker ID numbers 10, 11 and 12

T hese three nets create the condition if you are in Display 2 and worker ID number 12 is
entered. Now you need to create the resultthen turn MB 20 ON.
T his net consists of:

30

T hree Direct contacts.

One Direct coil.

U9 0 La dde r Tutor i a l

Figure 52.

Net for conveyor system to work

Net Four reads:


If MB 10, MB 11 or MB 12 is logic 1 then turn MB 20 (System can w ork) ON.
Note that in Net One MB 10 was a Set coil and in Net Four it is a Direct contact.

Condition 2
If y ou are in Display 2 and MB 20 is ON
then turn MB 7 ON and jump to Display 3.
T he Ladder nets for jumping to Display 3 consist of:


One Equal function block.

One Direct contact.

One Positive Rise contact.

One Timer.

One Direct coil

Figure 53.

Timer to jump to Display 3

Net Five reads:


If the Current Display (SI 2) is Display 2 (#2) and the system can w ork (MB 20 is ON) then
turn Timer 7 ON.
31

U9 0 La dde r Tutor i a l

Timer 7 w ill then begin count down from 4 seconds.


Remember that timers also have a bit value. Direct coil T 7 will turn ON when T 7 finishes
counting down from 4 seconds and reaches 0.

Figure 54.
Net Six reads:
When Tim er 7 counts dow n to 0 seconds and turns ON, turn ON MB 7.
Remember that MB 7 provides the Jump condition from Display 2 to Display 3.
T imer 7 allows the Display to be on the M90s screen for four seconds. Without this time
delay, the message Access okayed would flash on the screen too quickly to be read.

Condition 3
If y ou are in Display 2 and MB 20 is not ON
then turn MB 8 ON and jump to Display 1.
T he Ladder nets for jumping to Display 1 consist of:

32

One Equal function block.

One Inverted contact.

One Tim er.

One Positive Rise contact.

One Direct coil.

U9 0 La dde r Tutor i a l

Figure 55.
Net Seven reads:
If the Current Display (SI 2) is Display 2 (#2) and MB 20 is 0, then turn Tim er 8
ON.
Remember that Direct coil T imer 8 will turn ON only when it has finished counting down
from 4 seconds and reaches 0.

Figure 56.
Net Eight reads:
When Tim er 8 counts dow n to 0 seconds and turns ON, turn MB 8 ON.
Remember that MB 8 provides the Jump condition from Display 2 to Display 1.
Without this time delay, the message Access denied would flash on the controller screen
too quickly to be read.
You have written the Displays for the Log-in process and you have built the Ladder nets to
activate the Display jump conditions.
Next, close the open loops in your Ladder nets.

33

U9 0 La dde r Tutor i a l


You used a Set coil for each allowed worker ID number. A Set coil must be used with a
Reset coil.

You used a Store Direct function block with the value of MI 4. T his value is stored
until overwritten by another value. T he MI 4 value should be cleared with each scan.

Build the reset conditions at the beginning of the project. T hen they will not be forgotten as
your project grows.

To reset coils
Each Set coil must:


Have a Reset coil with the same Operand and address - and -

Be in a net that can conduct power flow.

T he reset conditions will be built with:




One Equal function block

One Direct coil

One Positive Transition contact

T hree Reset coils

One Store Direct function block

Figure 57.
6

Click the INSERT NEW NET icon on the Ladder toolbar. The
cursor changes into cross-hairs.

Place the cursor in Net One. Click to insert a new net.

Figure 58.

34

Clicking the Insert New Net icon

Placing the pointer in the net

U9 0 La dde r Tutor i a l
8

Repeat the process and add another net for a total of 2 new nets. What was Ladder Net
1 is now Ladder Net 3.

To Build Net One


9

Place Ladder elements into Net One as shown in the figure below.

Figure 59.
Net One reads:
When the Current Display (SI 2) is Display 1 (#1), turn MB 30 ON.

To Build Net Two


1

Place Ladder elements into Net Two as shown in the figure below. To allow the single, one-shot
conn ection to reset the parallel series of coils, you must connect them.

Double-click on the LINE DRAW icon. Connect the Reset coils to the Positive Transition
contact.

Figure 60.

Drawing the connecting lines with the Line Draw tool

35

U9 0 La dde r Tutor i a l

Figure 61.

Reset conditions

Net T wo reads:
When MB 30 turns ON, reset MB 10, MB 11 and MB 12.
You have given Reset coil conditions to each Set coil condition. T hose set reset loops are
closed.
Next, reset the MI 4 value to 0 after each scan.

To Reset MI 4
As the program is written now, when an access-okayed worker ID number is entered, that
number is stored in MI 4. When the full program (including operating the conveyor belt and
error handling) is run and completed, it will return to Display 1: Ente r ID no.
T he ID number entered at the beginning of the last scan is still stored in MI 4. If the next
worker does not enter an ID number and only pushes Enter while in Display 1, the worker will
be allowed access on the previous workers ID number.
T he zero condition will be built with:


One Store Direct function block

You can include this function block in the same net as the reset coils, Net 2.

36

U9 0 La dde r Tutor i a l

Figure 62.
Net T wo now reads:
When MB 30 turns ON, reset MB 10, MB 11 and MB 12 AND store integer 0 in MI 4.
Your project now includes 11 nets and 4 HMI displays. You can now download your project and
test it. Keep in mind that, because you have not yet formatted Display 4, pressing ENTER after
Display 3 Welcom e _______ will bring up a blank screen. Use the Debug feature to reset SI 2
Current HMI Display to 1.

To download a project
Make sure that the controller is turned on and that U90 Ladder is in Ladder Editor view.
1

Click the DOWNLOAD Icon on the HMI toolbar.

Download all sections.

You will see Display 1. T he screen will go blank after you press Ente r. You can reset the
program on-line using the de-bugging feature.
3

Click the DEBUG Icon on the HMI toolbar.

Figure 63.
4

The net power flow will appear in red. The current Operand value of the CURRENT HMI
DISPLAY appears above the Operand and Address.

37

U9 0 La dde r Tutor i a l

Figure 64.
5

Click on the OPERAND AND ADDRESS to open debugging dialog box.

Enter 1 in the NEW box and click SEND .

Figure 65.
T he new value of 1 will appear above the Operand and Address. T his causes Display 1 Enter
ID No: __ to return to the M90 display screen.

Figure 66.

38

U9 0 La dde r Tutor i a l

Chapter 5

Displays: Entering Parameters

Once an operators password is approved, the operator must set the number of boxes per
bundle. T o set this parameter, the operator enters a number using the M90 keypad. Note that
the maximum number of boxes per bundle is 99.
T he operators also need a running box count to allow them to track production.
T he operator will be able to set system maintenance times, during which the bundling
machine cannot run.
How can an operator enter program param eters?.
In this part of the application, you will:


Create two interactive displays that allow the operator to:


-set the number of boxes in a specific bundle.
-set a start time and an end time for system maintenance.

Create a Display that shows a running box count.

T o allow the operator to set the number of boxes per bundle, you need to create a Display
and link it to a keypad entry variable.

Setting the Box Count


First, you need to create a Display with fixed text.
1

Click the Display icon on the Ladder toolbar. Display 1 opens in the Display
editor.

Name this Display Set Box Quantity, by typing the name in the title bar, then
pressing ENTER . You will see the Display 1 title appear in the Project Navigation
window, as shown in Figure 67 below

Figure 67
3

Naming a Display

Enter the Display text Set Box Qty. in the Display window, as shown in Figure 68
below.

39

U9 0 La dde r Tutor i a l

Figure 68

Creating a Text Message

T o allow the operator to set the number of boxes per bundle, you need to link a Variable to
your Display. T his Variable will contain a number entered from the M90 keypad. Remember
that the maximum number of boxes per bundle is 99, so you must create a space in your
Display that can hold two digits.

To Create and Link a Variable


First, define the space where the quantity will be displayed.
1

Select two spaces in the Display text by clicking and dragging, as shown below.

Figure 69.
2

40

Selecting Variable Space

Click Attach Variable on the HMI toolbar as shown below.

U9 0 La dde r Tutor i a l

Figure 70.
3

T he Attach Variable dialog box opens as shown in Figure 71.

Figure 71.
4

Attaching a Variable

Enter Variable Number and Address

Enter VR 5 Set Box Quantity, then press OK . Display 4 now appears with the
Variable-linked spaces as red pound signs as shown in Figure 72 below.

Figure 72.

Display 4 with Attached Variable

41

U9 0 La dde r Tutor i a l

You have attached a variable to a Display. Now you need to format the Variable to accept a
number that the operator enters from the M90 keypad.

To format a Keypad Entry Variable


When you have finished formatting this Variable, it will accept a two-digit number between 1
and 99.
1

Open Variable 5 from the Project Navigation Window.

Figure 73.
2

Select Integer from the Variable Type list, then click on the Link To button. T he Set
Link to Int box opens as shown in Figure 74.

Figure 74.
3

42

Selecting a Variable Type

Linking an MI to a Variable

Enter MI 11 Set Box Quantity, then Click OK . T he Variable is now linked to MI 11.
You will format MI 11 later.

U9 0 La dde r Tutor i a l
4

Select Keypad Entry from the Variable Information list.

Select Start w ith Clear Field. If you do not select Start w ith Clear Field, the last
number entered in MI 11 will be displayed.

Select Enable Limits. In the Min box, enter 1; enter 99 in the Max box. When you are
finished formatting Variable 5, the screen will look like Figure 75, page 55 below.

Figure 75.

Formatting an Entry Variable

You have a Display. You have an attached Variable. T ogether, the Display and the attached
Variable create an interactive Display.
Now, after an operator has entered the number of boxes that are required for this bundle, you
want the operator to set maintenance time.
T o do this, you must create a Jump condition.

To create a Jump condition


After an operator enters the number of boxes (s)he presses the ENTER key. T his will fulfill
the Jump condition and cause the Display to change.
1

Click on Display 4 in the Project Navigation Window. Display 4 appears as


shown below.

43

U9 0 La dde r Tutor i a l

Figure 76.
2

Click on the first Jump condition in the Jumps box. T he Define Jump to Condition
box opens.
Enter SB30 Keypad entries complete, as shown in Figure 77.

Figure 77.

44

Creating a Jump Condition

Defining a Jump Condition

Click OK. T he Define to Display Jump box opens.

Enter DS 5 Enter Start Time as shown below.

U9 0 La dde r Tutor i a l

Figure 78.
6

Defining theJump Destination

Click OK . T he Display now contains the linked Variable and Jump condition as shown
below. You can also see Display 5, Enter Start T ime, in the Project Navigation
Window.

Figure 79.

Completed Display

To review:
For this Display, you have created:


A text Display.

A keypad-enabled Variable.

A Jump condition to respond to the keypad entry.

Now you need to create the Jumps destination Display. T his Display will allow the operator
to set a start time for maintenance procedures.

Setting Maintenance Time


S etting a S tart Time
1

Click Display 5 in the Project Navigation window. Display 5, Enter Start


Tim e, opens in the Display editor. .

45

U9 0 La dde r Tutor i a l
2

Enter the Display text Start Time :_____ in the Display window, as shown in Figure
80 below.

Figure 80

Display 5: Jump Destination Display

Enabling a Keypad-entry Start Time


First, define the space where the time will be displayed.
1
2

Select 5 spaces in the display text by clicking and dragging.

Click Attach Variable. T he Attach Variable box opens as shown


below.

Figure 81.
3

Attaching a Variable

Enter VR 2 Start Time, then press OK . Display 5 now appears with the Variable-linked
spaces as red pound signs as shown in Figure 82 below.

Figure 82.

Display 5 with Attached Variable

You have attached a variable to a Display. Now you need to format the Variable for its use.

46

U9 0 La dde r Tutor i a l

To Format a Keypad Time Entry Variable


When you have finished formatting this Variable, it will accept a Start T ime that is entered
by the operator via the M90 keypad.
4

Open Variable 2 by clicking it in the Project Navigation Window.

Select Time Functions from the Variable Type list. T he Set Link
to Time function box opens.

Enter MI 2 Start Time, then click OK as shown below. Variable 2 is now linked to MI 2.
You will define MI 2 when you write the Ladder program for Maintenance T ime.

Figure 83
7

Linking a Variable

Select Hour (CT) and Keypad Entry from the Variable Information list as shown in
Figure 84.

Figure 84.

Selecting a Variable Type

You now have an interactive display that enables the operator to enter a Start T ime for
maintenance. Once the operator has set the Start T ime, he must also set an End T ime. You
need to create a jump condition that will bring the operator to the End T ime Display.

To create a Jump
After an operator enters the Start T ime (s)he presses the ENTER key. T his will fulfill the
Jump condition and cause the Display to change.

47

U9 0 La dde r Tutor i a l
1
2

Open Display 5 by clicking it in the Project Navigation window.

Click on the first Jump condition in the Jumps box. T he Define Jump to Condition
box opens. Now enter SB30 Keypad entries complete, as shown below.

Figure 85.
3

Click OK. T he Define to Display Jump box opens

Enter DS 6 Enter End Time as shown below.

Figure 86.
5

48

Defining a Jump Condition

Defining theJump Destination

Click OK . T he Display now appears together with the linked Variable and Jump
condition as shown below. You can also see Display 6, Enter End Time, in the Project
Navigation Window.

U9 0 La dde r Tutor i a l

Figure 87.

Completed Display

To review:
For this Display, you have created:


A text Display.

A keypad-enabled Variable.

A Jump condition to respond to the keypad entry.

Now, you need to create the destination screen for the Jump condition.
Now you need to create the Jumps destination Display. T his Display will allow the operator
to set an end time for the maintenance period.

Setting an End Time


1

Click Display 6 in the Project Navigation window. Display 6, Enter End Tim e,
opens in the Display editor.

Enter the Display text End Time : in the Display window, as shown in Figure 80
below.

Figure 88

Display 6: Jump Destination Display

Enabling a Keypad-entry End Time


First, define the space where the time will be displayed.

49

U9 0 La dde r Tutor i a l
1
2

Select 5 spaces in the display text by clicking and dragging.

Click Attach Variable. T he Attach Variable box opens as shown


below.

Figure 89.
3

Attaching a Variable

Enter VR 3 End Time, then press OK . Display 6 now appears with the Variable-linked
spaces as red pound signs as shown in Figure 82 below.

Figure 90.

Display 5 with Attached Variable

You have attached a variable to a Display. Now you need to format the Variable for its use.

To Format a Keypad Time Entry Variable


When you have finished formatting this Variable, it will accept an End T ime that is entered
by the operator via the M90 keypad.
1

50

Open Variable 3 by clicking it in the Project Navigation Window.

Select Time Functions from the Variable Type list. T he Set Link
to Time Function box opens.

Enter MI 32 End Time, then click OK as shown below. Variable 3 is now linked to MI 3.
You will define MI 3 when you write the Ladder program for Maintenance T ime.

U9 0 La dde r Tutor i a l

Figure 91
4

Linking a Variable

Select Hour (CT) and Keypad Entry from the Variable Information list as shown in
Figure 84, page 47.

Figure 92.

Selecting a Variable Type

You now have an interactive display that enables the operator to enter an End T ime for
system maintenance. After an operator enters the End T ime (s)he presses the ENTER key.
T his will fulfill the Jump condition and cause the Display to change.

To review:
In this section, you made Interactive Displays that enable the operator to use the M90
keypad to:


Set the amount of boxes per bundle.

Set the starting time for system maintenance.

Set an ending time for system maintenance.


51

U9 0 La dde r Tutor i a l

52

U9 0 La dde r Tutor i a l

Chapter 6
Data

Displays: Displaying Run-Time

At this point, your application allows the operator to:




Identify himself to the M90 by entering a password.

Set the number of boxes per bundle.

Define maintenance time for the system.

Now, you must create Displays that will show the operator what is happening within the
system.
How do I display run-tim e Data?
In this part of the application, you will:


Create a Display that shows a running box count.

Create a Display that allows the operator to track events or errors within the system.

T he running box count display will contain 2 variable values. T he first variable is the actual
number of boxes that are counted as they pass a photocell. T his variable will be linked to an
MI which serves as a counter in your Ladder program. T he second variable is the number of
boxes per bundle. T his number has been set by the operator in Display 4, Set Box Quantity.

Displaying a Running Box Count


First, you need to create the fixed text for the display.
1

Click the Display icon on the Ladder toolbar. Display 7 opens in the Display
editor. We will name this Display Box Count.

T ype the name in the title bar, then press ENTER . You will see the name appear in the
Project Navigation window, as shown in Figure 67 below.

Figure 74

Naming a Display

53

U9 0 La dde r Tutor i a l
3

Enter the Display text Box___out of___ in the Display window, as shown in Figure 68
below. T he spaces in the text will contain the variable values.

Figure 75

Creating Fixed Text

To Create and Link Variables


First, attach the variable that will display the number of boxes that are counted as they pass
the photocell.
Define the space where the number of boxes will be displayed:
1

Select 3 spaces in the Display text by clicking and dragging, as shown below.

Figure 76.
2

Click Attach Variable on the HMI toolbar.

T he Attach Variable dialog box opens as shown in Figure 71.

Figure 77.
4

Enter Variable Number and Address

Enter VR 4 Boxes Counted, then press OK . Display 7 now appears with the Variablelinked spaces as red pound signs as shown in Figure 72 below.

Now format Variable 4.

54

Selecting Variable Space

U9 0 La dde r Tutor i a l
5

Click on Variable 4 in the Program Navigation Window, and then select Integer as the
Variable T ype.

Click on the LINK TO button, and then link MI 10 Current Number of Boxes as shown
below.
You will use MI 10 to create the box counter in your Ladder application.

Figure 78.

Formatting a Variable

Now, you attach the second variable, which contains the preset number of boxes per bundle.
7

Select 3 spaces in the Display text by clicking and dragging, as shown below.

Figure 79.

Selecting Variable Space

Click Attach Variable on the HMI toolbar.

T he Attach Variable dialog box opens as shown in Figure 71.

55

U9 0 La dde r Tutor i a l

Figure 80.
10

Enter Variable Number and Address

Enter VR 1 Amount of Boxes per Bundle, then press OK . Display 7 now appears with
the Variable-linked spaces as green pound signs as shown in Figure 72 below.

Figure 81.

Display 7 with Attached Variables

Now format Variable 1.

56

11

Click on Variable 1 in the Program Navigation Window, and then select Integer as the
Variable T ype.

12

Click on the LINK TO button, and then link MI 11 Set Box Quantity. Remember that
MI 11 contains the number of boxes per bundle that is set by the operator.

U9 0 La dde r Tutor i a l
13

Click OK . Variable 1 is complete as shown below.

Figure 82.

Formatting a Variable

To review:
In this section, you made a Display that enables the operator to:


View the counted number of boxesthe number of boxes that have passed a
photocell.
Compare it to the preset number of boxes per bundle.

Jump conditions
T here will be 3 Jump conditions that will cause a Jump to a new Display. Each condition will
cause Display 10, the message screen, to be displayed.

To set the Jump conditions


1
2

Open Display 7 by clicking it in the Project Navigation window.

Click on the first Jump condition in the Jumps box. T he Define Jump to Condition
box opens. Now enter MB 41 Error Message 1, as shown below.

Figure 83.

Defining a Jump Condition

Click OK. T he Define to Display Jump box opens.

Enter DS 10 Operator Messages as shown below.

57

U9 0 La dde r Tutor i a l

Figure 84.
5

Defining theJump Destination

Click OK . T he Display now appears together with the linked Variable and Jump
condition as shown below. You can also see Display 10, Operator Messages, in the
Project Navigation Window.

Figure 85.

Display and Jump

Now, you must set two additional Jump conditions.


6

Click on the second Jump condition in the Jumps box. T he Define Jump to Condition
box opens.

Enter MB 43 Error Message 2, then click OK. T he Define to Display Jump box
opens.

8
9

58

Enter DS 10 Operator Messages as shown in Figure 78, page 45, then click OK.
Click on the third Jump condition in the Jumps box. T he Define Jump to Condition
box opens. Now enter MB 2 Bundle Complete, as shown below.

U9 0 La dde r Tutor i a l

Figure 86.

Defining a Jump Condition

10

Click OK. T he Define to Display Jump box opens.

11

Enter DS 8 Operator Messages as shown in Figure 78, page 45, then click OK.

12

T he completed display, together with all three Jump conditions, looks like Figure 79,
page 45 below.

Figure 87.

Completed Display

To review:
In this section, you made a Display that:


Enables the operator to receive messages regarding the status of the system.

59

U9 0 La dde r Tutor i a l

Now you will create the operator messages. Display 8 contains one variablewhich can show
one of 3 messages. T his is possible because the variable is a List Variable. T he text of a List
Variable changes according to the value of the MI to which it has been linked.

Defining the Operator Message Display


T his display contains no fixed text.
1
2

Open Display 8 by clicking it in the Project Navigation window.

Create a placeholder for the message text by selecting the entire screen, then clicking
the Attach Variable button. T he Attach Variable box opens.
Enter Variable 8 Operator Messages as shown below.

Figure 88.
4

Attaching a Variable

Click OK . Display 8 appears with red pound signs as shown below.

Figure 89.

Attached Variable

Now, you will format Variable 8, Operator Messages.


5

60

Open Variable 8 from the Project Navigation Window.

Select List from the Variable T ype list. T he Set Link to List box
opens.

Enter MI 5 Operator Message List as shown in Figure 90, page


61

U9 0 La dde r Tutor i a l

Figure 90.

Linking a List Variable

Click OK . List Variable 8 opens.

Enter the messages, 0,1 and 2, as shown below.

Figure 91.

Defining a List Variable

T he final Display in your HMI is completeexcept for Jump conditions.


T he Jump conditions will cause this Display to change if:


An operator presses the M90s ENTER key.

T he bundle of boxes is complete.

An operator message is displayed for a preset amount of time.

To set the Jump conditions


1

Open Display 8 by clicking it in the Project Navigation window.

61

U9 0 La dde r Tutor i a l
2

Click on the first Jump condition in the Jumps box. T he Define Jump to Condition
box opens. Now enter SB 53 Enter key is pressed.

Click OK. T he Define to Display Box opens.

Enter DS 7 Box Count, then click OK as shown below

Figure 92.
5

Defining a Jump Destination

T he Display now appears together with the linked Variable and Jump condition.

Now, you must set two additional Jump conditions.


6

62

Click on the second Jump condition in the Jumps box. T he Define Jump to Condition
box opens.
Enter MB 4 Return to Initial Log-in Display as shown below.

U9 0 La dde r Tutor i a l

Figure 93.

Defining a Jump Condition

Click OK. T he Define to Display Jump box opens.

Enter DS 1 Initial Log-in Display.

10

Click ENTER . T he screen appears with the two Jump conditions as shown below

Figure 94.
11

12

Defining a Jump Condition

Click on the third Jump condition in the Jumps box. T he Define Jump to Condition
box opens.
Enter MB 5 Message Time Elapsed.

63

U9 0 La dde r Tutor i a l
13

Click OK. T he Define to Display Jump box opens.

14

Enter Display 7 Box Count.

15

Click OK. T he screen looks like Figure 95, page 82.

Figure 95.

Final Display Complete

To review:
Your HMI is now complete. In this section, you:

64

Defined operator messages.

Set Jump conditions that allow exit from this final display.

U9 0 La dde r Tutor i a l

Chapter 7

The Ladder Application

S etting Maintenance Times


T o build Ladder Net 11, place the Ladder elements as shown in the figure below.
It contains:


An Indirect T ime clock function

A Direct Coil

MI 2 and MI3 define the time range for this Indirect T ime function.
Remember that in the previous section, you defined two Displays to allow the operator to set
times for system maintenance. T hese Displays use variables to accept time values that are
entered by the operator via the M90 keypad. In Display 5, Variable 2 Start Time was linked
to MI32. In Display 6, Variable 3 End Time was linked to MI 3.
When the current RT C1 time is within this range, power will not flow through the function
block. T he power flow drives a direct coil, linked to MB 6. T his condition prevents the
machine from running during maintenance time.

Figure 95. Net 11


Net 11 reads:
If the current tim e falls after the tim e contained in MI 2 and before the tim e
contained in MI3, then energize MB 6 to logic 1.
In other words, during this time, the machine cannot run, and cannot accidentally be turned
on during maintenance.

Starting the Bundling Machine


T he next net starts the bundling machine. T o build Ladder Net 12, place the Ladder elements
as shown in the figures below.
T he first part of this net fills these conditions:

T he machine can be started only by an approved operator

T he machine cannot run over the weekend

RTC: Real Time Clock. The M90 has an internal RTC that is used to handle time and date functions.
65

U9 0 La dde r Tutor i a l

T he first part of this net contains:




A Direct Contact linked to MB 20, which turns ON when an approved operator logs in

A Direct T ime function block: Day of the Week.

To use a Direct Time Function Block


1

From the Clock Menu, select Direct Clock Functions, and then click Day Of The Week.

When you place the function block into the net, the Day Of The Week box opens as
shown below.

Figure 94. Net 12Direct Time


3

Select the days on which you want the application to run, then click OK.

The function block appears with the days of the week marked as shown below.

Figure 94. Net 12Day of the Week


T he second part of this net fills these conditions:


T he machine cannot run during maintenance times

T he machine cannot run if Displays 1-6 are displayed

T he second part of this net contains:




An Indirect Direct Contact linked to MB 6, which is turned ON during maintenance


time

A Compare function block, which checks if the Current Display is higher than 6.

A Direct Coil, linked to Output 0, Start Machine

Note that the current Display can be higher than 6 only:


66

U9 0 La dde r Tutor i a l


If an approved operator has logged in, and

If the operator has entered system parameters.

Figure 94. Net 12, Start Machine


T his part of Net 12 reads as follows:
If MB is on, and it is not Sunday or Saturday, and MB6 is off, and a Display
higher than 6 is being Displayed, Start the m achine.

Creating a Counter
You used the conditions in Net 12 to start the bundling machine. You can also use them to
drive the box counter. T he counter is connected to a photocell. Each time the photocell
sees a box, the counter increments by one.
SB 50, which is linked to the +/- key on the M89 keypad, acts as the photocell.
T he third part of this net fills these conditions:


When the box passes the photocell, the counter increments by one.

T he third part of this net contains:




A Positive T ransition Contact linked to SB 50, which is turned ON when the +/- key is
pushed

An Add function block, which acts as a counter.

Each time SB 50 is turns on, the constant 1 is added to the current number of boxes stored in
MI 10. T he result is stored in MI 10 as shown below.
In other words, each time you press the M90s +/- key, the counter increments by 1.

67

U9 0 La dde r Tutor i a l

Figure 94. Net 12, Counter


Net 12 is now complete. It reads as follows:
If MB 20 is turned ON, and it is a w eekday, and MB6 is off, and the current
Display is higher than 6, Start the m achineTHEN w hen SB 50 is on, add 1 to
the current value in MI 10, then store the result in MI 10.
Before the counter in Net 12 can work, you must initialize (zero) the counter value.

Initializing the Counter


Insert a new net in front of Net 12, and then place the elements in the net as shown below.
T his new net fills these conditions:


When an approved operator has logged in, place the value 0 in the counter.

T he third part of this net contains:




A Positive T ransition Contact linked to MB 20, which is turned ON when an approved


operator logs in.

A Store function block, which stores 0 in MI 10.

Figure 94. Initializing the Counter

68

U9 0 La dde r Tutor i a l

Chapter 8

LadderMonitoring the System

T he Ladder nets you create in this section enable the M90 to monitor the system. T he
Ladder program also enables the M90 to display the appropriate message to the operator.
T his part of the application covers the following events:


A box is stuck

T he conveyor belt is not delivering boxes into the system

A bundle of boxes has been completed

T o build these nets, place the Ladder elements as shown in the figures below.

S tuck BoxTimer
T his net contains:


T wo Direct Contacts. Note that SB 50 is the photocell.

A Direct Coil.

T he net reads:
When a box passes the photocell and the m achine is running, start Tim er 0.
T he bit condition of this timer will be used in another net to display an operator message.

Figure 100. Stuck Box

First Box Detected


T he net shown below contains:



A Positive T ransition Contact linked to SB 50, the photocell.


A Set Coil.

T he net fulfills these conditions:


When the first box passes the photocell, set MB 31. MB 31 remains on. T his condition will
be used in the next net to start a timer, which in turn will cause an operator message to be
displayed.

Figure 94. First Box Detected

Conveyor S toppedTimer

69

U9 0 La dde r Tutor i a l

T he net shown below uses three contacts to activate T imer 1, Conveyor Stopped.
Note that SB 50, the photocell is now linked to an Inverted Contact, Normally Off. T his
means that power can flow to the other side only when the M90s +/- button is not pushed. In
other words, when the photocell does not detect a box.
T he net reads:
When the first box passes the photocell, and w hen the photocell does not
detect a box, and w hen the m achine is on, start Tim er 1. T he bit condition of this
timer will be used in another net to display an operator message.

Figure 94. Conveyor StoppedTimer

Jump to Operator Message S creen


T he net shown below causes the M90s current Display to jump from Display 7 Box Count to
Display 8 Operator Message.
T his net reads:
When the Current Num ber of Boxes equals the Set Quantity of Boxes, and the
current Display is 7, turn MB 2 on.

About Display 8
Remember that Display 8 Operator Message is linked to List Variable 8, which
contains 3 text messages. T his variable is linked to MI 5. T he value in MI5 determines
which message is displayed on the M90s screen, according to the number of the message

Figure 94. Jump to Operator Message

Display Operator Message 0Bundle Complete


T his net causes message 0 to be displayed within Display 8.
T his net reads:
When MB 2 turns ON, Store 0 in MI 5.
70

U9 0 La dde r Tutor i a l

T he result is that message 0 of List Variable 8 is displayed on the M90s screen: Bundle
Complete.

Figure 94. Display Bundle Complete

Timer 0S tuck Box


T his net creates a condition that you will use to change the value in MI 5. T imer 0 is linked
to a Direct Contact. When the timer is finished counting down, power flows through the
contact.
T he net below reads:
When Tim er 0 is finished, and the bundle is not com plete, turn on MB 41.

Figure 94. Display Box is Stuck!

Display Operator Message 1Box is S tuck!


T he net shown below contains:



A Positive T ransition Contact linked to MB 41


A Store function block

T his net reads:


When MB 41 turns on, Store 1 in MI 5.
T he result is that message 1 of List Variable 8 is displayed on the M90s screen: Box is Stuck!

Figure 94. Display Box is Stuck!

71

U9 0 La dde r Tutor i a l

Timer 1: Conveyor S topped


T he net shown below contains:


A Direct Contact linked to T imer 1

An Indirect Contact

A Coil

T his net reads:


When Tim er 1 is finished, and the bundle is not com plete, turn MB42 on.
MB 42 will be used to display the Conveyor Stopped error message.

Figure 94. Display Box is Stuck!

Display Operator Message Conveyor S topped


T he net shown below contains:



A Positive T ransition Contact linked to MB 42


A Store function block

T his net reads:


When MB 42 turns on, Store 2 in MI 5.
T he result is that message 2 of List Variable 8 is displayed on the M90s screen: Conveyor
Stopped.

Figure 94. Conveyor Stopped

Timer: Operator Messages


T he net shown below creates a timer that:


Determines the length of time an operator message is displayed on the M90s screen

Whose condition is used to exit Display 8 Operator Messages

T his net reads:


When the Current Display is 8, and MI 5 is equal to 0, start Tim er 3
In other words, when the Bundle Complete message is on the M90s screen, T imer 3 starts.

72

U9 0 La dde r Tutor i a l

Figure 94. Display Timer

When the Bundle is Complete


T he net below causes the display screen to change once the bundle of boxes is complete.
T he net reads:
When Tim er 3 is on, turn MB 4 on.
T his means that Bundle Complete is displayed on the M90s screen for 2 secondsand then
the screen jumps to the Initial Log-in display. When this happens, the application has run
successfully.

Figure 94. Application Complete

When S ystem Problems have been Fixed


T here are 2 possible errors within this system:


Box is Stuck!

Conveyor Stopped

T he error messages are displayed when MB 41 and MB42 are on. When the errors have been
fixed, these MBs will be off.
T he net below reads:
When MB 41 and MB42 are off, and the current Display is 8, turn on Tim er 4.

Figure 94. Error Fixed


73

U9 0 La dde r Tutor i a l

Exit Display 8
T he net below allows a Jump from Display 8 Operator Messages.
T his net reads:
When Tim er 4 is finished, turn MB5 on.
MB 5 is used as a Jump condition in Display 8. When MB 5 turns on, the Jump condition will
be fulfilled and Display 7 Box Count will appear on the M90s screen.

Figure 94. Error Fixed

74

You might also like