Вы находитесь на странице: 1из 98

Table of Contents

LEARNING U90 LADDER


The Sample Application Getting Started
To open a new project: To save a project:

5
6 7
7 8

DISPLAYS: OPERATOR LOG-IN


To create an initial Display To create a Linked Variable To format a Variable To create a Jump condition To review: To format Display 2: To format Variable 9: To format Display 3: To format Variable 7:

10
10 12 13 16 19 19 22 23 24

HOW TO BUILD A NET LADDER: OPERATOR LOG-IN


Condition 1
To Copy and Paste:

27 34
34
35

These three nets create: Condition 2 Condition 3 To reset coils


To Build Net One To Build Net Two

39 40 42 45
46 46

To Reset MI 4 To download a project

48 49

DISPLAYS: ENTERING PARAMETERS


Setting the Box Count To Create and Link a Variable To format a Keypad Entry Variable To create a Jump condition To review: Setting Maintenance Time

52
52 54 56 58 60 61

III

Programming the M 90
Setting a Start Time 61

Enabling a Keypad-entry Start Time To Format a Keypad Time Entry Variable To create a Jump To review: Setting an End Time Enabling a Keypad-entry End Time To Format a Keypad Time Entry Variable To review:

61 62 64 66 66 66 68 69

DISPLAYS: DISPLAYING RUN-TIME DATA


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

70
70 71 75 75 75 79 79 82 86

THE LADDER APPLICATION


Setting Maintenance Times

87
87

Starting the Bundling Machine


To use a Direct Time Function Block

88
88

Creating a Counter Initializing the Counter

90 91

LADDERMONITORING THE SYSTEM


Stuck BoxTimer First Box Detected Conveyor StoppedTimer Jump to Operator Message Screen About Display 8 Display Operator Message 0Bundle Complete Timer 0Stuck Box Display Operator Message 1Box is Stuck! Timer 1: Conveyor Stopped Display Operator Message Conveyor Stopped Timer: Operator Messages When the Bundle is Complete When System Problems have been Fixed Exit Display 8

93
93 93 94 94 95 95 96 96 97 97 98 99 99 100

U90 Ladder T u torial

Learning U90 Ladder


The Unitronics M90 OPLC is a micro-controller used to automate industrial and domestic processes. U90 Ladder software is used to create the automation project. This tutorial is to be used together with:
T T T

The enclosed sample application U90 Ladder software An M90 OPLC controller Displays Timers Math Functions Store Functions
T T T

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

Variables Counters Compare 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.

Programming the M 90

The Sample Application


In this application, you write an application that automates a box-counting machine. This machine counts boxes before they are packaged into bundles. A photocell is installed at the machines entrance. The boxes are counted as they pass the photocell. The 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 T

The number of boxes per bundle 1 hour each day when the system will not be able to run A running box count A message when the set number of boxes per bundle is reached Error messages

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

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.

U90 Ladder T u torial

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

To open a new project:


1 2

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. The selected model name now appears above the M90 picture.

Programming the M 90

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.

Before you begin programming, save your new project.

To save a project:
1 2 3 4

Select Save As from the Project drop-down menu. The Save As window opens. Select the desired folder. Enter Factory Tutorial as the file name. Note that the file extension will be .U90.

U90 Ladder T u torial

Figure 3.
5

Save As Dialog Box

Click Save.

You are now ready to begin writing your project.

Programming the M 90

Displays: Operator Log-in


To allow operators to log in, you create an interactive user interface. This means that the messages displayed on the M90s screen tell the operator to enter certain information. The operator then enters the information using the M90s keypad.
How can you create an interactive user interface?

You need:
T T T T

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.

To 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.
6

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.

10

U90 Ladder T u torial

Figure 4.
8

Initial Display

Enter the Display text User ID no. in the Display window.

Figure 5.

Enter ID Number

11

Programming the M 90

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

To create a Linked Variable


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

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

Figure 6.
10 11

Select Variable Space

Click Attach Variable on the HMI toolbar. The Attach Variable dialog box opens.

Figure 7.
12

Attach a Variable

Enter VR 6 Worker ID no.

12

U90 Ladder T u torial 13

Press OK

Figure 8.
14

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
This Variable will accept a two-digit number between one and ninety. The operator enters the number using the M90 keypad.
15

Open Variable 6 from the Project Navigation Window.

13

Programming the M 90

Figure 10.
16

Select Integer from the Variable Type list, then click on the Link To button. The Set Link to Int box opens.

Figure 11.
17

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

14

U90 Ladder T u torial

Figure 12.
18 19

Select Keypad Entry from the Variable Information list. Select Start with Clear Field. This 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 with Clear Field, the last ID number entered will be displayed. Set Entry Limits from one to ninety.

20

Figure 13.

15

Programming the M 90

You have a Display. You have an attached Variable. Together, 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. To 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. The ENTER key pressed will be the Jump condition.
21

Select Display 1 from the Project Navigation Window.

Figure 14.
22

Click to open the first Jump Condition. The Define Jump to Condition box opens.

16

U90 Ladder T u torial

Figure 15.
23

Enter SB30 Keypad entries complete. Click OK.

Figure 16.
24 25

The Define to Display Jump box opens. Enter DS 2 Number Confirmation. Click OK.

17

Programming the M 90

Figure 17.
26

The Display now appears with the linked Variable and Jump condition.

Figure 18.

18

U90 Ladder T u torial

To review:
For one Display, you have created:
T T T

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. This will be Display 2. There are two options for the ID number: access okayed or access denied. These 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:
T T

Fixed this text will be part of all Display 2 screens. Variable this text will vary with the conditions in Display 2.

To format Display 2:
27 28 29 30 31

Title Display 2 Number Verification. Enter the text Access. This will be Fixed text in the message. Enter the text verify. This will be variable text in the message. Select verify. Click the Attach Variable icon on the HMI toolbar.

Figure 19.
32

Attach Variable 9 Number verification.

19

Programming the M 90

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

Click to open the first Jump Condition. The Define Jump to Condition box opens. Enter MB 7 Time to jump to 3. Click OK.

34

Figure 21.
35 36

The Define to Display Jump box opens. Enter DS 3 Present the worker name. Click OK.

20

U90 Ladder T u torial

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

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

21

Programming the M 90

To format Variable 9:
37 38

Open Variable 9 through the Navigation editor. Select Bit for the Variable Type list. The Set Link to Bit box opens. Enter MB 20 System can work. Click OK.

39

Figure 24.
40 41

Enter denied in the Text for off (0) box. Enter okayed in the Text for on (1) box.

22

U90 Ladder T u torial

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

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. This Display will read Welcome ______ with the Operators name. This 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:
42 43 44

Title Display 3 Present worker name. Enter the fixed text Welcome. Select eight spaces for the variable text and attach Variable 7 Name of worker.

23

Programming the M 90 45

Set one Jump condition for an active keyboard to jump to Display 4 using SB 6 Keyboard is Active.

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:
46 47

Open Variable 7 from the Project Navigation Window. Select List from the Variable Type list. The 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 14.

48

24

U90 Ladder T u torial

Figure 27.
49

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.

50 51

Figure 28.
52

Scroll down to List Variables 10, 11 and 12. These will be the three workers allowed to operate the conveyor belt.

25

Programming the M 90 53

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 Tutorial 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. Therefore, 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.

26

U90 Ladder T u torial

How to Build a Net


In this section, you learn how to select Ladder elements and place them within a net. To learn about Ladder elements and their functions, please refer to U90 Ladders online help. The Ladder net in this example contains:
T T

Two 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.

27

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

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.

28

U90 Ladder T u torial 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.

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

29

Programming the M 90

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.
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.

30

U90 Ladder T u torial

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.

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.

31

Programming the M 90

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.

32

U90 Ladder T u torial

Figure 36 This net is the first net used in the Error! Cannot open file., section of this tutorial.

33

Programming the M 90

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:
T T T

MB 20 MB 7 MB 8

Conveyor system can work Jump to Display 3 for an approved worker ID number 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 you are in Display 2 and worker ID number is approved then turn MB 20 ON. Ladder net for worker ID number 10 consists of:
T T

Two Equal function blocks (If and and) One Set coil.

34

U90 Ladder T u torial

Figure 44. Net One reads:

Log-in Ladder

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:


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

Figure 45.

Selecting the elements to copy

35

Programming the M 90

Figure 46.

The Elements selected

21 Click COPY on the Standard toolbar. 22 Click PASTE on the Standard toolbar. 23 Move the pointer to the net in which you want to paste, then click.

Figure 47.

Placing the pointer in the net

36

U90 Ladder T u torial

Figure 48.

Copying the elements to the net

24 Now change the worker ID number 10 to 11.

Figure 49.

Changing #10 to #11

37

Programming the M 90

Figure 50.

Updated Net Two

Repeat the same process for worker ID number 12.

38

U90 Ladder T u torial

These three nets create:

Figure 51.

Nets for worker ID numbers 10, 11 and 12

39

Programming the M 90

These 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. This net consists of:
T T

Three Direct contacts. One Direct coil.

Figure 52. Net Four reads:

Net for conveyor system to work

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

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

One Equal function block. One Direct contact.

40

U90 Ladder T u torial


T T T

One Positive Rise contact. One Timer. One Direct coil

Figure 53. Net Five reads:

Timer to jump to Display 3

If the Current Display (SI 2) is Display 2 (#2) and the system can work (MB 20 is ON) then turn Timer 7 ON. Timer 7 will then begin count down from 4 seconds. Remember that timers also have a bit value. Direct coil T7 will turn ON when T7 finishes counting down from 4 seconds and reaches 0.

41

Programming the M 90

Figure 54. Net Six reads: When Timer 7 counts down to 0 seconds and turns ON, turn ON MB 7. Remember that MB 7 provides the Jump condition from Display 2 to Display 3. Timer 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 you are in Display 2 and MB 20 is not ON then turn MB 8 ON and jump to Display 1. The Ladder nets for jumping to Display 1 consist of:
T T T

One Equal function block. One Inverted contact. One Timer.

42

U90 Ladder T u torial


T T

One Positive Rise contact. One Direct coil.

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

43

Programming the M 90

Figure 56. Net Eight reads: When Timer 8 counts down 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.
T T

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. This value is stored until overwritten by another value. The MI 4 value should be cleared with each scan.

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

44

U90 Ladder T u torial

To reset coils
Each Set coil must:
T T

Have a Reset coil with the same Operand and address - and Be in a net that can conduct power flow. One Equal function block One Direct coil One Positive Transition contact Three Reset coils One Store Direct function block

The reset conditions will be built with:


T T T T T

Figure 57.
1

Clicking the Insert New Net icon

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.

45

Programming the M 90

Figure 58.
3

Placing the pointer in the net

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


4 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

46

U90 Ladder T u torial Place Ladder elements into Net Two as shown in the figure below. To allow the single, one-shot connection 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

47

Programming the M 90

Figure 61. Net Two reads:

Reset conditions

When MB 30 turns ON, reset MB 10, MB 11 and MB 12. You have given Reset coil conditions to each Set coil condition. Those 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: Enter ID no. The 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.

48

U90 Ladder T u torial

The zero condition will be built with:


T

One Store Direct function block

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

Figure 62. Net Two 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 Welcome _______ 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.
7 8 Click the DOWNLOAD Icon on the HMI toolbar. Download all sections.

49

Programming the M 90

You will see Display 1. The screen will go blank after you press Enter. You can reset the program on-line using the de-bugging feature.
9 Click the DEBUG Icon on the HMI toolbar.

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

Figure 64.
11 Click on the OPERAND AND ADDRESS to open debugging dialog box. 12 Enter 1 in the NEW box and click SEND.

50

U90 Ladder T u torial

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

Figure 66.

51

Programming the M 90

Displays: Entering Parameters


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

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.

To 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.
54

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

55

52

U90 Ladder T u torial

Figure 67
56

Naming a Display

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

Figure 68

Creating a Text Message

To allow the operator to set the number of boxes per bundle, you need to link a Variable to your Display. This 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.

53

Programming the M 90

To Create and Link a Variable


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

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

Figure 69.
58

Selecting Variable Space

Click Attach Variable on the HMI toolbar as shown below.

Figure 70.

Attaching a Variable

54

U90 Ladder T u torial 59

The Attach Variable dialog box opens as shown in Figure 71.

Figure 71.
60

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

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.

55

Programming the M 90

To format a Keypad Entry Variable


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

Open Variable 5 from the Project Navigation Window.

Figure 73.
62

Selecting a Variable Type

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

56

U90 Ladder T u torial

Figure 74.
63

Linking an MI to a Variable

Enter MI 11 Set Box Quantity, then Click OK. The Variable is now linked to MI 11. You will format MI 11 later. Select Keypad Entry from the Variable Information list. Select Start with Clear Field. If you do not select Start with 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 58 below.

64 65

66

57

Programming the M 90

Figure 75.

Formatting an Entry Variable

You have a Display. You have an attached Variable. Together, 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. To 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. This will fulfill the Jump condition and cause the Display to change.
67

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

58

U90 Ladder T u torial

Figure 76.
68

Creating a Jump Condition

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

69

Figure 77.
70 71

Defining a Jump Condition

Click OK. The Define to Display Jump box opens. Enter DS 5 Enter Start Time as shown below.

59

Programming the M 90

Figure 78.
72

Defining theJump Destination

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

Figure 79.

Completed Display

To review:
For this Display, you have created:
T

A text Display.

60

U90 Ladder T u torial


T T

A keypad-enabled Variable. A Jump condition to respond to the keypad entry.

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

Setting Maintenance Time


Setting a Start Time
73

Click Display 5 in the Project Navigation window. Display 5, Enter Start Time, opens in the Display editor. . Enter the Display text Start Time:_____ in the Display window, as shown in Figure 80 below.

74

Figure 80

Display 5: Jump Destination Display

Enabling a Keypad-entry Start Time


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

Select 5 spaces in the display text by clicking and dragging. Click Attach Variable. The Attach Variable box opens as shown below.

61

Programming the M 90

Figure 81.
77

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.

To Format a Keypad Time Entry Variable


When you have finished formatting this Variable, it will accept a Start Time that is entered by the operator via the M90 keypad.
78 79

Open Variable 2 by clicking it in the Project Navigation Window. Select Time Functions from the Variable Type list. The Set Link to Time function box opens.

62

U90 Ladder T u torial 80

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 Time.

Figure 83
81

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 Time for maintenance. Once the operator has set the Start Time, he must also set an End Time.

63

Programming the M 90

You need to create a jump condition that will bring the operator to the End Time Display.

To create a Jump
After an operator enters the Start Time (s)he presses the ENTER key. This will fulfill the Jump condition and cause the Display to change.
82 83

Open Display 5 by clicking it in the Project Navigation window. Click on the first Jump condition in the Jumps box. The Define Jump to Condition box opens. Now enter SB30 Keypad entries complete, as shown below.

Figure 85.
84 85

Defining a Jump Condition

Click OK. The Define to Display Jump box opens Enter DS 6 Enter End Time as shown below.

64

U90 Ladder T u torial

Figure 86.
86

Defining theJump Destination

Click OK. The 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.

Figure 87.

Completed Display

65

Programming the M 90

To review:
For this Display, you have created:
T T T

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. This Display will allow the operator to set an end time for the maintenance period.

Setting an End Time


87

Click Display 6 in the Project Navigation window. Display 6, Enter End Time, opens in the Display editor. Enter the Display text End Time: in the Display window, as shown in Figure 80 below.

88

Figure 88

Display 6: Jump Destination Display

Enabling a Keypad-entry End Time


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

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

66

U90 Ladder T u torial 90

Click Attach Variable. The Attach Variable box opens as shown below.

Figure 89.
91

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

67

Programming the M 90

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 Time that is entered by the operator via the M90 keypad.
92 93

Open Variable 3 by clicking it in the Project Navigation Window. Select Time Functions from the Variable Type list. The 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 Time.

94

Figure 91
95

Linking a Variable

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

68

U90 Ladder T u torial

Figure 92.

Selecting a Variable Type

You now have an interactive display that enables the operator to enter an End Time for system maintenance. After an operator enters the End Time (s)he presses the ENTER key. This will fulfill the Jump condition and cause the Display to change. We will set up the jump condition for this screen in @@@@

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

Set the amount of boxes per bundle. Set the starting time for system maintenance. Set an ending time for system maintenance.

69

Programming the M 90

Displays: Displaying Run-Time Data


At this point, your application allows the operator to:
T T T

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-time Data? In this part of the application, you will:
T T

Create a Display that shows a running box count. Create a Display that allows the operator to track events or errors within the system.

The running box count display will contain 2 variable values. The first variable is the actual number of boxes that are counted as they pass a photocell. This variable will be linked to an MI which serves as a counter in your Ladder program. The second variable is the number of boxes per bundle. This 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.
96

Click the Display icon on the Ladder toolbar. Display 7 opens in the Display editor. We will name this Display Box Count. Type 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.

97

70

U90 Ladder T u torial

Figure 74
98

Naming a Display

Enter the Display text Box___out of___ in the Display window, as shown in Figure 68 below. The 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: 99

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

71

Programming the M 90

Figure 76.

Selecting Variable Space

100 Click Attach Variable on the HMI toolbar. 101 The Attach Variable dialog box opens as shown in Figure 71.

Figure 77.

Enter Variable Number and Address

102 Enter VR 4 Boxes Counted, then press OK. Display 7 now appears

with the Variable-linked spaces as red pound signs as shown in Figure 72 below. Now format Variable 4.
103 Click on Variable 4 in the Program Navigation Window, and then

select Integer as the Variable Type.


104 Click on the LINK TO button, and then link MI 10 Current Number of

Boxes as shown below.

72

U90 Ladder T u torial

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.
105

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

Figure 79.

Selecting Variable Space

106 Click Attach Variable on the HMI toolbar. 107 The Attach Variable dialog box opens as shown in Figure 71.

73

Programming the M 90

Figure 80.

Enter Variable Number and Address

108 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.
Now format Variable 1.

Display 7 with Attached Variables

109 Click on Variable 1 in the Program Navigation Window, and then

select Integer as the Variable Type.

74

U90 Ladder T u torial 110 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.
111 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:
T

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
There 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


112 Open Display 7 by clicking it in the Project Navigation window. 113 Click on the first Jump condition in the Jumps box. The Define

Jump to Condition box opens. Now enter MB 41 Error Message 1, as shown below.

75

Programming the M 90

Figure 83.

Defining a Jump Condition

114 Click OK. The Define to Display Jump box opens. 115 Enter DS 10 Operator Messages as shown below.

Figure 84.

Defining theJump Destination

116 Click OK. The 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.

76

U90 Ladder T u torial

Figure 85.

Display and Jump

Now, you must set two additional Jump conditions. 117 Click on the second Jump condition in the Jumps box. The Define

Jump to Condition box opens.


118 Enter MB 43 Error Message 2, then click OK. The Define to

Display Jump box opens.


119 Enter DS 10 Operator Messages as shown in Figure 78, page 60,

then click OK.


120 Click on the third Jump condition in the Jumps box. The Define

Jump to Condition box opens. Now enter MB 2 Bundle Complete, as shown below.

77

Programming the M 90

Figure 86.
121

Defining a Jump Condition

Click OK. The Define to Display Jump box opens. then click OK.

122 Enter DS 8 Operator Messages as shown in Figure 78, page 60,

123 The completed display, together with all three Jump conditions, looks

like Figure 79, page 60 below.

78

U90 Ladder T u torial

Figure 87.

Completed Display

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

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

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

Defining the Operator Message Display


This display contains no fixed text.

79

Programming the M 90 124 Open Display 8 by clicking it in the Project Navigation window. 125 Create a placeholder for the message text by selecting the entire

screen, then clicking the Attach Variable button. The Attach Variable box opens.
126

Enter Variable 8 Operator Messages as shown below.

Figure 88.

Attaching a Variable

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

Figure 89.

Attached Variable

Now, you will format Variable 8, Operator Messages. 128 Open Variable 8 from the Project Navigation Window. 129 Select List from the Variable Type list. The Set Link to List box

opens.

80

U90 Ladder T u torial 130 Enter MI 5 Operator Message List as shown in Figure 90

Figure 90.
131 Click OK. List Variable 8 opens.

Linking a List Variable

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

81

Programming the M 90

Figure 91.

Defining a List Variable

The final Display in your HMI is completeexcept for Jump conditions. The Jump conditions will cause this Display to change if:
T T T

An operator presses the M90s ENTER key. The bundle of boxes is complete. An operator message is displayed for a preset amount of time.

To set the Jump conditions


133 Open Display 8 by clicking it in the Project Navigation window. 134 Click on the first Jump condition in the Jumps box. The Define

Jump to Condition box opens. Now enter SB 53 Enter key is pressed.


135 Click OK. The Define to Display Box opens. 136 Enter DS 7 Box Count, then click OK as shown below

82

U90 Ladder T u torial

Figure 92.

Defining a Jump Destination

137 The Display now appears together with the linked Variable and Jump

condition.
Now, you must set two additional Jump conditions. 138 Click on the second Jump condition in the Jumps box. The Define

Jump to Condition box opens.


139 Enter MB 4 Return to Initial Log-in Display as shown below.

83

Programming the M 90

Figure 93.

Defining a Jump Condition

140 Click OK. The Define to Display Jump box opens. 141 Enter DS 1 Initial Log-in Display. 142 Click ENTER. The screen appears with the two Jump conditions as

shown below

84

U90 Ladder T u torial

Figure 94.

Defining a Jump Condition

143 Click on the third Jump condition in the Jumps box. The Define

Jump to Condition box opens.


144 Enter MB 5 Message Time Elapsed. 145 Click OK. The Define to Display Jump box opens. 146 Enter Display 7 Box Count. 147 Click OK. The screen looks like Figure 95, page 86.

85

Programming the M 90

Figure 95.

Final Display Complete

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

Defined operator messages. Set Jump conditions that allow exit from this final display.

86

U90 Ladder T u torial

The Ladder Application


Setting Maintenance Times
To build Ladder Net 11, place the Ladder elements as shown in the figure below. It contains:
T T

An Indirect Time clock function A Direct Coil

MI 2 and MI3 define the time range for this Indirect Time function. Remember that in the previous section, you defined two Displays to allow the operator to set times for system maintenance. These 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 RTC1 time is within this range, power will not flow through the function block. The power flow drives a direct coil, linked to MB 6. This condition prevents the machine from running during maintenance time.

Figure 95. Net 11 Net 11 reads:

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

87

Programming the M 90

If the current time falls after the time contained in MI 2 and before the time 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


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

The machine can be started only by an approved operator The machine cannot run over the weekend A Direct Contact linked to MB 20, energized when an approved operator logs in A Direct Time function block: Day of the Week.

The first part of this net contains:


T T

To use a Direct Time Function Block


13 From the Clock Menu, select Direct Clock Functions, and then click Day Of The Week. 14 When you place the function block into the net, the Day Of The Week box opens as shown below.

Figure 94. Net 12Direct Time

88

U90 Ladder T u torial 15 Select the days on which you want the application to run, then click OK. 16 The function block appears with the days of the week marked as shown below.

Figure 94. Net 12Day of the Week The second part of this net fills these conditions:
T T

The machine cannot run during maintenance times The machine cannot run if Displays 1-6 are displayed An Indirect Direct Contact linked to MB 6, which is energized 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 If an approved operator has logged in, and If the operator has entered system parameters.

The second part of this net contains:


T T T

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


T T

89

Programming the M 90

Figure 94. Net 12, Start Machine This 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 machine.

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. The 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. The third part of this net fills these conditions:
T

When the box passes the photocell, the counter increments by one. A Positive Transition Contact linked to SB 50, which is energized when the +/key is pushed An Add function block, which acts as a counter.

The third part of this net contains:


T T

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

90

U90 Ladder T u torial

Figure 94. Net 12, Counter Net 12 is now complete. It reads as follows: If MB 20 is energized, and it is a weekday, and MB6 is off, and the current Display is higher than 6, Start the machineTHEN when 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. This new net fills these conditions:
T

When an approved operator has logged in, place the value 0 in the counter. A Positive Transition Contact linked to MB 20, which is energized when an approved operator logs in. A Store function block, which stores 0 in MI 10.

The third part of this net contains:


T T

91

Programming the M 90

Figure 94. Initializing the Counter

92

U90 Ladder T u torial

LadderMonitoring the System


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

A box is stuck The conveyor belt is not delivering boxes into the system A bundle of boxes has been completed

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

Stuck BoxTimer
This net contains:
T T

Two Direct Contacts. Note that SB 50 is the photocell. A Direct Coil.

The net reads: When a box passes the photocell and the machine is running, start Timer 0. The bit condition of this timer will be used in another net to display an operator message.

Figure 100. Stuck Box

First Box Detected


The net shown below contains:
T T

A Positive Transition Contact linked to SB 50, the photocell. A Set Coil.

The net fulfills these conditions:

93

Programming the M 90

When the first box passes the photocell, set MB 31. MB 31 remains on. This 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 StoppedTimer
The net shown below uses three contacts to activate Timer 1, Conveyor Stopped. Note that SB 50, the photocell is now linked to an Inverted Contact, Normally Off. This 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. The net reads: When the first box passes the photocell, and when the photocell does not detect a box, and when the machine is on, start Timer 1. The bit condition of this timer will be used in another net to display an operator message.

Figure 94. Conveyor StoppedTimer

Jump to Operator Message Screen


The net shown below causes the M90s current Display to jump from Display 7 Box Count to Display 8 Operator Message. This net reads:

94

U90 Ladder T u torial

When the Current Number 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. This variable is linked to MI 5. The 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


This net causes message 0 to be displayed within Display 8. This net reads: When MB 2 turns ON, Store 0 in MI 5. The result is that message 0 of List Variable 8 is displayed on the M90s screen: Bundle Complete.

95

Programming the M 90

Figure 94. Display Bundle Complete

Timer 0Stuck Box


This net creates a condition that you will use to change the value in MI 5. Timer 0 is linked to a Direct Contact. When the timer is finished counting down, power flows through the contact. The net below reads: When Timer 0 is finished, and the bundle is not complete, turn on MB 41.

Figure 94. Display Box is Stuck!

Display Operator Message 1Box is Stuck!


The net shown below contains:
T T

A Positive Transition Contact linked to MB 41 A Store function block

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

96

U90 Ladder T u torial

Figure 94. Display Box is Stuck!

Timer 1: Conveyor Stopped


The net shown below contains:
T T T

A Direct Contact linked to Timer 1 An Indirect Contact A Coil

This net reads: When Timer 1 is finished, and the bundle is not complete, 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 Stopped


The net shown below contains:
T T

A Positive Transition Contact linked to MB 42 A Store function block

97

Programming the M 90

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

Figure 94. Conveyor Stopped

Timer: Operator Messages


The net shown below creates a timer that:
T T

Determines the length of time an operator message is displayed on the M90s screen Whose condition is used to exit Display 8 Operator Messages

This net reads: When the Current Display is 8, and MI 5 is equal to 0, start Timer 3 In other words, when the Bundle Complete message is on the M90s screen, Timer 3 starts.

Figure 94. Display Timer

98

U90 Ladder T u torial

When the Bundle is Complete


The net below causes the display screen to change once the bundle of boxes is complete. The net reads: When Timer 3 is on, turn MB 4 on. This 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 System Problems have been Fixed


There are 2 possible errors within this system:
T T

Box is Stuck! Conveyor Stopped

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

99

Programming the M 90

Figure 94. Error Fixed

Exit Display 8
The net below allows a Jump from Display 8 Operator Messages. This net reads: When Timer 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

100

Вам также может понравиться