92WARE Programs for PRO-92 and PRO-2067

Ken Plotkin
kjp15@cornell.edu
February 11, 2001
Version 1.03

92ware is a set of Windows console programs to upload, download and program
the Radio Shack PRO-92 and PRO2067 scanners.  Much credit for this software
goes to Bill Petrowsky, who decoded the PRO-92's memory contents and
deciphered the data transfer protocol.

A special serial cable is needed for use with this software.  Bill has
designed one that works well.  The schematic and instructions are at
www.pro-92.com/pcifcable.htm.  There has been considerable discussion on
the pro-92.com message board about what other cables may work; check the
archives.


There are four programs:

read92.exe - Downloads data from the scanner to a PC.  Downloaded files are
             in SPG format, compatible with GRE's Data Manager software.

spgasc.exe - Converts a SPG file into a readable (and editable) ASCII
             format.

ascspg.exe - Converts an ASCII file created by spgasc.exe (and possibly
             edited by the user) into SPG format.

load92.exe - Uploads a SPG file from a PC to the scanner.

These are Windows console programs which run under Win 9x.  To install,
just copy them to a working directory.  To run them, open a DOS prompt (not
DOS mode - just a simple prompt), and type commands at the prompt.
Specific directions are given below.

Despite the DOS-like appearance of console mode, these are not DOS programs
and will not run under DOS.  DOS versions are possible in the future if
there is enough demand.

Note on Windows NT and 2000:

As of the release date of this software, load92 does not run under Win NT
and 2000.  This may be a limitation of the Compaq Visual Fortran compiler
used, but the problem does not occur on Compaq support's machine.  Compaq
told me that serial output on NT will sometimes stall if DSR is not
asserted.  That could be addressed by a jumper between pins 4 and 6 of the
DB9 connector, but that has not been tested.  A maintenance upgrade of
CVF, with improvements to serial port routines, has been used to build the
current version of 92ware.  I am putting this version up before testing
under NT.

Even though I don't run NT or 2K, I hate it that this software does not
work on those OS's but GRE's does.  I am pursuing this.  Advice from any
programmers who have successfully used the serial ports under NT or 2K is
more than welcome.

=== Overview ===

You need all four programs to use this software.  The steps are:

o read92 to transfer data to your computer, as a spg file
o spgasc to convert to ASCII text
o Edit the ASCII file, using your favorite editor
o ascspg to convert the edited ASCII file to spg
o load92 to transfer the new spg file to the scanner

Make sure to use the right programs at each step.  There is very little
error checking in this software.  It is intended for knowledgable (or
adventurous) users.

=== Supporting files ===

In addition to the executables and this file, there are three information
files:

editors.txt   is a pointer to several shareware text editors.  Since
              programming is by editing an ASCII text file, get a decent
              editor.  You can use Notepad, but...

pro92map.txt  is a complete description of the contents of a spg file and
              the transfer protocol to/from a PRO-92.

revhist.txt   is the revision history of the software.  Nobody ever reads
              that kind of thing, but it gives a nice professional spin
              to the package.

=========================================================================

INSTRUCTIONS

=== Data Transfer ===

To transfer data from the scanner to the computer, type:

read92 myfile.spg

where "myfile" is the name you want for the file which will be created.
You need to have extension ".spg" (or ".SPG" - but it has to be either all
upper case or all lower case) for it to be in spg format.  (There are
non-spg formats for development and troubleshooting purposes.)  The program
will warn you if you are about to overwrite an existing file.

The default serial port is COM1.  If you're on COM2 or COM3, set that with
a second command line argument:

read92 myfile.spg /2

The transfer will take about 1:15 to 1:20.

To transfer data from the computer to the scanner, type:

load92 myfile.spg

with a /2 or /3 if you're on a different port.

Transfer will normally take between 1:20 and 1:30.

There is a parameter for load92 that can trade off speed and reliability.
This is set by the switch /snn where the s can be upper or lower case, and
nn is a number between 10 and 99.  The default value is 20.  Smaller values
will speed transfer, larger values will slow it.  Too small a value will
cause the transfer to fail, in which case the scanner will initialize.  The
fastest possible transfer speed is 1:15.

If you play with the /s switch, make sure you have already downloaded your
scanner's contents to the PC via read92.

=== File Conversion ===

To convert a SPG file to ASCII, type

spgasc myfile.spg myasciifile.asc

where "myfile.spg" is an existing SPG file (it must have the extension
.spg) and myasciifile.asc is the file to be created.  The name of the ASCII
file is arbitrary, but is is recommended that extension .ASC be used.

To convert an ASCII file to SPG, type

ascspg myasciifile.asc myfile.spg

The conversion programs will check to see if the specified input file
exists, but will not warn you if you are about to overwrite an existing
output file.  It will also stop if the input file type is spg; that's an
easy error to make.

=== File Editing ===

The magic is in being able to edit almost anything in the ASCII file.  You
do not, however, have to edit everything.  You don't even have to
understand everything in the file.  I don't.  Edit what you understand (and
need to edit!!)  and leave the rest alone.  One of my motivations for this
project was to be able to easily bring in blocks of frequencies and alpha
tags (but not much else) from various sources.  I know how to automate that
with text files, but not with a point-and-click-and-point-and-click-and...
program.

Editing requires a pure-ASCII text editor.  EDIT (remember that from DOS
5.0?) is still there in Windows 9x, and works.  Notepad and Wordpad also
work; just make sure to save as text, not as a word processing document.
Word processors (like Word) generally do not work for this: they stick in
formatting stuff.  See file "editors.txt" for pointers to other editors.

Now to begin...

Run read92 to create a spg file, then run spgasc to create an ASC file.
Take a quick look through the ASC file you have just created.

There are 13 sections, set off by dividers with ******.  They are:

o One for each bank
o Weather channels
o Preprogrammed bands
o Scanner settings

The bank headings also display the text tag for that bank, the bank type,
and the bank's mode.  These quanitities are non-editable repeats of
parameters that can be edited later.

spgasc currently produces a "verbose" format where the actual hex
data from the SPG file is shown, generally to the left of data you can
edit.  ascspg ignores that raw hex data, and works from the editable data
described below.

There are two general rules to follow when editing an ASC file.  First, do
not change the spacing of characters within a row.  spgasc expects to find
things in particular columns.  With two exceptions (search lockouts and
preprogrammed search bands, described later) do not add or remove any rows.
Second, all text items (alpha tags) are bracketed between > <.  That makes
it easy to identify what text can be changed, and delimits the number of
characters available.

Bank Sections

Each bank begins with a header line giving that bank's number, text tag,
type and open/closed mode.  Information in this line is not editable; the
tag, type and mode are copies of data that appear in editable fields later.

Data in the banks begin with a list of the 50 channels.  Channel number is
on the left.  This is followed by six "verbose mode" hex values.  Channel
data then follows.  Items in this row are:

o Alpha tag
o Frequency
o Mode: AM, FM, PL, DPL, LTR, MOT, or EDACS
o PL or DPL code.  A value of 0.0 means no code.
o Four setting flags: U for unused, D for delay on, A for attenuator on,
  and L for locked out.

You can change any of these parameters, as long as you stay within the
limits of the scanner, e.g., don't enter out of range frequencies.  All
modes and flags must be upper case.

Channel data are followed by two lines of search band data.  The
information to the left of the search alpha tag is verbose mode hex data.
The first line shows the alpha tag, search start frequency, mode, PL/DPL
code (if any) and flags, similar to channel data.  The second line shows
the search end frequency and search step.

This is followed by four lines of bank information.  There is verbose hex
data on the left.  The four lines of editable data are:

o Bank text tag
o Bank mode and (where applicable) offset.  When editing, only the "O" in
  Open or "C" in Closed matter, and only the first two digits of the
  frequency ("00" for no offset or N/A, "12" for 12.5, or "25" or "50")
  are significant.  You can retype the rest of the text for esthetic value,
  or convert to spg then back to asc to let the software clean things up.
o Bank type: Conv, LTR, MOT or EDACS.  This must be spelled exactly.
o Fleet map.  Enter the eight values in the two-digit positions after the
  S's.  If there is no fleet map, enter all 00's.

Search frequency data then follows.  This is one place where lines can be
inserted or deleted.

The search frequency block must begin with the line " Search lockouts:"
and end with the line " (end lockouts)" as shown.  In between are
sequentially numbered frequencies, begining with 1 and ending no higher
than 50.  The two hex bytes between the number and the frequency are
verbose data.

Search frequency lockouts must fall within the bank's search range.

The final item in the band section is a list of 100 talkgroup IDs.  The
talkgroup IDs are located between square brackets, and vary among the
different trunking systems.  The formats are:

EDACS:              [ nnn Skip  ] or [ nnn Scan  ]
Motorola Type 1:    [nnnn-n Skip]    [nnnn-n Scan]  (Size 01)
                    [nnn-nn Skip]    [nnn-nn Scan]  (Size 02-14)
Motorola Type 2:    [nnnnn Skip ]    [nnnnn Scan ]
LTR:                [nnnnnn Skip]    [nnnnnn Scan]

where "n" indicates a decimal digit for the ID value, and "Skip" or "Scan
indicates the scan status.  The ID and Skip/Scan must be in the exact
columns shown.  Skip/Scan is case sensitive and must be spelled as shown.

Motorola Type 1 IDs depend on the size code in the fleet map.  For size
code 1, the ID will be abbb-c, where a = block, bbb = fleet and c =
subfleet.  For size codes 2 through 14, the format is abb-cc.

Motorola code size 0 corresponds to Type 2.  Hybrid systems contain a mix
of Type 1 and Type 2.

If the ID code is zero (any system) then there is no code, and the ID will
be blank.  If the scan/skip status for an ID is "Skip", then "Skip" will
always appear in that ID's field, even if the ID itself is blank.


Weather Channels

This section contains the pre-programmed NOAA weather channels.  It looks
just like a 10-channel bank.  You can, in fact, replace the weather
channels with whatever you want.  You can program the three currently
unused channels.

You should keep some things in mind of you change these channels.  In
particular, you have virtually no control over these channels when the
radio is working.  You can't set delay or lockout, nor can you manually
select them:  the radio scans the bank when WX is pressed.  About all you
can do from the keypad is to switch the attenuator on or off.  To eliminate
any of these channels from the scan, you need to set U in the status flags
via this software.

There can, however, be circumstances where a small dedicated bank is
useful.  I use my scanner at auto races, and I can see the utility of
putting race control frequencies (flagman, safety trucks, etc. - usually a
half dozen or so) into this bank.  If anything happens, one button will put
me into that set.

Preprogrammed Search Bands

This is a list of up to 100 bands, numbered sequentially beginning at 0.
Each line has the sequence number, six "verbose mode" hex bytes, then the
band alpha tag, start frequency, mode, end frequency, and search step size.

You can edit entries or add or subtract to this list.  (This is the
other place where lines can be added or removed.)  Keep the numbering
sequential.  One blank line must appear after the final entry.  Follow the
rules in the manual (e.g., you cannot cross frequency ranges).

Opening Screen Message

This section is fairly obvious.  Keep the message between the >   <'s.  Use
only characters specified in the text entry instructions in the manual.

Scanner settings

Each parameter in this section has a description.

The leftmost group of data on each line is "verbose mode" hex data.  The
center group is fields you can edit.  To the right are the descriptions.
Formats must be followed exactly.  Note that several items must be entered
in hex.

You can adjust the backlight on time to as long as 255 seconds.  That is
expected to be a popular feature.  If you set the backlight on time to 0,
then once on the backlight will remain on until the scanner is turned off.

One parameter, the "Number of preprogrammed search bands" cannot be
changed.  The software will use a number corresponding to how many bands
are actually in the list, and ignore whatever is in this section.

There are four unknown bytes.  No clue as to the first, which is the first
byte in this section, nor the third and fourth.

The second unknown byte, which follows the trunk rescan delay time byte, is
thought to be related to the trunk rescan delay time, and should be set to
2.55 times the trunk rescan delay time byte.  You are, however, free to set
this to any value.

If you figure any of the uknowns out, let us know!

The priority channel's editable bytes are in the order bank, channel, e.g.
8 00 means Bank 8, Channel 00 (the default).  WX priority is specified as
Bank 10, e.g., 10 05 to set Weather 5 as priority.

The final two lines (Enabled scan banks and Active scan banks) have
10-character strings 0123456789 when all banks are active.  The only
meaningful edit allowed is to put "-" in place of any bank you want to be
disabled/inactive, or the corresponding digit for any bank you want to be
active.

=========================================================================

Troubleshooting

The most common problems (so far) have come from using an editor that mungs
the ASCII file, and from accidently using spgasc instead of ascspg or vice
versa.  Beginning with Version 1.03, spgasc will not run unless the input
file is type .spg, and ascspg will not run if the input file is type .spg.

Think of "spgasc" as being "spg-to-asc" and ascspg as "asc-to-spg".

Make sure your editor does pure ASCII, and does not insert any formatting
characters.  Notepad and Wordpad work.

Some Windows-centric editors have a tendency to append the file type
".txt", so you can wind up with "myfile.asc.txt".  That's OK.  Long file
names (up to 60 characters) are handled, and the ASCII file does not have
to be extension .asc.

Problems with either spgasc or ascspg are *never* due to the operating
system.  If something goes wrong with one of those, you do not have to
subject yourself to clean boot, safe mode, stop utilities, etc.

If ascspg crashes with an error message "forrtl:  severe (64):  input
conversion error..."  it means there is an error in the input ASC file.
Using the file compare utility "fc" between your original ASC file and the
trouble-making edited ASC file can help chase down the problem.

File type ".spg" is required for the spg files.  The software checks for
that.

The /snn switch in load92 addresses only two problems.  The first is if the
transfer is too slow for you.  In that case, experiment with smaller values
of nn until you get your system as fast as you want.

The second problem is when loading the scanner seems to go well, but
when the transfer finishes (all or almost all the progress squares are
filled in) things go wrong and the scanner initializes.  In that case, use
/snn and increase the value of nn.

Make sure you specify the corect serial port, and that the port is not
being used by another device.  Active Palm Pilot "Hot synch" software will
interfere with use of the port by the PRO-92.


=========================================================================

Batch File Suggestions

You may eventually get bored with running two programs to read, then two
programs to load, your scanner.  Consider writing a pair of BAT files:

read.bat, containing something like:

read92 %1.spg
spgasc %1.spg %1.asc

load.bat, containing something like:

ascspg %1.asc %1.spg
load92 %1.spg /s13

Entering "read plugh" will download the scanner into file plugh.spg, and
immediately convert it to plugh.asc.  After editing plugh.asc and saving it
under a different name (say plugha.asc), "load plugha" will convert it to
plugha.spg and immediately upload it to the scanner.  In this example,
switch /s13 is included because it speeds things up, and I've found it
works reliably on my system.

If you find yourself working with one file (or a handful of files) a lot,
you can build the file name into an appropriately-named batch file and
save a few more keystrokes.


=========================================================================

Guarantee and Support

There is no guarantee.  I'm not a lawyer, and can't afford one, but
visualize a disclaimer that a lawyer might have written.

There is no official support.  However, if you're having troubles, don't be
shy about e-mailing me for help.  Since I know exactly what the software is
supposed to do, I can usually figure out what's wrong pretty quickly.

=========================================================================

Copyright and Careware Notice

Copyright remains with the author - me.

This software is set forth as Careware.  If you feel it is worth something
to you, then make a donation to an appropriate charity - there are plenty
of those who can use the money.

This software may be freely distributed, provided no charge is made for its
distribution, and that it is not incorporated without permission into any
commercial package.
