|
Frequently Asked Questions: PSC /
Percon Products
PPG
- How do I develop a
program to print directly from my portable to a serial printer?
What is PPG?
How can I delete
a data field definition that I no longer need?
Where can I find
tips and sample programs for PPG?
How do I
calculate the number of records (memory units) a PT2000/TopGun will
hold using PPG?
1. How do I develop a program to print directly from
my portable to a serial printer?
Warnings
Printing directly to a serial printer from
a PSC portable is fairly simple in theory. All you need to do is supply
the printer with the correct data for the label you want to print.
However, the actual process of identifying the correct command structure
for the label you want and then getting the portable to create it on
demand can be very time consuming.
Solution
Connect the printer to your PC with the
standard serial cable that comes with the printer.
Using the programming manual from the
printer manufacturer as reference, create a text command file that you
can send from the PC directly to the printer using Windows
HyperTerminal (or some other communication utility) that will
successfully print an example of the label you want the portable to
print. (Sometimes, the printer will come with label printing software
that you can use to create a label. Since the label file is sent to
the printer as serial data, you should be able to use the portable to
receive the data instead of the printer. If you can do this, you can
easily get a copy of the command data required to print your label.)
Once you have a command text file that
will print a label from the PC, copy this file to the portable.
Connect the portable to the printer
using the standard serial cable for the portable and the standard
serial cable for the printer connected together with a null modem
adapter.
Print a label by sending the command
text file from the portable to the printer. If this does not work,
verify that all the parameters you used to print the label from the PC
to the printer are being used the same with the portable (baud rate,
data bits, flow control, etc.)
Once you can print a label using your
example command text file, print out the command text file on paper
and highlight the areas in the text data where the raw data is used.
These areas of raw data in the command file structure will be supplied
by variables in the portable program. For example: If you are printing
a label that has one bar code of "123456" and one text
description of "Test Label", highlighting the data
"123456" and "Test Label" in the command text file
will show you where the raw data is used.
Once you have highlighted the data,
everything that is highlighted needs to be supplied by a variable in
the program. Everything that is not highlighted will be constant for
this particular label. Once you know this, you can develop the program
to supply the required constant data and the variable data to create
labels with any data you want.
Use development software (UPG or 'C' for
Falcons and PPG for PT2000s) to create the command text file using
variables for the data fields. Keep working until you can print a
different label by changing the data in the variables.
The last step is to integrate the label
creation code into your data collection program so that the label
prints when you need it to print.
Once you have the program working, if you
want to create a custom label, you can use the two cables connected with
the null modem to design a direct cable. Using a continuity tester you
can verify which pins on the portable connector go to which pins on the
printer connector and use this information to make a custom cable that
goes straight from the portable to the printer.
Related Information
Additional considerations when
dealing with direct serial printers include:
- If the cable is not correct, the
printer will probably do nothing when data is sent because it never
gets to the printer.
- If the cable connecting the portable
to the printer is correct, but the data that is sent to the printer
is not correct, the printer may do one of the following:
- Signal you that it has received
data but that the data is not correct
- Show a general error condition
- Do nothing
Printers must have correctly structured
data that is sent correctly in order to function properly. Consult the
printer´s user and programming guides for more details.
2. What is PPG?
The PT 2000/TopGun requires an
application in order to collect, store, process, and transfer data to a
host PC. Although the PT 2000/TopGun comes standard with PAL, a library
of applications for inventory management and asset tracking, many users
have special needs that can only be met by a custom program. PSC's
Portable Program Generator (PPG) is an easy to learn, Windows-based,
visual development tool for creating custom portable programs to meet a
variety of data collection needs. PPG may be used to tailor a portable
program to the requirements of a specific customer or industry. It can
also be used to make applications that perform data validation and
lookup functions or to provide data output to a printer or modem in the
field.
PPG applications are created using a graphical interface to link
programming steps and menus. The overall logical flow of a PPG
application appears as a flow chart and the underlying processes, such
as data input, storage, validation, and output, can be viewed simply by
clicking on a "node" in the flow chart to bring up a process
menu. A program is created by linking nodes in a logical sequence and
completing menus that contain programming operations and commands. PPG
applications can be easily modified and updated when the need arises.
3. How can I delete a data field definition that I no
longer need?
Warnings
As with all development utilities, it is
good to have a current back up of your program so that as you experiment
with deleting "unused" pieces of the program, you can go back
to your back up copy should you actually need what you deleted.
Solution
When deleting a field, first be certain
that it is not being used by any templates (see the "Related
Information" section).
- Select the field that you want to
delete in the Field Name field on the Define a Field window and
press the delete key on your keyboard.
- You will see a message box asking you
to verify the deletion of this field. Acknowledge it by clicking on
the OK button.
- If the field is not being used
anywhere, you will be taken back to the Define a Field window. If
the field is in use, you will get another message box telling you
that the field is in use. You will need to acknowledge this message
and then find the template that is using that field and delete it.
Deleting templates works the same way as
deleting fields except you use the Define a Template screen.
Related Information
PPG uses Templates and fields to parse
data. Fields are basic building blocks and are defined as variable
length delimited by a certain character or as fixed length. Fields are
then "stacked" into a template in the order that the fields
occur in the actual data.
Once defined, templates are used to read
out pieces of data from a data record or are used to create data records
by copying pieces of data into the appropriate fields in the template.
4. Where can I find tips and sample programs
for PPG?
The PPG Reference Library contains sample
application library programs (.scr files) and a list of helpful hints
(.txt files) to aid in creating your specific application. The TIPS LIST
below provides a description of PPG Tips 1 through 15, and The LIBRARY
DISK LIST below provides a list of the sample program file names and
descriptions.
Note: The original Library Disk List
programs were created in an earlier version of PPG. The latest version
of 4.4 offers new options such as floating point math and wildcard
searches. These programs can still be used with PPG 4.4, however, the
new PPG 4.4 options (floating point math, etc.) are not used.
Tips List
TIP #1: SETTING TIME/DATE IN PPG
TIP #2: SETTING THE AUTO OFF
TIP #3: VERIFYING A NUMERIC VALUE
TIP #4: OUTPUTTING A REGISTER TO THE
DISPLAY
TIP #5: VERIFYING THE SIZE OF AN INPUT
TIP #6: DOWNLOADING A FILE TO YOUR PSC
PORTABLE
TIP #7: FINDING THE NUMBER OF RECORDS IN
A FILE
TIP #8: FINDING A MATCH TO PART OF A
RECORD IN A FILE
TIP #9: FIXING FILES THAT WON'T OPEN
TIP #10: REFERENCING TO DIFFERENT FILES
TIP #11: REVIEWING A FILE
TIP #12: CREATING A BEEP
TIP #13: CONVERTING THE PT2000 INTO A
WEDGE
TIP #14: PADDING A NUMBER WITH LEADING
ZEROS
TIP #15: CHECKING TO SEE IF A NUMBER IS
AN INTEGER
Library Disk List
The library was designed to give PSC
Program Generator (PPG) users samples 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. The
associated text files identify the type of sample and provide brief
descriptions of each program. Some of the programs include a brief
description of the steps involved in creating a PPG program.
- ASHOST.SCR: A data collection program
that allows a remote system to call up the Portable via modem and
receive the data.
- AUTO.BAT: Using the Sample2.SCR
program, files are automatically pulled from the collect mode.
- BASIC.SCR: A program with menu,
upload, and erase options completed. The Collect Node is left empty
for the user to set up.
- CASHREG.SCR: This program 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.
- COMPILE.SCR: A collect only program
that checks a file for duplicate entries and counts the number of
repeats. Output format will be: (item,repeats).
- COLLTIME.SCR: Time and date stamps all
item entries. Output format will be (date,time,item).
- COLLECT.SCR: The collect portion of
the sample program that comes with each Portable.
- CONFIG.SCR: This program allows you 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. This combines two inputs with a comma
delimiter.
- FIELDS1.SCR: Another template example
where the first two characters are stripped out of the register.
- HANGMAN.SCR: Yes, it's the classic
game as well as an excellent example of complex file manipulation. A
user enters a word containing up to nine characters. A second user
then begins guessing the letters contained in 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.
- 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.
- INPUT.SCR: An example of the input
node.
- INSPECT.SCR: This program will prompt
the user with questions about a scanned item and record 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: A sample 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. Provides options for all modify functions.
- MONEY.SCR: This program 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.
- MULTIPLE.SCR: A multiple option
program: Collect (with a compile option); an item, quantity option;
a picklist; a calculator; and a clock option.
- MULTIPLE2.SCR: A program to show how
large a program can get (342 nodes in this case, with 8 separate
programs). It has the same options as multiple.scr plus 3 more
programs: modem, hangman, and a time tracker. This program could be
made more efficient using menu nodes and more programming could be
added.
- PICKLIST.SCR: As items are matched
they are erased from a downloaded picklist and moved to another for
uploading.
- RANGE.SCR: Sample of a range test.
High and low numbers are entered followed by a test number. In or
out of range is then displayed.
- SAMPLE2.SCR: This is the basic program
included with each Portable. It features three basic collection
programs: collect, item, quantity, and keyboard wedge for the
PT2000.
- TRACKER.SCR: A sample of a minutes
counter. A picklist is downloaded. 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 different approach to
tracking time. As each function is scanned or typed in the time is
reset to zero. The clock then updates every second. 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 the
host mode.
- UPPRPLPUS.SCR: A sample data
collection program that transmits to a host via a modem using
Procomm Plus in the host mode.
5. How do I calculate the number of records
(memory units) a PT2000/TopGun will hold using PPG?
Reference: To calculate the number of records NOT using PPG, see related
FAQ #011 under PT2000/Top Gun.
- Find the number of memory units used
by the files, registers, templates, and fields defined by your
application program:
- Open the PPG program.
- Select either an input or an
output node.
- Select File under Source, then
select the down arrow next to the file name. Count the number of
files used by your program.
- Multiply the number of files by 21
(each file uses 21 memory units).
- Select Register under Source.
Select the down arrow next to the register name and count the
number of registers used in your program.
- Multiply the number of registers
by 18 (each register uses 18 memory units).
- Select Field next to the Register
name. Select the down arrow next to the template name and count
the number of templates used in your program.
- Multiply the number of templates
by 2 (each template uses 2 memory units).
- Select the down arrow next to the
field name and count the number of fields your program uses in
the templates.
- Multiply the number of fields by 2
(each field uses 2 memory units).
- Add all of these values together
to get the total memory units used by the overhead of the files,
registers, templates, and fields.
- Find the number of memory units used
by your application program:
- Open the PPG program.
- Select "Download
Program" from the File menu (the portable should be
disconnected from the serial port).
- When the PSC (Percon) Portable
Programmer opens, it will display the Application size in HEX
bytes. If "WARNING: Application is in RAM" is also
displayed, then you need to calculate how many memory units are
used by your application.
- Divide the number of bytes
displayed as "Amount in RAM," by 8 (round up). This is
the number of memory units used by your application program.
- Find the number of memory units used
by the records in your files:
- Add the number of characters in
your record. If the number varies, use the worst case.
- Add 17 to the length of your data
(1 for the string termination, 8 for the record pointers
overhead and 8 to force a round up).
- Divide by 8 to get the number of
memory units your record will use.
- Multiply this number by the number
of records you are going to have in your file. This is the total
memory used by your records.
- Calculate this total for each of
your files.
- Add all of the memory units from steps
1-3 together to get the number of memory units that your program
will need to operate correctly.
- From the list below, identify the
amount of memory that your portable presently contains:
|
Amount of Memory
|
|
Total Memory
Units
|
|
128K
|
|
14,000
|
|
256K
|
|
30,500
|
|
512K
|
cannot exceed:
|
63,000
|
|
1 Meg
|
|
128,000
|
|
2 Meg
|
|
256,000
|
|
3 Meg
|
|
384,000
|
|
The Application/File/Total Overhead size
derived from step 4 cannot exceed the Total Memory Units listed for that
Memory Option size above. If it does, then upgrading to the next largest
Memory Option is required/recommended.
Tech Support :
973-579-0103 or 973-579-1309
Fax : 973-579-7564
8:30 to 5:00 Eastern Time. Mon.- Fri.
Return to the
Instruments & Equipment Home Page
TO SPEAK TO AN I&E
ACCOUNT REPRESENTATIVE PLEASE CALL
1-800-432-1255 or 1-973-579-0009
|