The text of a manual · part 16 of 21
PT Program Generator User's Manual, pages 148 to 157
Pages 148 to 157 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 148
2342.book Page 136 Thursday, July 22, 2004 8:35 AM
Example Frames
Setting the Date and Time All PSC portables include a clock that keeps track of the current date and time. To allow users to adjust the date and time settings, complete the following steps: 1. Create a new Output node. 2. Set the Output Destination to System. 3. Select Constant as the Data Source. 4. Enter this command as the constant: •
To set the time: %-;
•
To set the date: %.
•
Example: %-% displays the old time or date.
5. Enter the new time or date; if the time or date is correct press <ENTER>.
Changing the Auto-Off Timeout By default, the PSC portable powers off automatically after ten minutes of inactivity. To change this setting, complete the following steps: 1. Create a new Output node. 2. Set the Output Destination to System. 3. Select Constant as the Data Source. 4. Enter this command as the constant: $+$-B2nnEE where nn = the number of minutes of inactivity. •
136
Example: $+$-B205EE sets the Auto-off timeout at 5 minutes.
PT Program Generator (PPG) v5.0
Page 149
2342.book Page 137 Thursday, July 22, 2004 8:35 AM
Displaying the Contents of a Register
Displaying the Contents of a Register Tip04.scr, illustrated in Figure 104, displays the contents of a register on the portable, using two Output nodes as follows: Figure 104. Tip04.scr Flow Chart
1. Creates a new Output node, called Position.This Output node sends information to the existing display and position the cursor within the display screen.
User’s Guide
•
Selects Output to Display.
•
Chooses Display Command as the Data Source.
•
Selects Add to add the commands to move the cursor and erase text to the end of the line.
137
Page 150
2342.book Page 138 Thursday, July 22, 2004 8:35 AM
Example Frames
2. Creates a new Output node, called Scan. This Output node writes the register contents starting at the cursor position. •
Selects Output to Display.
•
Chooses Register from the Data Source pull-down list.
•
Chooses Default Register from the Register pull-down list.
The first Output node prevents the register contents from being written on the last line of the display, which is not always desirable. The second output node sends the contents of the Default Register to the display.
Sample Verification Methods Verifying a Numeric Value Often, collected values must conform to a specific type. PPG can check data to verify that it meets the user’s criteria. Create an application to check to see if a value is numeric: 1. Create a Verify node. Figure 105. Newly Created Verify Node
2. Select the location of the data value to be verified.
138
PT Program Generator (PPG) v5.0
Page 151
2342.book Page 139 Thursday, July 22, 2004 8:35 AM
Sample Verification Methods
Figure 106. Verify Information Tab: Register Data Source
3. On the Verify Options tab, select Numeric as the Data Type. Figure 107. Verify Options Tab: Numeric Data Type
Verifying that a Number is an Integer Another type check that may be needed is to confirm that data is an integer, rather than a fractional numeric value. This is done using a combination of Verify nodes to check the numeric value for characters that can not be integers. Figure 108. Tip15.scr Verifies that a Number is an Integer
User’s Guide
139
Page 152
2342.book Page 140 Thursday, July 22, 2004 8:35 AM
Example Frames
Tip15.scr, illustrated in Figure 108 on page 139, confirms that data is an integer and performs the following steps: 1. Display Verify Integer. Figure 109. Display Integer Test
2. Enter the value to check. Figure 110. Display Input Value
3. Verify that the value is numeric (checks for any valid floating point format).
140
PT Program Generator (PPG) v5.0
Page 153
2342.book Page 141 Thursday, July 22, 2004 8:35 AM
Sample Verification Methods
Figure 111. Verify Numeric
4. Verify that there is no e in the value (floating point allows for exponents. i.e. 1.25e-6 is a valid floating point value). Figure 112. Verify No e
5. Check for a . (decimal point) (values with fractions are not integers). Figure 113. Verify Decimal
User’s Guide
141
Page 154
2342.book Page 142 Thursday, July 22, 2004 8:35 AM
Example Frames
6. Displays the result (pass/fail). Figure 114. Displays Pass or Fail
Output Fail
Output Pass
Verifying Input Size To verify that a scanned or entered code is a given number of characters or within a given range, use the Size to Register option in the Input node collecting the data. This option stores the number of characters of the given input in a separate register, which can then be checked with a Verify node. This example is illustrated in Tip05.scr, which is shown in Figure 115 on page 143.
142
PT Program Generator (PPG) v5.0
Page 155
2342.book Page 143 Thursday, July 22, 2004 8:35 AM
Sample Verification Methods
Figure 115. Tip05.scr Verifies Input Size
Display: SCAN
Instructs the user to scan a bar code.
Input: STORE
Stores the input code in the default register and (with the Size to Register option) stores the character length of the code in a register named Input Size (refer to Figure 116).
In the example, the Input node named Store puts the number of characters into a register using the size to register option. Be sure to use different registers to store the size and the input. The Verify node named Size then verifies that the input is between 6 and 10 characters long. If the size is incorrect, the display named Wrong prompts the user to try again. If the size is correct, the scan is copied to a file and the program continues.
User’s Guide
143
Page 156
2342.book Page 144 Thursday, July 22, 2004 8:35 AM
Example Frames
Figure 116. The Input: STORE Dialog
Verify: EXIT
Checks to see if the user pressed <F4>. If so, it exits the frame.
Verify: SIZE
Checks the value stored in the Input Size register. The options in its dialog box are set as shown in Figure 117.
Figure 117. The Verify: SIZE Dialog
Copy: TO FILE
Copies the scanned code from the default register into a file and loops back to the Input: STORE node if the Input Size value is within the given range (6 to 10) so that further codes can be scanned.
Display: WRONG Displays INCORRECT INPUT; REENTER if the Input Size value is outside the defined range, on the portable’s screen and loops back to the Input node so that the code can be scanned again.
144
PT Program Generator (PPG) v5.0
Page 157
2342.book Page 145 Thursday, July 22, 2004 8:35 AM
Downloading a File to a PSC Portable
Downloading a File to a PSC Portable Usually, users will need to upload files containing scanned or input codes to a host computer. However, it is sometimes necessary to download a file from a host to a portable. For example, you might have an inventory file that you need to check scanned codes against. Tip06.scr, shown in Figure 118, downloads a file from the host computer to a connected portable. Figure 118. Tip06.scr Downloads a File to a PSC Portable
Display: READY Instructs the user to press <F3> to download a file or <F4> to exit.
User’s Guide
Input: FKEY
Accepts function key input.
Verify: EXIT
Checks to see if <F4> was pressed and, if it was, exits the frame.
145