Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 18 of 21

PT Program Generator User's Manual, pages 168 to 177

Pages 168 to 177 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 168

2342.book Page 156 Thursday, July 22, 2004 8:35 AM

Example Frames

Figure 127. The Output: INDEXED Dialog

Math: INDEX+1

Increments the value in the INDEX register by 1 so that the next record in the file is displayed.

Input: NEXT

Keeps the record contents displayed until the user presses a key. The program then loops back to Verify: END so that the next record can be displayed.

The loop continues until the “end” record is reached, at which point the program deletes the “end” record and exits the frame. The file is displayed one record at a time on the screen. Each time the user presses a key, the next record is displayed on the last line, and the previous line moves up. The user can scroll the screen up to see previous entries in the file. A variation of this example gives the user the ability to search through records in both directions: First, find the end of the file (refer to Finding the Number of Records in a File on page 147). Next, output the first record and give the option to see the next or the previous record. Then, increment or decrement the counter and verify that the range is between 1 and the end-of-the-file value.

156

PT Program Generator (PPG) v5.0

Page 169

2342.book Page 157 Thursday, July 22, 2004 8:35 AM

Sounding a Beep

Sounding a Beep To sound a beep on a portable, use an Output node with the Source option set to Constant and Destination set to System. Figure 128. Output Beep Node

In the constant field, enter the human readable text of one of the following codes: Sounds a high beep .

+

.

-

Sounds a low beep

You can enter more than one code, for multiple tones. For example, .+.-.+ sounds a high beep followed by a low beep followed by another high beep.

Padding a Number with Leading Zeros Many database programs use fixed-length fields, which means that values stored in them must be a given number of characters long. Values with fewer than the required characters can be “padded” with zeros at the beginning; the value 12, for example, would appear as 0012. Tip14.scrn, illustrated in Figure 129 on page 158 uses a combination of Modify nodes, Copy nodes, and two templates to pad a number with leading zeros.

User’s Guide

157

Page 170

2342.book Page 158 Thursday, July 22, 2004 8:35 AM

Example Frames

Figure 129. Tip14.scr Pads a Number with Leading Zeros

Copy: QTY

Copies the quantity value in the default register into the INPUT SIZE register.

Modify: REVERSE1

Reverses the order of digits in the INPUT SIZE register.

Copy: ZEROS

Copies six zeros to the end of the value in the INPUT SIZE register.

Copy: 1ST SIX

Copies the first six digits in the INPUT SIZE register back into the Quantity field of the default register. Any zeros beyond the sixth digit are dropped.

Modify: REVERSE2

Reverses the six characters in the default register, returning the original input to the correct order with leading zeros.

This technique can be used with any fixed length by simply changing the fixed length of the second template and providing enough zeros in the Copy node.

158

PT Program Generator (PPG) v5.0

Page 171

2342.book Page 159 Thursday, July 22, 2004 8:35 AM

Appendix C The PPG Library Overview PSC offers a library of several sample PPG program source files which include examples of file manipulation, templates, and nodes. Several working programs are included, although many of them are only examples and do not provide any functional value. You can download these files from the Technical Support area of PSC’s website at www.pscnet.com. This section briefly describes each of these files.

PPG Program Source Files

User’s Guide

ASHOST.SCR

A data-collection program that allows a remote system to call up the portable via modem and receive the data.

AUTO.BAT

A batch file that uses the SAMPLE2.SCR program and automatically pulls files from the collect mode.

BASIC.SCR

A program with options for Menu, Upload, and Erase nodes completed. The Collect node is left empty for the user to set up.

CASHREG.SCR

A program that does all the basic things a cash register would do, including figure totals with taxes, figure change, and print a receipt.

CLOCK.SCR

A program that displays time and date. Formats are selectable, and an alarm capability is available.

COLLECT.SCR

The collect portion of the sample program that comes with each portable.

COLLTIME.SCR

A program that stamps all item entries with the date and time. Output format: date,time,item.

159

Page 172

2342.book Page 160 Thursday, July 22, 2004 8:35 AM

The PPG Library

COMPILE.SCR

A collect-only program that counts the number of duplicate entries in a file. Output format: item,repeats.

CONFIG.SCR

A program that allows the user to scroll through and change system parameters from a list that is loaded into the portable.

FIELDS.SCR

A short program that demonstrates template use by combining two inputs with a comma delimiter.

FIELDS1.SCR

A template example where the first two characters are stripped out of the register.

HANGMAN.SCR A program that uses the classic word game as an excellent example of complex file manipulation. A word of up to nine characters is entered by a user. A second user then guesses the word. Each correct guess is filled into the appropriate blank, and each incorrect guess is displayed on the screen as Hangman is spelled out.

160

HOSPITAL.SCR

A program designed to help nurses track patient medications and used items. It also has a reminder feature and a way to review each patient’s file.

INSPECT.SCR

A program that prompts the user with questions about a scanned item and records a pass or fail condition with comments.

ITQU.SCR

The other portion of the standard sample program that comes with each portable. Item and quantity collection are featured.

LIBRARY.SCR

An application to track checked in, checked out, and late books in a school library.

MATH.SCR

An example of the math node. The register is multiplied by 3.

METO5000.SCR

An example of running a serial printer with the portable.

MODEM.SCR

A complete example of a modem communications program designed to transmit and receive files.

MODIFY.SCR

An example of the Modify node that includes options for all modify functions.

MONEY.SCR

A program that keeps a running total on an item. A pick list file is downloaded into the portable, and as the items are matched, the user has the option to add or subtract a quantity from the total

PT Program Generator (PPG) v5.0

Page 173

2342.book Page 161 Thursday, July 22, 2004 8:35 AM

PPG Program Source Files

MULTIPLE.SCR

A multiple-option program that includes a Collect node with a compile option; an item/quantity option; a pick list; a calculator; and a clock option.

MULTPLE2.SCR A large program (342 nodes, with 8 separate programs) that has the same options as MULTIPLE.SCR plus a modem communications program, the hangman game, and a time tracker. PICKLIST.SCR

A program in which, as items are matched, they are erased from a downloaded pick list and moved to another file for uploading.

RANGE.SCR

A sample of a range test, in which high and low numbers are entered and followed by a test number. In or out of range is then displayed.

TRACKER.SCR

A sample of a minutes counter. A pick list is downloaded, and when a function is chosen, time (in minutes) is counted until the function key is selected. Total time is accumulated for each function.

TRACKER2.SCR A sample of a different approach to tracking time. As each function is scanned or typed in, the time is reset to zero. The clock updates every second, and the total time is then copied to the file in regular clock format. UPLOAD.SCR

A sample data-collection program that transmits data via a modem using Procomm Plus in host mode.

UPPRPLUS.SCR A sample data-collection program that transmits data to a host via a modem using Procomm Plus in host mode.

User’s Guide

161

Page 174

2342.book Page 162 Thursday, July 22, 2004 8:35 AM

The PPG Library

NOTES

162

PT Program Generator (PPG) v5.0

Page 175

2342.book Page 163 Thursday, July 22, 2004 8:35 AM

Appendix D PPG System Commands Overview To use PPG to reset the default settings on the PDT, enter the human readable portion of these bar codes at the system command prompt. This is useful to automatically change modes for the user. The following bar codes are provided in this section: •

Using Predefined Defaults on page 164.

•

Alternate Parameters on page 165.

Additional setting bar codes are provided in the Programming chapter in the PSC Falcon PT40 Product Reference Guide. Enter the human readable portion at the system command prompt in the Output node Properties dialog. Figure 130. System Command Field in the Output Node

User’s Guide

163

Page 176

PPG System Commands

Using Predefined Defaults The PSC Falcon PT40 use the following four sets of parameter defaults. Reset the portable to a predefined default set by scanning one of the bar codes in Table 3 on page 164. Table 3. Predefined Defaults for the PT40 Predefined Defaults Default Name Predefined Default 0 (D0)

Predefined Default 1 (D1)

Predefined Default 2 (D2)

Bar Code

*

*

*

$ + $

$ + $

$ + $

Description Turns every ON/OFF parameter OFF and sets all minimum and maximum lengths to zero.

- D 0 E E *

Turns every ON/OFF parameter ON, sets all minimum lengths as low as possible, and sets all maximum lengths as high as possible.

- D 1 E E *

Default set installed on the portable at the factory. This default set will work for most applications.

- D 2 E E *

Restores the default serial communications settings.

Serial Default *

164

$ + $

-

C 8 E E

*

PT Program Generator (PPG) v5.0

Page 177

2342.book Page 165 Thursday, July 22, 2004 8:35 AM

Alternate Parameters

Alternate Parameters Enter these commands by scanning the bar codes with the PT40’s laser or through the PC’s serial port. You can also embed these codes in a PPG application. The Falcon PT40 recognizes the bar code commands in Table 4 on page 165. Table 4. Scannable Bar Codes of Alternate Settings for the PT40 Scannable Bar Codes of Alternate Settings for the PT40 Setting Name

Bar Code

Description

Has the same effect as the <CLR> key

Clear Mode *

-

-

*

Character Clear Mode

Has the same effect as the <CLR> key for the last character entered. *

-

+ *

Receive File Mode

Prepares the portable to accept a program. *

/

.

*

Low Beep Mode

Sounds a low beep on the portable. *

.

-

*

High Beep Mode

Sounds a high beep on the portable. *

.

+ *

Retrieve Data Mode *

User’s Guide

$ $

*

Retrieves data if the application program stops execution and gives the PROGRAM FAILED message. Connect the portable to the PC and start the communications program on the PC, then scan this bar code. The data will transmit, one file at a time.

165