Chapter 13: tables, Why use tables, Data validation using tables – Worth Data 5000 User Manual

Page 82: Data validation table file format, Chapter 13, Tables

Advertising
background image

81

Chapter 13:

Tables

The TriCoder allows you to download a lookup table for verifying data and/or displaying data from a table to complement the data
collection process. In addition, you can use tables to update things like prices descriptions and other data that you have stored in a file
but may be different in the field. The TriCoder has a 1MB storage file exclusively reserved for a table.

Why Use Tables?

o Data Validation - Make sure that the items scanned by the user are valid times by validating them in the table
o Data Validation with Duplicate Access Checking – Prevent entry of the same item again
o Lookup and display of 1-3 additional data fields in a record
o Enter data from the table into the prompt as default data – This allows you to use the table data as a reference and change or

update that data in the data file

Data Validation using Tables

Lets say you have a warehouse application where you want to use the TriCoder to record items being loaded onto a truck. You can use
a table of data downloaded into the TriCoder to validate what is being loaded on the truck. When the worker scans the item to be
loaded, the TriCoder checks the item number against the item numbers in the table; if they match, the item number is written to the
data file and he moves on to the next item. If the item number he scans is not found in the table, the TriCoder would alert the worker
that the item he is loading is not on the list, avoiding a possible miss-shipment or loss.

Data Validation validates a single field of entered data against a table constructed of single pieces of data. The TriCoder uses the
DATA ID field to specify which table you want to use to validate the data entered for that statement.


When the operator enters an item found in the table, the TriCoder writes the item to the data file and goes to the next statement in the
program. If the item is not found in the table, the TriCoder displays:

ITEM NOT FOUND
HIT ANY KEY_

and displays the statement prompt over again.

Data validation table file format

The file format used to create a table for data validation is a simple ASCII text file with CR/LF delimiters. The first line in the data
file is a variable-length header record that defines the data in the table. The first 2 digits indicate the data length of each record in the
table. The next 9 digits are always 0‟s (zero), indicating that the data is for validation only. The following characters can be whatever
you want - it is optional and for reference only, the TriCoder does not use it. The following header would indicate a 6-digit length
data table, using the word EXAMPLE1 as the reference:

06000000000EXAMPLE1

After the header come the lines of data to validate. The only constraint on the file size is the amount of memory you have allotted for
the table data. If the data file is created in DOS, the file needs to have a Ctrl Z (ASCII 26 or Hex 1A) to indicate the END OF FILE.
A sample file using the example header above might look like this (each line terminated by a CR) :

06000000000EXAMPLE1
111111
222222
333333
324211
365667
Ctrl Z

(ASCII 26) (use if a DOS file)

In the example above, all data entries are 6 characters long, as specified in the header information. If you want to be able to use
variable length data, you must set your header length to the longest number required (lets say your longest number is 8 digits long) and
then any data shorter than 8 characters long, must be padded with TRAILING spaces; for example (x indicates a “space” character):

Data ID entry

Description

A1A

Validate data using Table

D1D

Validate data using a Table Prevent Duplicate Items

Advertising