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 10 of 21

PT Program Generator User's Manual, pages 88 to 97

Pages 88 to 97 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 88

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

Creating & Using Nodes

NOTES

76

PT Program Generator (PPG) v5.0

Page 89

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

Chapter 6 Managing Data Overview This section discusses methods for controlling data flow, data handling, and data organization. The following topics are covered: •

Controlling Data Flow on page 78.

•

Registers on page 78.

•

•

•

User’s Guide

•

Using a Register as a Source on page 78.

•

Register Fields on page 79.

•

Using a Register as a Destination on page 79.

•

Specifying a Register Field on page 80.

•

Register Example: Parsing Data on page 81.

Files on page 81.

•

Using a File as a Source on page 82.

•

Data Location on page 82.

•

Using a File as a Destination on page 83.

Templates on page 84.

•

Template Uses on page 84.

•

Creating a Template on page 85.

•

Modifying an existing template on page 86.

•

Template Example: Modifying Inventory on page 86.

Fields on page 87.

77

Page 90

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

Managing Data

Controlling Data Flow There are four tools you can use to control the flow of data: Table 2. Data Flow Tools Tool

Description

Registers

Stores data temporarily. When you scan or enter a string of data, it is usually placed in a register before it is copied into a portable file. You can also use registers to store user response to a prompt, the index of a record in a file, and so on.

Files

Holds data in the portable until it can be uploaded to a PC. Usually after input data is verified, it is inserted in a portable file. The file expands as more data is added. Files can also be used to hold database information downloaded from a computer. This information can then be used to verify scanned data or for other purposes.

Templates

Combines data stored in different registers or breaks down data in a single register into fields. You can use them to set up records in a file so that the data can easily be transferred to a database or spreadsheet file. You can also use them to access portions of data in a register.

Fields

Fields are a breakdown of data in a single register. Data is arranged as fields in records in a template. Fields can be set to either a fixed length or a variable length with a separator.

The following sections describe how to select a register to store or access data, how to select a source or destination file, and how to create a template for breaking down or combining data. The last two sections give examples of using registers, templates, fields, and files to control data flow.

Registers A register is a temporary holding place for data. Registers can be used both as a source of data and a place where you can place data temporarily.

Using a Register as a Source When you choose Register as the source, you are given options as shown in Figure 52.

78

PT Program Generator (PPG) v5.0

Page 91

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

Registers

Figure 52. The Source Register Options

To view a list of existing registers, click on the arrow to the right of the register list. To select one of these registers, click on it. To create a new register, click on the New Register button.

Register Fields To select a specific field in the register, select the Field checkbox. This will display a list of templates and fields within the register. For more information on register fields, refer to Specifying a Register Field on page 80.

Using a Register as a Destination When you choose Register as the Destination, you are given the options shown in Figure 53. Figure 53. The Destination Register Options

To view a list of existing registers, click on the arrow to the right of the register list. To select one of these registers, click on it. To create a new register, click on the Define Register button.

User’s Guide

79

Page 92

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

Managing Data

Write Type To select how the data is stored in the register, select the write type from one of these options: Insert

Insert places the data at the beginning of the register, before any existing data.

Overwrite

Replace replaces any data previously stored in the register.

Append

Append adds the data to the end of the register, after any existing data.

Field

Field stores the data in a specified field of the register (refer to Specifying a Register Field on page 80).

Specifying a Register Field If you enable the Field checkbox for the Register Source or select Field as the Write Type in a Register Destination, the template and field pull-down lists become available. (refer to Figure 54). Figure 54. Template and Field pull-down lists

• •

Select the template you want to use from the Template pull-down list, and then select the field. To create a new template, select the New Template button (refer to Creating a Template on page 85).

80

PT Program Generator (PPG) v5.0

Page 93

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

Files

Register Example: Parsing Data You own a catalog business. When you ship packages out, you scan a label that includes the destination region. The first character of each label identifies this destination region as North, West, South, or East. Customize the application so it divides data into four separate files by region. Create a template that separates the scanned data into two fields, the first one for the region character and the second one for the rest. The template examines the region field to determine the file into which the scanned data should be copied: North, West, South, or East. To create this template, complete the following steps: 1. Create a template called Region containing the following fields: •

Region, fixed length:1

•

Rest, variable length, comma delimited

2. Create a Verify node that uses the Region template to determine whether the character in the Region field is N and, if it is, proceeds to a Copy node that copies the contents of the input register to a file called North. 3. Create a second Verify node that checks whether the character is W and, if it is, copies the input code to a file called West. 4. Create a third Verify node that checks whether the character is S and, if it is, copies the input code to a file called South. 5. Create a fourth Verify node that checks whether the character is E and, if it is, copies the input code to a file called East.

Files Portable files are used to store data that has been either input via the portable’s scanner or data keys or downloaded from a PC file through the serial port. Each entry in a file is called a record, and the records in each file are numbered, with 1 as the first record. There are two types of file settings in portable dialog boxes. Source file settings specify a file or record in a file to be read from. Destination file settings determine a file or record to be written to.

User’s Guide

81

Page 94

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

Managing Data

Using a File as a Source From the Data Destination pull-down list, select File to make additional options available, as shown in Figure 55). Figure 55. Source File Options

Select from the File pull-down list, or press the New File button to create a new file. Enable the Record checkbox to see additional options.

Data Location The Data Location field lets you specify where the data you want to use is currently located; choose from the following options:

82

First

First indicates the first record in the file.

Last

Last indicates the last record in the file.

Number

Number selects a specific record. You are prompted for the record number.

PT Program Generator (PPG) v5.0

Page 95

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

Files

Index

Index lets you indicate a register where the number of the record you want to use is stored. You are prompted for the name of the register containing the record value (refer to Using a Register as a Source on page 78.

Using a File as a Destination When you choose File as the destination, you are given options as shown in Figure 56. Figure 56. Destination File Options

Select from the File pull-down list, or press the New File button to create a new file.

User’s Guide

83

Page 96

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

Managing Data

Write Type To indicate where the new information is stored in the selected file, select one of the following options: .

Insert

Places the data before a given record. When this option is selected, additional options allow you to choose a specific record in the file. (These options are described in the preceding section, “Using a File as a Source.”)

Overwrite

Replaces a given record. When this option is selected, additional options allow you to choose a specific record in the file. (These options are described in the preceding section, “Using a File as a Source.”)

Append

Adds the data to the end of the existing file.

Sorted

Inserts the record into the file based on ascending ASCII value. Use this option to insert records into a specified file that has already been sorted to maintain the proper order of the records in the file.

Templates A template is a structure that you can define and use to alter the way in which collected data is stored. Templates can be used only in registers, not in file records.

Template Uses The most common use of templates is to parse data in a register. This allows you to collect and store more than one type of information. For example, your program could ask the user to first enter a location code for an item and then the item number. The template would combine each set of values in a register, and the value pair could then be copied to a file as fields in a single record. Data in the file would be arranged either in fields of a fixed size, as in the following: 2348493848 48 393948 8 293832 9 832928 185 392038 28 282930

84

PT Program Generator (PPG) v5.0

Page 97

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

Templates or with delimiters separating variable-length fields in the record, as in the following: 2348,493848 48,393948 8,293832 9,832928 185,392038 28,282930

Once downloaded to the PC, this data file can be easily translated by a database or spreadsheet program. The first value in each record goes into a Location field, the second value goes into an Item Number field, and the program pairs the values appropriately. Another use of templates is to break down data stored in one register into two or more register fields (for example, to strip out the first section of a code).

Creating a Template To create a template, complete the following steps: Figure 57. The Create Template Dialog

1. Select Create > Data > Template from the menubar. The Create Template window is displayed as shown in Figure 57

User’s Guide

85