The text of a manual · part 4 of 21
PT Program Generator User's Manual, pages 28 to 37
Pages 28 to 37 of 204
The original document is the PDF (14 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 PSC PT40 and Datalogic PT40
Page 28
2342.book Page 16 Thursday, July 22, 2004 8:35 AM
PPG Application Design
Application Structure Next you must decide what you want the program to do. Draft a program flow chart with pencil and paper, while keeping in mind the following ideas and concepts. Follow them as steps if you like: 1. List the major actions the user may take. These may include reading data from the scanner, uploading data from the PDT, and storing data in a file. 2. For each major action, define each step. In what order will the actions be taken? Walk through each step as if you were the end user. 3. Do multiple actions contain the same step? If so, save time and program size by putting these steps into a subroutine that can be called from different areas of the program. 4. Will each action be taken in a specific order or will the user be allowed to choose an action? To offer a choice of actions, such as collecting and uploading data, you can provide a menu that will allow the user to select an action. 5. Visualize the individual steps involved in each major action. •
For example, will the user be collecting different types of data at different times?
•
For each action you would take as a portable user, imagine the options you would expect to have and the messages you would expect to appear on the screen.
6. In what order will the actions be taken? •
Is there an obvious direction to the program? For example, a user would normally collect data and then upload it.
•
This order should be reflected in the main menu and in the program flow.
7. How will the user start? Do you want to identify the user first by asking for a password or ID number? What about a log-on message? 8. To make your design clearer, try breaking your design up into logical sections. As a guideline, if a function contains more than ten steps, you may want to break it down further. Keeping each frame small will make your program easier to implement and maintain.
16
PT Program Generator (PPG) v5.0
Page 29
2342.book Page 17 Thursday, July 22, 2004 8:35 AM
Node Types and the Parent-Child Relationship
•
For example, an application with collect and store functions would be broken up into a collection function and a storage function.
•
For example, a storage function may contain steps to verify the data meets certain criteria, store the data in a file and track the amount of data stored. This may, depending on the complexity of each step, be broken up into functions which perform each step.
Node Types and the Parent-Child Relationship Build your application in a modular fashion, taking advantage of the ParentChild relationship. There can be multiple levels in each program flow chart. Any type of Operation node can exist at any level. The top level is the parent and lower levels are children. Table 1. Function and Operation Nodes Function Nodes
Operation Nodes Menu Nodes starting on page 5-55 Display Nodes starting on page 5-56 Input Nodes starting on page 5-57
Frames starting on page 5-50 Subroutines starting on page 5-51
Output Nodes starting on page 5-60 Verify Nodes starting on page 5-63 Copy Nodes starting on page 5-66 Modify Nodes starting on page 5-67 Math Nodes starting on page 5-69 Call Nodes starting on page 5-72
Applications constructed with PPG contain two general types of nodes, Function Nodes, which include Frames and Subroutines, and Operation Nodes. Each Frame in a program flow chart represents a major function or option. Connect Frames together in a logical way that indicates program flow. While it is possible to create an entire application at the main frame level, this is not the best approach for any but the smallest applications. Operation Nodes are described briefly in Creating Operation Nodes on page 18, and more completely in Creating & Using Nodes on page 49.
User’s Guide
17
Page 30
2342.book Page 18 Thursday, July 22, 2004 8:35 AM
PPG Application Design
Creating Function Nodes Once you’ve designed the basic program structure, the next step in generating a portable program is to define each Function Node. Function Nodes are frames or subroutines and are used to organize the steps and work of Operation Nodes. Most developers start by creating Function Nodes.
Frames Frames contain a set of program steps that are collected and ordered in a logical structure. Frames can consist of other frames, subroutines, and nodes.
Nodes are Linked together within the frame using Links.
Subroutines Subroutines contain nodes that execute program steps, much like Frames, but they can be called from anywhere in the application. They should be self-contained and perform functions that are used in multiple places in the application. Use Call nodes to link Subroutines to the location within the Operation Node or Frame where they will be called.
Using Your Flow Chart Using the flow chart you created in Application Structure on page 16, list the Frames and Subroutines you will define. As a general guideline, if the function is used in multiple places, make it a Subroutine. Otherwise, it should be a Frame. Once all Function Nodes are created, define each step by creating the Operation Nodes.
Creating Operation Nodes Each Operation Node represents a program step or work performed by the application. After you have created the frames and subroutines, fill in the program steps for each function node. Using the flow chart, create an appropriate Operation Node for each step in the Frame or Subroutine. There are nine different types of Operation Nodes to chose from, as shown in Table 1 on page 17.
18
PT Program Generator (PPG) v5.0
Page 31
2342.book Page 19 Thursday, July 22, 2004 8:35 AM
Node Types and the Parent-Child Relationship
Actual vs. Virtual Display The Falcon PT40's actual display screen is a window to a larger display area called the virtual display (refer to Figure 4). Most applications you will use will fit into the actual display. However, applications can sometimes contain data longer than the default 6 line by16 character view of the actual display. Figure 4. Virtual vs. Actual Display Using Default System Font
0,0 Actual Display
16 characters wide 80 characters wide The shaded box F1=NEXT F2=PRE represents the PT40 REC#11 OF 16 display screen. 6 lines high 120850A30NME5274J400967629
25 lines high
F3=REV F4=EXIT F1=NEXT F2=PRE REC#12 OF 16 120850A30NME5274J400984019 F3=REV F4=EXIT F1=NEXT F2=PRE REC#13 OF 16 120850A30NME5274J400942885 F3=REV F4=EXIT
Virtual Display: The larger area represents the maximum size for the Virtual Display in some applications (visible to the user only by using the arrow navigation keys)
Adding or changing character sizes changes the appearance of the actual display. The number of lines and characters will vary with the character sizes.
The actual display screen shows only a portion of the available data in the virtual display. Use the arrow keys to navigate the actual display screen to view the virtual display data. The text in the virtual display remains in place and the actual display screen changes its view within the virtual display. If you scan longer bar codes or enter more data than can fit in a single line of the virtual display, the data automatically wraps to the next line. Because applications for the PT40 can contain and use different fonts, the amount of data that is available within the virtual display will vary.
User’s Guide
19
Page 32
2342.book Page 20 Thursday, July 22, 2004 8:35 AM
PPG Application Design
The virtual display maintains the latest lines of data once all lines of the virtual display are full. The oldest lines of data are “pushed off the top” as new data is added at the bottom.
Defining Program Flow After you create all the nodes, connect the program pieces together using Link Nodes to define the flow of the program. Links are shown on the PPG display with arrows which point from one step to the next. Some nodes will have multiple entry and exit points. For example, a Copy node can have either one or two exit points. You may choose to have your application go to a Display node if an error occurs or, if the copy operation is successful, to continue on to a Menu node. For information on the mechanics of creating, modifying and deleting Links, refer to Links on page 73. Refer to Data on page 43 for a brief overview of data types and Links to each type’s description. For more detailed information on managing program data or to specify a Data File, Field, Template, or Register, refer to Managing Data on page 77.
Sending and Receiving Files The final step in using PPG is to transfer the applications you have created to the Falcon PT40. Refer to PT40 Communication on page 89 for more information on sending and receiving files. Figure 5 on page 21 is a flow chart showing the application generation, data flow, file transfer process used when you create custom files with PPG and download them to your PSC Falcon PT40 from a PC.
20
PT Program Generator (PPG) v5.0
Page 33
2342.book Page 21 Thursday, July 22, 2004 8:35 AM
Additional Resources
Figure 5. Application Generation, Data Flow & Transfer Process
Additional Resources Before or after you complete the application design, to understand better how to work with PPG to design and to create custom applications for your PSC Falcon PT40, complete the PPG Tutorial on page 99. Refer to Sample Program Files on page 10 for information on the four (4) sample files included with the PPG software. You can open these files to see how they are constructed, and use them as building blocks in constructing your own application. Refer to Example Frames on page 135 for information on the example frames included with PPG. Refer to The PPG Library on page 159 for information on sample PPG program source files which you can download from PSC’s website that include examples of file manipulation, templates, and nodes. You can download additional library files at no charge from the Technical Support area of PSC’s website at www.pscnet.com. Refer to The PPG Library on page 159 for more information on these files. User’s Guide
21
Page 34
2342.book Page 22 Thursday, July 22, 2004 8:35 AM
PPG Application Design
NOTES
22
PT Program Generator (PPG) v5.0
Page 35
2342.book Page 23 Thursday, July 22, 2004 8:35 AM
Chapter 4 The PPG Menubar Overview This section discusses the PPG menubar, located at the top left of the user interface. The following menu items are reviewed: •
File Menu on page 23.
•
Edit Menu on page 34.
•
View Menu on page 38.
•
Create Menu on page 40.
•
Window Menu on page 44.
•
Help Menu on page 47.
Refer to Menus and Toolbars on page 11 for a brief overview of the PPG menubar.
File Menu The following sub-topics are covered in this section: • • • • • • • • • • • • User’s Guide
Creating a New File (Ctrl+N) on page 24. Opening an Existing File (Ctrl+O) on page 25. Closing a File on page 25. Saving a File (Ctrl+S) on page 25. Save As on page 26. Printing a File (Ctrl+P) on page 26. Page Setup on page 27. Download (Ctrl+D) on page 28. Customize Application (Ctrl+Z) on page 28 Customize Display (Ctrl+Y) on page 31. Recent Files on page 33. Exit (Alt+F4) on page 34.
23
Page 36
2342.book Page 24 Thursday, July 22, 2004 8:35 AM
The PPG Menubar
To access File menu items, click on File > and then the menu item you want to use from the menubar as shown in Figure 6. Or use the appropriate keyboard short cut, indicated on the same line as the menu item. Many standard Windows keyboard shortcuts can be used. For example, to print, press Ctrl + P simultaneously; to save, press Ctrl + S simultaneously. Figure 6. File Menu
Like most software programs, PPG stores data in files. To save a program flow chart, you store it as a file. Once you have saved the file, you can open it and modify it. Use the File menu to create a new file, open an existing file, save a file, save a file with a new name, close a file, and print a file.
Creating a New File (Ctrl+N) To create a new flow chart, select File > New from the menubar. If no application is currently open, an empty flow chart is loaded into the PPG window. If an application is already open, a second copy of PPG will start and open the empty application.
24
PT Program Generator (PPG) v5.0
Page 37
2342.book Page 25 Thursday, July 22, 2004 8:35 AM
File Menu
Opening an Existing File (Ctrl+O) To open an existing program source file, select Open from the File menu, or use the keyboard shortcut: Ctrl+O.This action opens the Open dialog, as shown in Figure 7. Figure 7. The Open Dialog
By default, the File list shows all program source (.scr) files in the PPG directory. If the file you want is located elsewhere, choose the drive and directory from those lists, or type them in the input box. Select the file you want to open from the File list or type its name in the input box, and select OK. If no application is currently open, the specified file is loaded into the PPG window. If an application is already open, a second copy of PPG will start and open the file you selected.
Closing a File To close a file and leave PPG open, select File > Close from the menubar. If you have made changes to the file, PPG will ask you if you want to save your changes. Press OK to save the changes and close the file.
Saving a File (Ctrl+S) After you saved a flow chart in a file, use File > Save to save changes to it without being prompted for a file name. If a file has not already been saved, you are prompted to name the file. Select OK to save the program flow chart in the specified file.
User’s Guide
25