barcoding_in_alpha_five_part_3_.htm
This article
is the third and final article in a series of three dedicated to using
barcodes in Alpha Five. The first two articles appeared in the July 2002
("Barcoding in Alpha Five - Part 1")
and the September 2002 ("Barcoding
in Alpha Five - Part 2") Alpha
Newsletter. If you are new to barcoding, and have not done so, please
consider reading those two articles now, as they contain the information on
which this article is built.
Portable
data collectors are available from dozens of manufacturers. The
"Tricoder" from Worthdata.com
is one example of such a device. It's
capabilities and format are similar to those of other such collectors, so this
review of using a Tricoder with Alpha Five should give you a fairly good idea on
how to incorporate any similar device into your application.

In
choosing the Tricoder, I considered the following:
1)
Price was very reasonable compared to other models.
2)
Programming the Tricoder was easily done through a Windows interface similar to
that for field rule entry in Alpha Five. The program could also be written
or changed right from the keyboard of the device itself.
3)
The size allowed it to easily hang from a belt with the addition of a leather
holster.
4)
It allowed, when programmed accordingly, a pick list to be loaded and
reviewed. In other words, not only could it collect data, it could give
the user feedback on a UPC by showing information on the item that was
scanned. Such information might include a description, cost, and the
computer's calculation of the quantity on hand.
5)
It allowed verbal commands to be recorded and played back during usage.
That is, not only did it request a UPC via text on the 4 line screen, the
programmer could record a two second message asking the user to "Scan the
UPC" in any language the person recording the message could speak! In
the example we will build below, we could easily record two such voice
prompts. The first prompting the user to "Scan the UPC", and the
second prompting the user to "Enter the quantity on hand".
A very nice feature that speeds up data entry!
While
there are hundreds of scenarios where one might use a data collector, we'll use
a more common example to present this information to you. Let's imagine we
own a small office supply store. As we are a computerized company, we have
a very efficient replenishment system designed in Alpha Five! This
replenishment system keeps track of our sales and the current on-hand quantity
of every product. As our sales depend on having our products in stock at
all times, the software generates orders for our suppliers on a daily
basis.
Now, the
Alpha Five can do a LOT of things, but it, like any other software, can't
determine what items were stolen from the store, or what items are un-sellable for other reasons, such as
torn packaging. For this very reason,
most retailers inventory their stock on a regular basis. With computer
on-hands in synch with the actual stock levels, the software generates the
appropriate orders to keep the shelves full, and the customers happy!
With all
this in mind, we decide to inventory our store once a year. The scenario
is simple. We want to load a tricoder with a master list of every UPC-A we
carry, set the Tricoder up with a small program to collect the on hands for each
UPC that is scanned, then dump the information back into our replenishment
system.
Here's
how we do it...
In our
replenishment system, we have one table that lists every UPC we carry in the
store, one record for each item. We call this our master.dbf. Please
review the section titled "SETTING UP UPC-A IN
ALPHA FIVE:" in the July 2002 ("Barcoding
in Alpha Five - Part 1") article for the specific field rules required
for a master table. In that article, we called it lookup1.dbf.
Here is
the structure for our master table, and the items we carry:

GETTING
ALPHA FIVE READY TO RECEIVE DATA:
Our
first step is to create a table called inventory.dbf that mirrors our master.dbf
above. We can use the Alpha Five's duplicate feature to do this.
Once the master table is duplicated as inventory.dbf, we need to make the
following changes:
1)
We need to empty the inventory.dbf table.
2)
We
need to modify two field rules:
a)
Set the upc_code field so it is no longer allows only unique values (We may,
during our store inventory, have several places where we have the same item
merchandised, so we want to allow for the possibility of several records.)
b)
Set the model_no, description, cost, and retail fields to skip all the time by
placing .T. in the expression box.
3)
We need to restructure the inventory.dbf table, adding a numeric field
called "on_hand_qty", as shown below"

Inventory.dbf
will become the linking table between the Tricoder and the Alpha Five
replenishment system.
The
second step is to create a form called "Tricoder Transfer Form" for
the inventory.dbf, simply embedding a browse table on it as such:

1)
On the onInit event for the form, we need to place the following code so the
form opens in non-edit mode:

2)
We need to place the following code on the 'Start Tricoder Transfer' button's
OnPush event. The code first places the form in edit mode, then starts a
new record, then changes focus from the button back to the embedded browse.
O.K.,
we now have everything set up to receive data from the Tricoder. It may
be a good idea to open the 'Tricoder Transfer Form' as a dialog box by placing
the following code on the button used to open the form. By doing so, you
will help to prevent the form from losing focus when transferring data from the
Tricoder to Alpha Five.

PROGRAMMING
THE TRICODER:
There
will be a few decisions you will have to make when you are first setting up the
device. How you set up the core settings for the device will depend on
what you are using it for. One such decision will be how you designate
chunks of memory. (For the most part, the Tricoder is ready to use right out of the
box.)
One
mandatory setting will be allocating how you want to use your memory. A
Tricoder, or any such device, has a limited amount of memory. It really
doesn't need much - Even the largest retail stores such as Kmart, which has
50,000 items in it's larger stores, only have devices with 2 megs of
memory. The fact is that that much is rarely needed!
Tricoders
currently ship with 512k of memory. A Tricoder can store three programs
and it's settings without tapping into the 512K. The 512k gets divided up
into six different partitions. Three for the data you collect so you can
segregate what you collect into three different groups, and three for the tables
(or lookup lists) you upload into the Tricoder. Further information is
available with whichever device you purchase, and this is very easy to
configure!
You
will also need to pick a COM port when transferring data to and from the
Tricoder.
Now,
there are two parts to our situation that we need to set up in the
Tricoder. We need to upload a unique list of UPC codes that we carry, and
we need to create a program to prompt and collect the store inventory.
Let's
do the lookup table list first. Quite simply, we take our master.dbf and
export the UPC's as a *.tbl file. We'll call it master.tbl, and save
this operation as 'Tricoder_Lookup_Table'.
This is the operation card for the export:

Once
created, the
master.tbl file must now be modified slightly. The first line must read
"12000000000MASTER" where the twelve represents the twelve digits in
the UPC-A, the nine zeros are other settings not used in this table (they are
used for pick
lists), and MASTER is the name of the *.tbl file.
Now
we need to move this master.tbl file into the Tricoder. This is done via
the serial port with an easy to use utility that ships with the Tricoder, as
shown below:

Now
we need to create a program for the Tricoder that prompts the user for
data. We'll use the "Virtual Tricoder" software that ships with
the Tricoder. The program is quite simple. We need three steps to
our program: Ask the user to scan the UPC, then ask for his on hand count,
then ask the user if he wants to continue the loop, or end the program. We
ask if he wants to continue to give the user the option of stopping!
Each
of the three above steps is a 'statement' in the program. Below are the
three statements. You can see that most settings are radio buttons, and
while you may need to reference the manual, it is very easy to write and deploy the
program!
Statement
1: (You'll notice the 'Data ID' points to the Tricoder designation for the
lookup master.tbl - this prevents a rogue UPC from being scanned in and causing
rejection issues when the data is being moved into Alpha Five! If the user
scans a UPC that is not in the master.tbl file, he is alerted that the item is
not found, both on the screen, and when a built in voice message chirps out
"Item not found" through the built in speaker or an
earphone!) (Voice Msg 1 is recording #31, which is my voice saying
"Scan the upc!")

Statement
2: (Voice Msg 1
is recording #32, which is my voice saying "Enter on hand!")

Statement
3: (You'll notice the On NO goto statement is 99... This tells the Tricoder
to end the program!) (Voice Msg 1 is recording #33, which is my voice
saying "Continue?")

We
can now save the program. We'll call it Alpha_Five_Pgm.tri. It is
the easy to send the program to the Tricoder (via the serial port) by pressing
the 'Send' button on the Virtual Tricoder and following the simple instructions!
We
are now ready to collect and dump data! You simply run the program on the
Tricoder, collecting the data, then upload the data from the Tricoder into the
'Tricoder Transfer Form' embedded browse (opened as a dialog box).
Now,
you can see that this was a very simple setup, and the real world issues may not
be quite as quickly resolved, but both Alpha Five and the Tricoder seem to work
fluently together to make it as painless an ordeal as possible!
Here
are some files you can download and review. The first file listed to
download includes the 'Alpha_Five_Pgm.tri' file, so you can review the actual
Tricoder program we wrote here. The 'Master.tbl' is also included:
Click
here to download the VERSION 5 Tricoder files shown above!
Click
here to download the Virtual Tricoder from WorthData.com!
Click
here to download the Tricoder Utilities software from WorthData.com!