The text of a manual · part 13 of 21
PT Program Generator User's Manual, pages 118 to 127
Pages 118 to 127 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 118
2342.book Page 106 Thursday, July 22, 2004 8:35 AM
PPG Tutorial
Building a Custom Portable Program At this point, you should understand the general concepts behind creating and loading a portable program, although many of the details have yet to be explained. In this section, you'll create a simple portable program from scratch. It will allow you to collect data with the portable and upload it to your PC. A menu that appears when you turn on the portable gives you a choice of the two possible actions.
Creating Frames and Links A program's frames define its general functions, such as collecting and uploading data. Links connecting frames indicate program flow - how you move from frame to frame. The details for the program are contained in the program’s Operation nodes.
Creating Frames For your program, you will create three frames: Main Menu, Collect Data, and Upload Data. The program will start with the Main Menu frame, which offers access to the other frames. You can return to the Main Menu from either the Collect Data or Upload Data frames. Create the frames shown in Figure 78 on page 107 by completing the following steps: 1. If you took a break and exited PPG, select Programs > PT Program Generator > PT Program Generator from the Windows Start menu to load PPG. 1. Click on the Maximize button, if necessary, to expand the windows to fill the screen. 2. If you are continuing from the last section, select File > Close to close the Sample application. The select File > New so that you can create a new flow chart. (If prompted to do so, do not save changes.) 3. Select Create > Frame to draw the first frame. A box labeled FRAME appears in the lower right corner of the window. Move it to the topmiddle area of the workspace. To adjust the position of a frame, just drag it with the mouse. To delete an unwanted frame or node, select it and then press DELETE
106
PT Program Generator (PPG) v5.0
Page 119
2342.book Page 107 Thursday, July 22, 2004 8:35 AM
Building a Custom Portable Program
Figure 78. Main Application Level of the Program
4. Click the right mouse button and select Properties (or select the frame and choose Edit > Properties from the menu) to display the Frame Properties dialog. Type Main Menu in the Name field and select OK. The frame now appears with the name Main Menu. 5. Now create the Collect Data frame. Select Create > Frame, move the FRAME box to the bottom left area of the workspace. Click the right mouse button and select Properties to open the Frame Properties dialog. Enter Collect Data in the Name field., and select OK. 6. Select Create > Frame, move the FRAME box to the bottom right area of the workspace, click the right mouse button, and select Properties to open the Frame Properties dialog box. Enter Upload Data in the Name field, and select OK.
Creating Links You now have the three frames of your program. The next step is to create the arrows, or Links, showing the flow of the program between the frames. Complete the following steps: 1. Select Create > Link from the menubar or press the Link button.
User’s Guide
107
Page 120
2342.book Page 108 Thursday, July 22, 2004 8:35 AM
PPG Tutorial
2. Move the Link cursor to the Main Menu frame and click the left mouse button. 3. Move the Link box to the Collect Data frame and click the mouse again. An arrow appears, pointing from the Main Menu frame to the Collect Data frame. 4. Select Create > Link from the menubar, click on the Main Menu frame, and then click on the Upload Data frame. A second arrow appears. The Links you created give the user access to either the Collect Data or Upload Data frame from within the Main Menu. To adjust a Link, use the mouse to drag the Link’s arrowhead. To delete a Link, select the ESC key.
Main Menu Access From each of the action frames, you want to give the user access to the Main Menu. You must create additional Links back to the Main Menu frame. These will be jointed Links that bend at a 90° angle. Complete the following steps: 1. Select Create > Link and click on the Collect Data frame. 2. Instead of clicking directly on the other frame, move the cursor straight up until it is level with the Main Menu frame, and then click the left mouse button. 3. Now move the pointer to the Main Menu frame and click the left mouse button. A jointed line appears. Jointed Links work just like straight Links, but they give you more flexibility in their placement. If a jointed Link appears jagged, drag its joint until its lines are perpendicular. To redraw the screen and erase any extraneous lines, click in any blank area of the flow chart
4. Use the same method to create a jointed Link from the Upload Data frame to the Main Menu frame. Your frame should now look like Figure 79 on page 109.
108
PT Program Generator (PPG) v5.0
Page 121
2342.book Page 109 Thursday, July 22, 2004 8:35 AM
Building a Custom Portable Program
Figure 79. Flow Chart showing Jointed Links
Creating the Main Menu Nodes After defining program’s frames, you must specify the nodes for each frame. To view the a frames’ nodes, double-click on it. Or highlight the frame and select View > Show Frames/Subroutines from the menubar. Operation nodes involve more detailed information than frames and are divided into nine node types, with a different dialog box associated with each node. For example, a Display node specifies text to display on the portable’s screen; that text is entered into a dialog box attached to the node. In this section, you will set up the nodes for the Main Menu frame. This is a simple frame, creating a path to either of the other two frames. You will create a Menu node that advances to the Collect Data frame if the user presses <F3> and to the Upload Data frame if the user presses <F4>. Set up the nodes for the Main Menu frame by completing the following steps: 1. Double-click the Main Menu frame. A second window opens showing three boxes: Start: Main Menu, Exit: Collect Data, and Exit: Upload Data. These nodes are created automatically by the Links you set up and they offer entry to and exit from the Main Menu nodes.
User’s Guide
109
Page 122
2342.book Page 110 Thursday, July 22, 2004 8:35 AM
PPG Tutorial
2. Reposition the existing nodes as shown in Figure 80 on page 110. Figure 80. Repositioned nodes
To reposition a node, move the mouse pointer to the node, hold down the left mouse button, and drag the node to its new position with your mouse.
3. Select Create > Menu from the menubar. A Menu node opens in the lower left of this second window. 4. Right-click the Menu node and select Properties from the pop-up menu. Or select Menu > Properties. 5. Change the node’s name to Options. Changing a node’s name is identical to changing a frame’s name (Refer to Figure 71 on page 101 for changing the name of a frame.) Only the second line of text on the node is changed. The first line always identifies the node's type.
6. Now you need to Link the nodes together to indicate program flow. Select Create > Link from the menubar or press the Link button. 7. Use the mouse to draw the Links shown in Figure 81.
110
PT Program Generator (PPG) v5.0
Page 123
2342.book Page 111 Thursday, July 22, 2004 8:35 AM
Building a Custom Portable Program
Figure 81. The completed Main Menu nodes
8. Right-click the Menu: Options node and select Properties to display the node’s Properties. The dialog includes a text-entry area, called Display, that represents the portable’s screen (refer to Figure 82). Figure 82. The Menu: Options Dialog Box
9. On the first line of the Display area, type Main Menu.
User’s Guide
111
Page 124
2342.book Page 112 Thursday, July 22, 2004 8:35 AM
PPG Tutorial
10. Use the keyboard navigation keys to skip the next line and go to the third line. Enter Collect Data in the Display area. 11. Go to the 4th line and enter Upload Data, as shown in Figure 83. •
To the left of the text-entry area are checkboxes for function keys used to select options presented on the portable’s screen.
•
The menu options you've created are designed for function keys <F3> and <F4> on the portable.
•
To initiate proper actions for these keys, specify which node to progress to for each function key.
12. Enable (check) the <F3> checkbox. •
Click on the down-arrow button in the Next node pull-down list on the right side of the <F3> line.
•
A pull-down list appears, listing possible destination nodes.
Figure 83. The pull-down list for Menu: Options
13. Select Exit Collect Data so that when the user presses <F3>, the program will progress to the Collect Data frame. 14. Enable the <F4> checkbox. Click on the down-arrow button next to the next nodes pull-down list, and select Exit Upload Data from the displayed list. This moves the program to the Upload Data frame when the user presses <F4>.
112
PT Program Generator (PPG) v5.0
Page 125
2342.book Page 113 Thursday, July 22, 2004 8:35 AM
Building a Custom Portable Program
15. Select OK to exit the dialog box. Then close this frame to return to the Program level of the application.
Saving Your Program Even though the program's not complete, it's a good idea to save it periodically while you are creating it. Select File > Save to save the program in a file. Enter tutorial in the File Name pull-down list of the displayed dialog box, and select OK. PPG will add the extension *.scr automatically. You have completed the Main Menu frame. These nodes display two options on the portable’s screen and allow the user to press <F3> or <F4>. The program checks to see which function key was pressed and passes control to either the Collect Data or Upload Data frame. Want a Break?
If you are ready for a break, you can stop here. You have not made changes that need to be saved, so you won’t lose any work if you exit PPG or turn off your computer now.
Creating and Setting Up the Collect Data Nodes The Collect Data frame allows the user to scan bar codes and enter data through the keys of the portable. That data is temporarily stored in a register and then copied into a file, which can be uploaded later to a PC. You'll set up data-collection nodes to do the following: •
Display a message on the portable’s screen telling the user that the portable is ready to accept data.
•
Allow data input from the scanner (scanner) or the portable’s keys, specify how to handle each type of input, and name a register in which to store the data temporarily.
•
Verify that the user input is valid and, if it is not, display an error message and sound a beep.
•
Copy the data from the temporary register to a data file and redisplay the initial message asking for input.
In addition, you will create an option that will allow the user to return to the Main Menu by pressing a function key.
User’s Guide
113
Page 126
2342.book Page 114 Thursday, July 22, 2004 8:35 AM
PPG Tutorial
Create nodes for the Collect Data frame by completing the following steps: 1. If you're returning from a break after exiting PPG, double-click on the PPG icon in the PT Program Generator. Then choose File > Open and select tutorial.scr from the file list. Select OK to load the file into the PPG window. 2. At the Program level, double-click the Collect Data frame to access its contents. Because this frame has two Links (one to it and one from it), there are two nodes initially created: Start: Collect Data and Exit: Main Menu. Position these nodes so that the Entry node is in the upper left corner and the Exit node is at the bottom right. Figure 84. The Collect Data nodes
114
PT Program Generator (PPG) v5.0
Page 127
2342.book Page 115 Thursday, July 22, 2004 8:35 AM
Building a Custom Portable Program
3. Create all the nodes shown in Figure 84 on page 114, using commands on the Create menu or icons on the Toolbar. Each node's type is indicated by the first line of text in the node. Rename each node according to the second line of text. Link the nodes together as shown. If you click twice on the Start or Exit node, this frame will move to the background window. Clicking on any visible part of the Collect Data frame will bring it to the foreground. When Linking the Verify: Input node, create the Link to the Output: Error Beep node first. Then create the Link to the Copy: To File node. This will place the correct Link in the Next node options of the Verify: Input node.
The Display: Enter Item Node You need to set up this node to display “Enter Item:” on the first line of the portable’s screen and have the fourth line of the screen tell the user to press <F4> to return to the Main Menu. Complete the following steps to set up the node: 1. Double-click the Display: Enter Item node to open the node’s dialog box (refer to Figure 85 on page 115). 2. Type Enter Item: on the first line of the text entry area. 3. Use the keyboard navigation keys to move to the fourth line and enter Menu. 4. Select OK to save your settings. Figure 85. The Display: Enter Item
The Input: Item Node Complete the following steps to set up this node: 1. Double-click the Input: Item node to display its dialog box (refer to Figure 86 on page 116).
User’s Guide
115