The text of a manual · part 14 of 55
Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 7 - Creating and Editing Program Files, pages 113 to 122
Pages 113 to 122 of 486, from Hand-Held Terminal (Catalog Number 1747-PT1) User Manual
The original document is the PDF (1.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1747-PT1
Page 113
Chapter
7
Creating and Editing Program Files In this chapter you create a ladder program. The topics include: • creating and deleting program files • editing program files • using the search function • creating and deleting data files
Creating and Deleting Program Files
As described in chapter 2, a program must contain the main program file (file 2) for user–programmed instructions defining how the controller is to operate. Additional program files may be created for specialized user defined program routines. User error handler, STI interrupts and interrupt programs require subroutine program files. These are described later in this manual. Valid file numbers range from 3 to 255.
Creating a Subroutine Program File using the Next Consecutive File Number Create subroutine program file 3. 1. Begin at the program maintenance display. File Name: 222 File Name 0 1 2 222
Prog Name:1000 Type Size(Instr) System * Reserved * Ladder *
OFL CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP > F1
F2
F3
F4
F5
2. Press [F2], CRT_FIL. The following display appears: File Name: 222 File Name 0 1 2 222
Prog Name:1000 Type Size(Instr) System * Reserved * Ladder *
ENTER FILE NUMBER: F1
F2
OFL F3
F4
F5
7–1
Page 114
Chapter 7 Creating and Editing a Program File
3. To create subroutine program file 3, press [3] then [ENTER]. File 3 is created and the following display appears showing subroutine file 3 as a ladder file. File Name: 222 File Name 0 1 2 222 3
Prog Name:1000 Type Size(Instr) System * Reserved * Ladder * Ladder * OFL CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP > F1
F2
F3
F4
F5
You may not name any of the subroutine program files using the HHT. Subroutine program files may be named on an APS terminal. These programs may be uploaded to, and displayed on the HHT.
Creating a Subroutine Program File using a Non–Consecutive File Number In this example create subroutine program file 6. 1. From the above display press [F2], CRT_FIL. 2. Press [6], then [ENTER]. File 6 is created, but the display does not change. 3. Press the [ ↓ ] key 3 times to view file 6.
These files are listed, but not created.
File Name: 222 File Name 3 4 5 6
Prog Name:1000 Type Size(Instr) Ladder * Undefined * Undefined * Ladder * OFL CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP > F1
F2
F3
F4
F5
Notice that files 4 and 5 are listed as Undefined and file 6, the file you created, is listed as Ladder. Although files 4 and 5 are not created, they are still displayed. You may create the files at a later time by repeating the above procedure.
7–2
Page 115
Chapter 7 Creating and Editing a Program File
Deleting a Subroutine Program File All created program files (file numbers 3 – 255) can be deleted. You cannot delete files 0 and 1. Deleting file 2 deletes all ladder rungs in the main program file. Attempting to delete file 0, file 1, or an undefined subroutine file displays the FILE CANNOT BE DELETED! prompt. In the case of a subroutine file, the error message indicates that a subroutine program file of a higher number exists. Delete subroutine program file 6. 1. From the previous display, press [F4], DEL_FIL. File Name: 222 Prog Name:1000 File Name Type Size(Instr) 3 Ladder * 4 Undefined * 5 Undefined * 6 Ladder * ENTER FILE NUMBER: OFL > F1
F2
F3
F4
F5
2. You are prompted for the file number to delete. Press [6], then [ENTER]. The following display appears: File Name: 222 Prog Name:1000 File Name Type Size(Instr) 3 Ladder * 4 Undefined * 5 Undefined * 6 Ladder * DATA/FORCES IN LAST STATE,DELETE? OFL > YES NO F1
F2
F3
F4
F5
3. Press [F2], YES to delete the file. Refer to appendix A for a description of HHT messages and error definitions. The following display appears: File Name: 222 File Name 0 1 2 222 3
Prog Name:1000 Type Size(Instr) System * Reserved * Ladder * Ladder * OFL CHG_NAM CRT_FIL EDT_FIL DEL_FIL MEM_MAP > F1
F2
F3
F4
F5
Now that you have created all necessary subroutine program files, enter a simple program.
7–3
Page 116
Chapter 7 Creating and Editing a Program File
Editing a Program File
This section describes the following editing techniques: • entering a rung • adding a rung with branching • modifying rungs • modifying instructions • modifying branches • deleting branches • deleting and copying instructions • deleting and copying rungs Important: In the following examples, there may be multiple ways to enter certain instructions. The examples are chosen to show the simplest methods of programming and editing.
Ladder Rung Display When you are editing a ladder program offline, a typical rung display appears as follows: When you locate the cursor on an instruction (as shown below), the HHT displays the instruction mnenomic and address in the upper left corner of the display.
The HHT displays the full address. For example, when you assign the address O:3/0, the programming device displays it as O0:3.0/0 (output file, file 0, slot 3, word 0, terminal 0).
OTE:O0:3.0/0
These numbers in the upper right corner of the display provide you with the following ladder program information:
NO FORCE
2.0.0.0.2
( )
] [
<END> Indicates the force status of the cursored instruction.
OFL INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG > F1
7–4
F2
F3
F4
F5 file number rung number nest level branch level instruction number in rung (An asterisk [*] means the cursor is not on an instruction, but rather on a power rail or a branch.)
Page 117
Chapter 7 Creating and Editing a Program File
Entering a Rung To enter a rung, do the following: 1. Press [F3], EDT_FIL from the program maintenance display. The following display appears: File Name: 222 Prog Name:1000 File Name Type Size(Instr) 0 System * 1 Reserved * 2 222 Ladder * 3 Ladder * ENTER FILE NUMBER: OFL F1
F2
F3
F4
F5
2. Edit file number 2, the main program file. Press [2], then [ENTER]. The display shows the END of program statement. No other rungs exist at this time. The numbers 2.0.0.0.* appear in the upper right corner of the display. This indicates that you are editing program file 2, and the cursor is located on rung 0, nest level 0, branch level 0, and not presently on an editable instruction (the cursor is located on the END of program statement). 2.0.0.0.*
<END> OFL INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG > F1
F2
F3
F4
F5
3. Press [F1], INS_RNG. The following display appears: The I symbol in the power rails indicate this rung is being inserted or edited. 2.0.0.0.*
I
I
<END>
INS_INST F1
OFL ACP_RNG >
BRANCH MOD_INST F2
F3
F4
F5
The Insert Rung command inserts the new rung above the rung where the cursor is positioned. In this case, since there are no other rungs, the new rung is placed directly above the END statement. The cursor is now located on the left power rail of rung 0. The first rung of a program file is always numbered 0.
7–5
Page 118
Chapter 7 Creating and Editing a Program File
Entering an Examine if Closed Instruction 1. Press [F1], INS_INST. The following display appears: 2.0.0.0.*
I
I
<END>
BIT
OFL TMR/CNT I/O_MSG COMPARE CPT/MTH >
F1
F2
F3
F4
F5
2. Press [F1], BIT. The following display appears: 2.0.0.0.*
I
I
<END>
] [
]/[
( )
(L)
OFL (U)
F1
F2
F3
F4
F5
>
3. Press [F1],, ] [ - , for the examine if closed instruction. The following zoom display appears: ] [
ZOOM on XIC NAME: BIT ADDR:
2.0.0.0.*
EXAMINE IF CLOSED This symbol indicates that the HHT has automatically shifted for you. You can then enter the file type ( I, O, S, B, T, C, R, and N).
ENTER BIT ADDR: F1
F2
F3
F4
F5
4. At the ENTER BIT ADDR: prompt, type the address I:1/0, which is an abbreviated form of the address. The display appears as follows: ] [
ZOOM on XIC NAME: BIT ADDR:
2.0.0.0.*
EXAMINE IF CLOSED
ENTER BIT ADDR:I:1/0 F1
F2
F3
F4
F5
5. Before continuing, make certain that the information entered is correct. If you entered the wrong instruction by mistake, press [ESC] twice and re–enter the correct instruction. If you entered the wrong address, press [ESC] once and re–enter the correct address. When all the information displayed is correct, press [ENTER].
7–6
Page 119
Chapter 7 Creating and Editing a Program File
This zoom display, once again gives you a chance to verify that all the information entered is accurate. Notice that the address displayed is shown in its full format: 2.0.0.0.* ] [ ZOOM on XIC NAME: EXAMINE IF CLOSED BIT ADDR: I1:1.0/0
ENTER BIT ADDR: EDT_DAT F1
I1:1.0/0
F2
F3
F4
ACCEPT F5
6. Press [F5], ACCEPT. This inserts the instruction and address into the rung. The following rung display appears: 2.0.0.0.*
I
] [
I
<END> ] [
]/[
( )
(L)
OFL (U)
F1
F2
F3
F4
F5
>
Notice that the cursor is now located on the right power rail of rung 0. In the next section, the Output Energize instruction is inserted to the left of the cursor. Further instructions may be entered in the same way. Entering an Output Energize Instruction 1. Press [F3],, ( ) - , for the output energize instruction. The following display appears: ( )
ZOOM on OTE NAME: BIT ADDR:
2.0.0.0.*
OUTPUT ENERGIZE
ENTER BIT ADDR: F1
F2
F3
F4
F5
2. Type bit address O:3/0, then press [ENTER]. ( ) ZOOM on OTE NAME: OUTPUT ENERGIZE BIT ADDR: O0:3.0/0
ENTER BIT ADDR: EDT_DAT F1
F2
2.0.0.0.*
O0:3.0/0 F3
F4
ACCEPT F5
7–7
Page 120
Chapter 7 Creating and Editing a Program File
3. Press [F5], ACCEPT, then press [ESC] twice to move up through the menu displays. Now press [F5], ACP_RUNG. The following display appears: 2.1.0.0.*
( )
] [
Notice the I symbol in the power rails has changed to a solid line, indicating the rung is accepted into the program.
<END> OFL INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG > F1
F2
F3
F4
F5
Important: Saving and compiling your ladder program is explained in detail, in the next chapter. But before you continue with the additional editing examples, save the work you have done so far. Whenever you are adding or editing rungs of a program it is recommended to periodically save your program. In the event of a power loss to the HHT, any edits that you have made up to this point are not recoverable. 4. At this point the rung is entered and accepted. Now save this rung and continue editing. Press [ENTER] to display additional menu options. 2.1.0.0.*
( )
] [
<END> OFL SAVE_CT SAVE_EX >
EDT_DAT F1
F2
F3
F4
F5
5. To save and continue editing, press [F4], SAVE_CT, then press [F5], ACCEPT. Adding a Rung with Branching Refer to chapter 5 for a description and example of different types of branching.
7–8
Page 121
Chapter 7 Creating and Editing a Program File
Adding a Rung to a Program 1. From the previous display, press [ENTER] for the additional menu functions. The following display appears: 2.0.0.0.*
( )
] [
<END> OFL INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG > F1
F2
F3
F4
F5
2. Press the [ ↓ ] key once to place the cursor on the END of program statement. 3. Press [F1], INS_RNG. The insert rung function always places the new rung above the rung on which the cursor is positioned. This places the new rung between the first rung and the END of program statement. If you did not move the cursor, the new rung is inserted above the original rung. The display appears as follows: 2.1.0.0.*
( )
] [
Position of the new rung indicated by the I symbol in the power rails.
I
I
<END> OFL INS_RNG MOD_RNG SEARCH DEL_RNG UND_RNG > F1
F2
F3
F4
F5
4. Press [F1], INS_INST, then [F1], BIT, then [F1],, ] [ - . The following display appears: ] [
ZOOM on XIC NAME: BIT ADDR:
2.1.0.0.*
EXAMINE IF CLOSED
ENTER BIT ADDR: F1
F2
F3
F4
F5
7–9
Page 122
Chapter 7 Creating and Editing a Program File
5. Enter the address for the first examine if closed instruction. Type the address I:1/0, then press [ENTER], then [F5], ACCEPT. The following display appears with the cursor positioned on the right power rail: 2.1.0.0.*
I
( )
] [ ] [
I
<END> OFL
] [
]/[
( )
(L)
(U) >
F1
F2
F3
F4
F5
6. Enter the output energize instruction. Press [F3],, ( ) - . The following zoom display appears: ( )
ZOOM on OTE NAME: BIT ADDR:
2.0.0.0.*
OUTPUT ENERGIZE
ENTER BIT ADDR: F1
F2
F3
F4
F5
7. Type the address O:3/1, then press [ENTER], then [F5], ACCEPT. The cursor is now positioned on the output energize instruction and the following display appears: OTE:O0:3.0/1 Notice that with the cursor placed on the output instruction, the instruction mnemonic and address are displayed in the upper left corner.
7–10
I
NO FORCE
2.1.0.0.2
( ) ( ) I
] [ ] [
<END> OFL
] [
]/[
( )
(L)
(U) >
F1
F2
F3
F4
F5
The cursor location is also displayed in the upper right corner. This indicates that the cursor is located in program file 2, rung 1, nest level 0, branch level 0 and on the second instruction in the rung.