Download - PLC Ladder Tutorial
III
Table of Contents
LEARNING U90 LADDER 5 The Sample Application 6 Getting Started 7 To open a new project: 7 To save a project: 8
DISPLAYS: OPERATOR LOG-IN 10 To create an initial Display 10 To create a Linked Variable 12 To format a Variable 13 To create a Jump condition 16 To review: 19 To format Display 2: 19 To format Variable 9: 22 To format Display 3: 23 To format Variable 7: 24
HOW TO BUILD A NET 27
LADDER: OPERATOR LOG-IN 34 Condition 1 34 To Copy and Paste: 35 These three nets create: 39 Condition 2 40 Condition 3 42 To reset coils 45 To Build Net One 46 To Build Net Two 46 To Reset MI 4 48 To download a project 49
DISPLAYS: ENTERING PARAMETERS 52 Setting the Box Count 52 To Create and Link a Variable 54 To format a Keypad Entry Variable 56 To create a Jump condition 58 To review: 60 Setting Maintenance Time 61
Programming the M90
4
Setting a Start Time 61 Enabling a Keypad-entry Start Time 61 To Format a Keypad Time Entry Variable 62 To create a Jump 64 To review: 66 Setting an End Time 66 Enabling a Keypad-entry End Time 66 To Format a Keypad Time Entry Variable 68 To review: 69
DISPLAYS: DISPLAYING RUN-TIME DATA 70 Displaying a Running Box Count 70 To Create and Link Variables 71 To review: 75 Jump conditions 75 To set the Jump conditions 75 To review: 79 Defining the Operator Message Display 79 To set the Jump conditions 82 To review: 86
THE LADDER APPLICATION 87 Setting Maintenance Times 87 Starting the Bundling Machine 88 To use a Direct Time Function Block 88 Creating a Counter 90 Initializing the Counter 91
LADDER—MONITORING THE SYSTEM 93 Stuck Box—Timer 93 First Box Detected 93 Conveyor Stopped—Timer 94 Jump to Operator Message Screen 94 About Display 8 95 Display Operator Message 0—Bundle Complete 95 Timer 0—Stuck Box 96 Display Operator Message 1—Box is Stuck! 96 Timer 1: Conveyor Stopped 97 Display Operator Message —Conveyor Stopped 97 Timer: Operator Messages 98 When the Bundle is Complete 99 When System Problems have been Fixed 99 Exit Display 8 100
U90 Ladder Tutorial
5
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:
�� The enclosed sample application �� U90 Ladder software �� An M90 OPLC controller
After completing this tutorial, you will be familiar with the use of:
�� Displays �� Variables �� Timers �� 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.
Programming the M90
6
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 machine’s 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 M90’s keypad to set:
�� The number of boxes per bundle �� 1 hour each day when the system will not be able to run
When the machine is running, the M90’s 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.
U90 Ladder Tutorial
7
Getting Started First, you need to open a new project.
To open a new project: 1 Open U90 Ladder.
2 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 M90
8
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 Select Save As from the Project drop-down menu.
2 The Save As window opens.
3 Select the desired folder.
4 Enter Factory Tutorial as the file name. Note that the file extension will be .U90.
U90 Ladder Tutorial
9
Figure 3. Save As Dialog Box
5 Click Save.
You are now ready to begin writing your project.
Programming the M90
10
Displays: Operator Log-in To allow operators to log in, you create an interactive user interface. This means that the messages displayed on the M90’s screen tell the operator to enter certain information. The operator then enters the information using the M90’s keypad.
How can you create an interactive 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.
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.
7 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.
U90 Ladder Tutorial
11
Figure 4. Initial Display
8 Enter the Display text User ID no. in the Display window.
Figure 5. Enter ID Number
Programming the M90
12
You have now created a Display—but 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. Select Variable Space
10 Click Attach Variable on the HMI toolbar.
11 The Attach Variable dialog box opens.
Figure 7. Attach a Variable
12 Enter VR 6 Worker ID no.
U90 Ladder Tutorial
13
13 Press OK
Figure 8. Enter Variable Number and Address
14 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.
Programming the M90
14
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.
U90 Ladder Tutorial
15
Figure 12.
18 Select Keypad Entry from the Variable Information list.
19 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.
20 Set Entry Limits from one to ninety.
Figure 13.
Programming the M90
16
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.
U90 Ladder Tutorial
17
Figure 15.
23 Enter SB30 Keypad entries complete. Click OK.
Figure 16.
24 The Define to Display Jump box opens.
25 Enter DS 2 Number Confirmation. Click OK.
Programming the M90
18
Figure 17.
26 The Display now appears with the linked Variable and Jump condition.
Figure 18.
U90 Ladder Tutorial
19
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. 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:
�� 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 Title Display 2 Number Verification.
28 Enter the text Access. This will be Fixed text in the message.
29 Enter the text verify. This will be variable text in the message.
30 Select verify.
31 Click the Attach Variable icon on the HMI toolbar.
Figure 19.
32 Attach Variable 9 Number verification.
Programming the M90
20
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.
34 Enter MB 7 Time to jump to 3. Click OK.
Figure 21.
35 The Define to Display Jump box opens.
36 Enter DS 3 Present the worker name. Click OK.
U90 Ladder Tutorial
21
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.
Programming the M90
22
To format Variable 9:
37 Open Variable 9 through the Navigation editor.
38 Select Bit for the Variable Type list. The Set Link to Bit box opens.
39 Enter MB 20 System can work. Click OK.
Figure 24.
40 Enter denied in the Text for off (0) box.
41 Enter okayed in the Text for on (1) box.
U90 Ladder Tutorial
23
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. This Display will read Welcome ______ with the Operator’s 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 Operator’s names.
To format Display 3:
42 Title Display 3 Present worker name.
43 Enter the fixed text Welcome.
44 Select eight spaces for the variable text and attach Variable 7 Name of worker.
Programming the M90
24
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 Open Variable 7 from the Project Navigation Window.
47 Select List from the Variable Type list. The Set Link to List box opens.
48 Enter MI 4 Worker Name List. You will remember that we created this Memory Integer for Variable 6, page 14.
U90 Ladder Tutorial
25
Figure 27.
49 Enter 90 in the Variable Information: Lines box. You will remember that the factory has 90 workers
50 Click APPLY.
51 Enter names in List Variables 0, 1 and 2. You do not need to enter ninety worker names in this sample program.
Figure 28.
52 Scroll down to List Variables 10, 11 and 12. These will be the three workers allowed to operate the conveyor belt.
Programming the M90
26
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.
U90 Ladder Tutorial
27
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 Ladder’s on-line help.
The Ladder net in this example contains:
�� Two Equal function blocks (‘If’ and ‘and’) �� One Set coil.
1 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.
Programming the M90
28
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.
5 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.
U90 Ladder Tutorial
29
6 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.
7 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
Programming the M90
30
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.
U90 Ladder Tutorial
31
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.
Programming the M90
32
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.
U90 Ladder Tutorial
33
Figure 36
This net is the first net used in the “Error! Cannot open file.,” section of this tutorial.
Programming the M90
34
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 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:
�� Two Equal function blocks (‘If’ and ‘and’) �� One Set coil.
U90 Ladder Tutorial
35
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 conditions—even 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
Programming the M90
36
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
U90 Ladder Tutorial
37
Figure 48. Copying the elements to the net
24 Now change the worker ID number 10 to 11.
Figure 49. Changing #10 to #11
Programming the M90
38
Figure 50. Updated Net Two
Repeat the same process for worker ID number 12.
U90 Ladder Tutorial
39
These three nets create:
Figure 51. Nets for worker ID numbers 10, 11 and 12
Programming the M90
40
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 result‘then turn MB 20’ ON.
This net consists of:
�� Three Direct contacts. �� One Direct coil.
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 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:
�� One Equal function block. �� One Direct contact.
U90 Ladder Tutorial
41
�� 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 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.
Programming the M90
42
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 M90’s 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:
�� One Equal function block. �� One Inverted contact. �� One Timer.
U90 Ladder Tutorial
43
�� 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.
Programming the M90
44
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.
�� 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.
U90 Ladder Tutorial
45
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.
The reset conditions will be built with:
�� One Equal function block �� One Direct coil �� One Positive Transition contact �� Three Reset coils �� One Store Direct function block
Figure 57. Clicking the Insert New Net icon
1 Click the INSERT NEW NET icon on the Ladder toolbar. The cursor changes into cross-hairs.
2 Place the cursor in Net One. Click to insert a new net.
Programming the M90
46
Figure 58. Placing the pointer in the net
3 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
U90 Ladder Tutorial
47
5 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.
6 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
Programming the M90
48
Figure 61. Reset conditions
Net Two 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. 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 worker’s ID number.
U90 Ladder Tutorial
49
The 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.
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 Click the DOWNLOAD Icon on the HMI toolbar.
8 Download all sections.
Programming the M90
50
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.
U90 Ladder Tutorial
51
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.
Programming the M90
52
Displays: Entering Parameters Once an operator’s 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:
�� 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.
55 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
U90 Ladder Tutorial
53
Figure 67 Naming a Display
56 Enter the Display text Set Box Q’ty. 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.
Programming the M90
54
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. Selecting Variable Space
58 Click Attach Variable on the HMI toolbar as shown below.
Figure 70. Attaching a Variable
U90 Ladder Tutorial
55
59 The Attach Variable dialog box opens as shown in Figure 71.
Figure 71. Enter Variable Number and Address
60 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.
Programming the M90
56
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. Selecting a Variable Type
62 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.
U90 Ladder Tutorial
57
Figure 74. Linking an MI to a Variable
63 Enter MI 11 Set Box Quantity, then Click OK. The Variable is now linked to MI 11. You will format MI 11 later.
64 Select Keypad Entry from the Variable Information list.
65 Select Start with Clear Field. If you do not select Start with Clear Field, the last number entered in MI 11 will be displayed.
66 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.
Programming the M90
58
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.
U90 Ladder Tutorial
59
Figure 76. Creating a Jump Condition
68 Click on the first Jump condition in the Jumps box. The Define Jump to Condition box opens.
69 Enter SB30 Keypad entries complete, as shown in Figure 77.
Figure 77. Defining a Jump Condition
70 Click OK. The Define to Display Jump box opens.
71 Enter DS 5 Enter Start Time as shown below.
Programming the M90
60
Figure 78. Defining theJump Destination
72 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:
�� A text Display.
U90 Ladder Tutorial
61
�� A keypad-enabled Variable. �� A Jump condition to respond to the keypad entry.
Now you need to create the Jump’s 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. .
74 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.
75 Select 5 spaces in the display text by clicking and dragging.
76 Click Attach Variable. The Attach Variable box opens as shown below.
Programming the M90
62
Figure 81. Attaching a Variable
77 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 Open Variable 2 by clicking it in the Project Navigation Window.
79 Select Time Functions from the Variable Type list. The Set Link to Time function box opens.
U90 Ladder Tutorial
63
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 Linking a Variable
81 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.
Programming the M90
64
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 Open Display 5 by clicking it in the Project Navigation window.
83 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. Defining a Jump Condition
84 Click OK. The Define to Display Jump box opens
85 Enter DS 6 Enter End Time as shown below.
U90 Ladder Tutorial
65
Figure 86. Defining theJump Destination
86 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
Programming the M90
66
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 Jump’s 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.
88 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.
89 Select 5 spaces in the display text by clicking and dragging.
U90 Ladder Tutorial
67
90 Click Attach Variable. The Attach Variable box opens as shown below.
Figure 89. Attaching a Variable
91 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
Programming the M90
68
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 Open Variable 3 by clicking it in the Project Navigation Window.
93 Select Time Functions from the Variable Type list. The Set Link to Time Function box opens.
94 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.
Figure 91 Linking a Variable
95 Select Hour (CT) and Keypad Entry from the Variable Information list as shown in Figure 84, page 63.
U90 Ladder Tutorial
69
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:
�� Set the amount of boxes per bundle. �� Set the starting time for system maintenance. �� Set an ending time for system maintenance.
Programming the M90
70
Displays: Displaying Run-Time Data 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-time 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. 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.
97 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.
U90 Ladder Tutorial
71
Figure 74 Naming a Display
98 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.
Programming the M90
72
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.
U90 Ladder Tutorial
73
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.
Programming the M90
74
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. Display 7 with Attached Variables
Now format Variable 1.
109 Click on Variable 1 in the Program Navigation Window, and then select Integer as the Variable Type.
U90 Ladder Tutorial
75
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:
�� View the counted number of boxes—the 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.
Programming the M90
76
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.
U90 Ladder Tutorial
77
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.
Programming the M90
78
Figure 86. Defining a Jump Condition
121 Click OK. The Define to Display Jump box opens.
122 Enter DS 8 Operator Messages as shown in Figure 78, page 60, then click OK.
123 The completed display, together with all three Jump conditions, looks like Figure 79, page 60 below.
U90 Ladder Tutorial
79
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.
Now you will create the operator messages. Display 8 contains one variable—which 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.
Programming the M90
80
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.
U90 Ladder Tutorial
81
130 Enter MI 5 Operator Message List as shown in Figure 90
Figure 90. Linking a List Variable
131 Click OK. List Variable 8 opens.
132 Enter the messages, 0,1 and 2, as shown below.
Programming the M90
82
Figure 91. Defining a List Variable
The final Display in your HMI is complete—except for Jump conditions.
The Jump conditions will cause this Display to change if:
�� An operator presses the M90’s 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
U90 Ladder Tutorial
83
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.
Programming the M90
84
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
U90 Ladder Tutorial
85
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.
Programming the M90
86
Figure 95. Final Display Complete
To review: Your HMI is now complete. In this section, you:
�� Defined operator messages. �� Set Jump conditions that allow exit from this final display.
U90 Ladder Tutorial
87
The Ladder Application Setting Maintenance Times
To build Ladder Net 11, place the Ladder elements as shown in the figure below.
It contains:
�� 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:
1 RTC: Real Time Clock. The M90 has an internal RTC that is used to handle time and date functions.
Programming the M90
88
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:
�� The machine can be started only by an approved operator �� The machine cannot run over the weekend
The first part of this net contains:
�� A Direct Contact linked to MB 20, energized when an approved operator logs in �� A Direct Time function block: Day of the Week.
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 12—Direct Time
U90 Ladder Tutorial
89
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 12—Day of the Week
The second part of this net fills these conditions:
�� The machine cannot run during maintenance times �� The machine cannot run if Displays 1-6 are displayed
The second part of this net contains:
�� 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
Note that the current Display can be higher than 6 only:
�� If an approved operator has logged in, and �� If the operator has entered system parameters.
Programming the M90
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:
�� When the box passes the ‘photocell’, the counter increments by one. The third part of this net contains:
�� 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. 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 M90’s +/- key, the counter increments by 1.
U90 Ladder Tutorial
91
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 machine—THEN 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:
�� When an approved operator has logged in, place the value ‘0’ in the counter. The third part of this net contains:
�� 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.
Programming the M90
92
Figure 94. Initializing the Counter
U90 Ladder Tutorial
93
Ladder—Monitoring 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:
�� 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 Box—Timer This net contains:
�� 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:
�� A Positive Transition Contact linked to SB 50, the ‘photocell’. �� A Set Coil.
The net fulfills these conditions:
Programming the M90
94
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 Stopped—Timer 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 M90’s +/- 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 Stopped—Timer
Jump to Operator Message Screen The net shown below causes the M90’s current Display to jump from Display 7 Box Count to Display 8 Operator Message.
This net reads:
U90 Ladder Tutorial
95
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 M90’s screen, according to the number of the message
Figure 94. Jump to Operator Message
Display Operator Message 0—Bundle 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 M90’s screen: Bundle Complete.
Programming the M90
96
Figure 94. Display Bundle Complete
Timer 0—Stuck 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 1—Box is Stuck! The net shown below contains:
�� 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 M90’s screen: Box is Stuck!
U90 Ladder Tutorial
97
Figure 94. Display Box is Stuck!
Timer 1: Conveyor Stopped The net shown below contains:
�� 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:
�� A Positive Transition Contact linked to MB 42 �� A Store function block
Programming the M90
98
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 M90’s screen: Conveyor Stopped.
Figure 94. Conveyor Stopped
Timer: Operator Messages The net shown below creates a timer that:
�� Determines the length of time an operator message is displayed on the M90’s 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 M90’s screen, Timer 3 starts.
Figure 94. Display Timer
U90 Ladder Tutorial
99
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 M90’s screen for 2 seconds—and 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:
�� 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.
Programming the M90
100
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 M90’s screen.
Figure 94. Error Fixed