This article is copyrighted (c) 1998 by Bill Cheek.  Permission to
reprint for FREE access and FREE use by others is automatically
granted so long as this entire article, including signature box at the
end are retained intact and unaltered.

           A TUTORIAL ON
THE CE-232 SCANNER/COMPUTER INTERFACE'S
  SCRIPT FEATURE AND LANGUAGE SUMMARY

INTRODUCTION
============
The CE-232 Scanner/Computer Interface is a 2.5" x 3" electronic board
that goes between an IBM-PC/compatible computer and a VHF-UHF scanning
receiver for a host of powerful capabilities.

The CE-232 is  a -smart- RS-232 Interface controller and data
acquisition system for some scanners and at least a drudgery-free
automatic programmer and remote controller for all supported scanners.

The CE-232 eliminates a lot of the drudgery and labor in scanning by
its  ability to "AutoProgram" up to 999 memory channels from a plain
ASCII text file in a short time, error-free and exactly the way you
want the scanner configured.

The CE-232 also allows REMOTE control of the scanner from the computer
keyboard; a strong +plus+ for handheld scanners and those with
hard-to- operate keyboards like the PRO-43, PRO-2035 and PRO-2042!

The CE-232 is a one-way controller and AutoProgrammer like described
above for MANY scanners, including the PRO-2042, PRO-2035, PRO-2022,
PRO-43, PRO-39, PRO-37, PRO-34, PRO-26, etc.

The CE-232 is a TWO-WAY controller, AutoProgrammer and data acquisition
system for the time-honored PRO-2004, PRO-2005, and PRO-2006 scanners
which have unique circuitry that allows the CE-232 to do MUCH more
than just AutoProgram and Remote Control, including AutoLog data on
"hits", AUTO-REJECT undesired signals, AUTO-LOOKUP data about a
certain frequency, AUTOMATED operations via a powerful Script function
and much more.


OVERVIEW OF THE SCRIPT FUNCTION
===============================

The CE-232 Script Feature and Language provide a means of automating a
huge array of scanner operations and program functions. A script
essentially automates FOR you what you would do by hand if you were
operating the scanner. But it can also do things that you wouldn't
think of in a moment of crisis or fumbling around for notes, tapes,
recorders, etc.  The things that you would do are logical in nature,
and dependent on a number of variables.  A Script can take those
variables into account and make same kinds of decisions and actions
that you would do (error-free and much faster!)  Where you might
fumble or panic, the Script will just do its thing.....

With a Script, you may at a specific time automatically reprogram the
memory channels, turn on and off the AutoLogger, switch from Search to
Scan, turn on and off a tape recorder, and perform a multitude of
other tasks, all the while you sleep, play, or work.  Also, various
utilities can be developed to perform routine tasks, as controlled by
the CE-232 and its software!

A Script is developed (written) with a SIMPLE text editor like NOTEPAD
or WORDPAD in Windows or EDIT.EXE in MS-DOS, to produce a plain ASCII
text file. Word processors have format and font codes that will cause
problems for the CE-232 Script Processor.  If you prefer to use a word
processor, be sure to save the file as a plain *.TXT file, except
instead of TXT, use the SCR extension to indicate a Script:

    e.g.  BIRDFIND.SCR

One of our favorite text editors for Script writing is QEDIT, a low
cost, but very powerful shareware editor from Semware Corporation. But
frankly, you can use anything that results in a plain ASCII text file.
Windows' NOTEPAD is perfect for scripts.  Here is an example of a very
simple Script.  I suppose you could write it with EDLIN.

=============================
/ chandump.scr
keyclr
msg1-      *** Turn squelch all the way down and press G to start
idle until key = g
chan = 1
manual
do
    autolog on
    idle until count = 7
    autolog off
    idle
    manual
loop until chan = 1
idle until key = h
end
==========================

We call this one the CHANNEL DUMP SCRIPT. It steps through the memory
channels, one at a time, and uses the AutoLogger to make a file of the
contents of each channel.

Don't worry if you don't understand it yet - the purpose of showing it
now is to convey the simplicity of the mechanics of writing a powerful
Script.  It's just a few lines of text saved as a <NAME.SCR> and
that's all there is to it.  Check it out again......

NOTE:  The Script feature of the CE-232 is expressly for the PRO-2004,
PRO-2005, and PRO-2006 scanners.  Depending on how a Script is
written, it may or may not work with other scanners.  For instance,
the AUTOPROGRAM command in a Script will work fine with all supported
scanners, whereas the AUTOLOG command works only with the PRO-2004/5/6
series. In general, if data has to first come FROM the scanner to meet
a Script requirement, then it will work ONLY with the PRO-2004/5/6.

If no data is required from the scanner, then chances are the Script
will work with any supported scanner.  The PRO-2004/5/6 scanners are
unique in that they can SEND data to the CE-232 as well as receive
commands and control from the CE-232.  Other scanners can only be
commanded and controlled (AutoProgrammed) by the CE-232 (still not bad.)


SCRIPT FEATURE DETAILS
======================

A Script consists of one or more COMMANDS arranged in a logical
sequence, modified by any necessary parameters or variables.  There
are about 40 valid Script COMMANDS and a limited number of parameters
and variables.  In other words, it's not difficult to learn Scripting
for the CE-232.

SCRIPT COMMANDS

Each command (with its parameters) must be on a separate line.  The
different parts (parameters) of each command must be separated with
spaces or tabs.  Command syntax is described using the following
conventions and symbology:

   COMMAND parameter [optional parameter] {choice1|choice2}

     COMMAND:  Upper-case indicates a word that is the command or part
               of command and must be correctly spelled.

     parameter:  Lower case letters are used to indicate parameters.
                 It is required unless enclosed in brackets.

     [optional parameters]:  Brackets indicate optional parameters or
                             command words.

     {choice1|choice2}:  Braces {} indicate choices (either/or, not
                         both). A choice is required unless it is
                         enclosed in brackets  ie: [{xx|xx}]  The pipe
                         "|" means "or" and separates the choices.

  Example:  AUTOLOG  [{ON|OFF}]

This example says that AUTOLOG can be used by itself, and when so, it
toggles the current condition.  If desired, the command word ON or OFF
may be used with it.  The pipe symbol "|" always means "or" in
computing.  Remember that.  So [{ON|OFF}] means "on -or- off". Not
both!  You would pick one or the other....or, neither, since the
brackets [] indicate the parameters are optional.  The AUTOLOG command
all by itself would turn it OFF if it was on, and ON, if it was off.
"Toggle" means change or switch states.

LABELS

Labels are used to identify (or mark) specific locations within a
Script. When a Script is first started the program searches the file
for labels and builds a table of their locations.  A large Script will
have a noticeable delay before starting while this is being done. A
maximum of 32 labels are allowed.  Labels are essential for the GOTO
and GOSUB commands.

The label must be on a line by itself and consist of a colon ":", a
space, and an alphameric or numeric name.

   Example:                          : labelname
                                      ^
	a single space must go here---^

COMMENTS

Comments (remarks) may be used within a Script as notes to the user
and are ignored and skipped by the program when they start with a
forward slash (/).  The slash should be separated from the text of the
comment with at least one space.

PARAMETERS

Most parameters will be described with their associated command further
below, however, two common parameters (filename and condition) are
explained now since they are used with a variety of commands.

   filename - This parameter can be just a filename in 8.3 format or a
              complete DOS path.

   condition - This parameter defines a condition to test and consists
               of three parts (item, operator, and value).  Commands
               using this parameter must make a decision about some
               condition.  The condition parameter uses the form
               "item - operator - value".  Valid entries are:

=========================================================
ITEM        OPERATOR below     VALUE and format
=======       =========        ==========================
                \|/
VALUE@x          |             x is a number, 0-9 (e.g, 4)
                 |
DATE             |             YYMMDD (eg: 970920)
                 |
TIME             |             HHMMSS (eg: 141000)
                 |
FREQ             |             freq#  (eg: 144.0125)
                 |
CHAN             |             channel# (eg: 215)
                 |
SQBREAK          |             Yes or No  (eg: YES)
                 |
INSW             |             Binary 6 bit value; 1,0,X
                 |             (eg: 100X1) -(where X = don't care)
                 |
INBYTE           |             Binary 8 bit values; 1,0,X
                 |             (eg: 111XX001) -(where X = don't care)
                 |
COUNT            |             number     (eg: 6 )
                 |                -(used only with IDLE command)
                 |
KEY              |             keyboard character or the word
                 |                PRESSED which means any
                 |                key has been pressed.
                 |                 -(case insensitive)-
                 |
                 |             -----------------------------
                 |             NOTE:
                 |             A variable (VALUE@0 - VALUE@9)
                 |             may be used for a value.
                \|/
                 |
              OPERATORS
              _________________________________
                 =    (equal to)
                 <>   (not equal to)
                 <=   (less than or equal to)
                 >=   (greater than or equal to)
                 <    (less than)
                 >    (greater than)

Note the six OPERATORS. An OPERATOR goes between an ITEM and a VALUE:

  e.g.   CHAN <= 220   or   FREQ > 220.0000  or  TIME = 120030 etc.


=====================================================================
SCRIPT COMMANDS - Detail description and usage summary
=====================================================================

1   AUTOLOG [=] [{ON|OFF}]

    Turns AutoLogger on or off.  If ON or OFF are not specified then
    the AutoLogger is toggled to the opposite state.

    Examples:  AUTOLOG = ON
               AUTOLOG  OFF
               AUTOLOG


2   AUTOPROGRAM [FILTER [=] x] [OPTION [=] y] filename

    Allows a Script to program the scanner from a file.  Parameter x
    above is the FILTER to use (up to 12 alphanumeric characters) and
    y is the AutoProgram OPTION (A,B,C,or D).   Any data not supplied
    on the command line will be asked for by the AutoProgram function.

    Examples:  AUTOPROGRAM FILTER = feds OPTION = C fedfreqs.apf
               AUTOPROGRAM fedfreqs.apf
               AUTOPROGRAM

    NOTE:  FILTER is the first field of an AutoProgrammer (*.APF)
    file (the field to the left of the first comma). Filters are a way
    of dividing a large frequency file into logical smaller groupings.
    For instance, say your frequency file had 1200 entries.  You might
    want to divide them up into three 400-channel groups.  You could
    use FEDS as the first filter; BUSN as the second filter; and AERO
    for the third filter.

    NOTE:  OPTION is the one of four choices from the <F4> AutoProgram
    pulldown menu on how to AutoProgram the scanner at that moment:

    +------------------------------------------------+
    |         *** AutoProgram Menu ***               |
    |  Program scanner from file ........... F4      |
    | ..Option A - use file's chan numbers.......... |
    | ..Option B - ignore file's chan numbers....... |
    | ->Option C - filter file & use chan numbers... |
    | ..Option D - filter file & ignore chan numbers |
    +------------------------------------------------+


3   CHAN [=] {y|VALUE@x}      -(where x is a number from 0 to 9)-

    This command switches to program mode and calls up the specified
    channel.  The scanner is left in program mode after command is
    complete.  The parameter y is the channel number desired.

    Examples:  CHAN = 205
               CHAN 12
               CHAN = VALUE@4     (variable - see VALUE@x command)


4   CHAIN filename

    This command terminates the Script and starts another Script. If
    the filename does not contain a path specification then the Script
    path from the path setup is searched for the file.

    Examples:  CHAIN  newscrpt.scr
               CHAIN  c:\ce-232\scr\newscrpt.scr


5   CLEAR    (alternate is CLR)

    This command presses the scanner CLEAR key;  no parameters for
    this command.


6   DELAY  [=]  [{ON|OFF}]

    Turns scanner's delay function on or off.  If ON or OFF is not
    specified then the current state is toggled to the opposite state.

    Examples:  DELAY  ON
               DELAY


7   DIRECT

    Pushes the scanner's DIRECT key.  There are no parameters
    associated with this command.


8   DO
    LOOP  [UNTIL  condition]

    This command allows controlled loops within the Script.  The
    Script statements following the DO are executed until the LOOP
    word is reached.  If there is a condition parameter following an
    UNTIL word, the condition is evaluated.  If the condition is true
    then the Script moves on to the next statement.  If the condition
    is false or if there is no condition to test (LOOP by itself) then
    the Script returns to the DO line and runs through the loop again.
    When a DO LOOP is encountered the return location is pushed on to
    a stack.  The size of the stack allows nesting DO LOOPs 32 levels
    deep.  The GOSUB command uses the same return stack and is a part
    of the 32 level limitation if contained within the nested loops.
    Labels use a separate table of locations and do not affect the
    return stack.

    Example:  DO
                 :
                 :
                 (block of Script code goes here)
                 :
                 :
                 LOOP UNTIL CHAN = 400


9   END

    This command terminates the Script.  There are no parameters
    associated with this command.  An END is not required at the end
    of the Script but this command allows the Script to be terminated
    within the Script based upon some event.


10  ENTER

    Pushes the scanner's enter key.  No parameters are associated with
    this key.


11  FREQ [=] {y|VALUE@x}        -(where x is a number from 0 to 9)-

    This command switches to program mode and enters specified
    frequency.  Scanner is left in program mode after command is
    complete.  The parameter x is the frequency desired.

    Examples:  FREQ = 169.75
               FREQ 89.5
               FREQ = VALUE@3     (variable - see VALUE@x command)


12  GOTO label

    The Script will jump to the location specified by the labelname
    and continue with the next statement following the label.


13  GOSUB label
    RETURN

    Subroutines can be used in a Script.  This command functions
    identical to the GOTO command except that the Script will return
    to the line following the GOSUB statement when the RETURN command
    word is encountered.  This command uses the same return stack as
    the DO LOOP. See the DO .  LOOP command for a discussion of the
    return stack.

    Example:  GOSUB labelname
              ....next block of Script (whatever...)
              : labelname  (remember the space after the colon!)
              ....block of Script code
              RETURN


14  IDLE [UNTIL condition]

    This command suspends Script processing until some condition is
    met.  IDLE by itself (ie; with no other parameters) will suspend
    the Script for one update cycle.  If a Script turns the AutoLogger
    on then back off, an idle command using a condition of COUNT = 6
    is required since squelch break must be present for at least 5
    update cycles before it will consider the signal valid.

    NOTE: The COUNT item should only be used with the IDLE command.
    COUNT represents a desired number of update cycles.  Using it with
    other commands requiring a condition parameter will have
    unpredictable and probably peculiar results.

    Examples:  IDLE UNTIL KEY = PRESSED
               IDLE UNTIL COUNT = 6
               IDLE UNTIL KEY = G
               IDLE UNTIL TIME = 163000


15  IF condition [THEN]     (IF....THEN....ELSE....ENDIF)

    These commands allow for logical decision structures.

    IF some condition is true THEN a block of commands will be run
    ELSE another block of commands will be run.  Since a return
    location is not required, there is no limit on nesting IFTHEN's
    within IFTHEN's.

    Examples:  IF condition [THEN]
               .... block of Script code
               [ELSE]
               .... optional block of Script code if else is used.
               ENDIF


16  INPUT@x  [prompt message]   -(where x is a number from 0 to 9)-

    This command prompts the user for an input by popping up a dialog
    box.  A prompt message will be displayed if provided.  The entered
    data is stored in the corresponding variable (VALUE@0 thru
    VALUE@9).  See the VALUE@x command for a discussion of variables.

    Examples:  INPUT@0  Enter starting channel
               INPUT@1  Now enter the ending channel
               INPUT@7


17  KEYCLR

    Clears the last key buffer.  When a key is pressed, it remains in
    a last key buffer until another key press replaces it or it is
    cleared with this command. It is wise to start Scripts with this
    command to ensure no extraneous keypresses are lurking.

    Example:  DO
                 KEYCLR                     / clears last key otherwise
                 IDLE UNTIL KEY = PRESSED   / the Script will continue
                 IF KEY = G THEN            / cycling through the loop
                 .... block of Script code  / based on the last key
                 ENDIF                      / pressed.
                 IF KEY = U THEN
                 .... block of Script code
                 ENDIF
               LOOP UNTIL KEY = J


18  LIMIT

    Pushes the scanner's limit key.  No parameters are associated with
    this command.


19  LOCK-OUT [=] [{ON|OFF}]     (alternate spelling: LOCKOUT)

    Turns scanner's lockout function on or off.  Without parameters it
    toggles the lock-out state to the opposite state.

    Examples:  LOCK-OUT = ON
               LOCKOUT OFF
               LOCK-OUT


20  MANUAL     (alternate word:  MAN)

    Presses the scanner's manual key.  No parameters are associated
    with this command.


21  MODE [=] [{nfm|wfm|am|VALUE@x}]  -(where x is a number from 0 to 9)-

    Selects specified receive mode.  Without parameters this command
    cycles to the next receive mode (pushes scanner's mode key).

    Examples:  MODE = nfm
               MODE am
               MODE = VALUE@7      (variable - see VALUE@x command)
               MODE

    Note:  MODE values are case-sensitive (use lower case only!)


22  MONITOR

    Presses the scanner's monitor key.  No parameters are associated
    with this command.


23  MSGx-  Script message to display
                          -(where x is a line number from 1 to 9)-

    This command allows the Script to display a message of up to 80
    characters on the line 1 thru 9 of the Script Msg Screen (replace
    x with line number).  MSGx- without a message following it will
    clear the screen.  Any variables (VALUE@x) within the msg text
    will be replaced by the value of the variable.

    Examples:  MSG1- This message would be displayed
               MSG2- on the Script Msg Screen
               MSG1- This message replaces the previous line 1 message.
               MSG6- The frequency is VALUE@3 MHz.


24  OUTBYTE [=] {binary number|VALUE@x}
                             -(where x is a number from 0 to 9)-

    Sends an eight bit value out the hardware outbyte port.  An X in
    the binary number will result in that bit position remaining in
    the same state as previously sent.

    Example:  OUTBYTE 11X0X001
                   \-----> an 8 bit binary number.
                           1 = on   0 = off  X = don't care

              OUTBYTE = VALUE@9   (variable - see VALUE@x command)

    NOTE:  The eight OUTBYTE ports of the CE-232 are at Points SS-ZZ
    on the CE-232 board.  These ports are simply software controlled
    logic level outputs of either 0-volts or +5 volts.  The Script's
    OUTBYTE command controls the voltage at these eight ports.  For
    example, the command OUTBYTE = 00000000  sets all eight ports to
    0 volts (logic low).  Conversely, OUTBYTE = 11111111 sets all 8
    ports to +5v (logic high).  OUTBYTE = 00000001 sets Port 0 to +5v
    and Ports 1-7 to 0 volts.  OUTBYTE = 10101010 sets even Ports 0-4
    to 0 volts and odd Ports 1-7 to +5v. OUTBYTE = 1XXXXXXX doesn't
    change the settings of Ports 0-6, but sets Port 7 to high (+5v).

    Like the User Switches (OUTSW) described below, the OUTBYTEs can
    be used to turn things on and off, but only at CMOS logic lovels.
    The OUTBYTEs are not actually switches and they are not a power
    supply; they are logic level bits that are available for the User
    to apply for his own purposes, an example of which would be the
    address Blocks of Extended Memory Mods.  The OUTBYTEs can also
    control transistor or solid state switches that CAN be used to
    switch heavier loads, including power supplies.

    The OUTBYTEs have no keyboard control; they are operable solely
    through the Script command described above.


25  OUTSW [=] {binary number|VALUE@x}  -(where x is a number from 0 to 9)-

    Also see the SWx command below.

    Opens and/or closes the CMOS User Switches (SW1 thru SW4) but
    allows one command to control all four switches at once.  An X in
    any bit position(s) leaves that associated switch(es) in its
    existing state. The four User Switches are at Points AA-DD on the
    CE-232 board.

    Example:  OUTSW 11X0
                \-----> a 4 bit binary number
                          1 = on   0 = off  X = don't care
                          msb is sw4    lsb is sw1

              OUTSW = VALUE@5   (variable - see VALUE@x command)

    NOTE: The CE-232 has one unallocated 4066 CMOS Quad Bilateral IC
    switch for whatever purpose the Use might conceive. Basically, it's
    a bank of four SPST switches that can be controlled from the PC
    keyboard or by means of a Script command as shown above. Like any
    switch, the User Switches (OUTSW) can be used to turn things on
    and off.  The primary intent is to offer the User a way to turn
    other modifications on and off.  The User switches can be used,
    for example, to control the Blocks of an Extended Memory mod, or
    to turn a tape recorder on and off.  Possibilities are endless!


26  PAUSE [=] [{seconds|VALUE@x}]   -(where x is a number from 0 to 9)-

    This commands simply pauses.  All program activity stops for the
    specified number of seconds.  If no parameters are used then a
    default value of one second is used.  The seconds parameter must
    be whole seconds.  Fractional seconds are not allowed.

    Examples:  PAUSE = 20
               PAUSE 10
               PAUSE = VALUE@8    (variable - see VALUE@x command)


27  PRIORITY [=] [{ON|OFF}]     (alternate word: PRI)

    Turns scanner's priority function on or off.  Without parameters
    this command just presses the scanner's priority key.

    Examples:  PRIORITY = ON
               PRIORITY OFF


28  PROGRAM       (alternate word: PRGM)

    Presses the scanner's program key.  No parameters are associated
    with this command.


29  REJECT {ON|OFF|ADD|CLEAR|ERASE|LOAD [filename]|SAVE [filename]}

    Allows the Script to work with the Reject function.  If a filename
    is not specified for the LOAD or SAVE versions of the command,
    then the reject function will ask for it.

    Examples:  REJECT ON
	       REJECT OFF
	       REJECT ADD          / add current freq to Reject List
	       REJECT CLEAR        / clear last item from list
	       REJECT ERASE        / erase entire list
	       REJECT LOAD  birdlist.rej  / load Reject List from file
	       REJECT SAVE  newbirds.rej  / save Reject List to a file


30  RESET

    Presses the scanner's reset key.  No parameters are associated
    with this command.


31  REVIEW

    Presses the scanner's lock-out review key.  No parameters are
    associated with this command.


32  SCAN

    Presses the scanner's scan key.  No parameters are associated with
    this command.


33  SEARCH  [=]  [{UP|DOWN}]

    Selects the specified search mode.  Without parameters the command
    defaults to pressing the scanners's search up key.

    Examples:  SEARCH = UP
               SEARCH DOWN
               SEARCH


34  SHELL  filename

    The Script may launch another program with this command.  The
    CE-232 program remains in memory and resumes where it left off
    when the external program is terminated.

    Examples:  SHELL myeditor.exe
               SHELL  c:\tools\database.exe


35  SPEED          (alternate word: SPD)

    Presses the scanner's speed key.  No parameters are associated
    with this command.


36  STEP [=] [{12.5|50|5|VALUE@x}]  -(where x is a number from 0 to 9)-

    Selects specified step size in Search mode.  Without parameters
    the scanner's step key is pressed.

    Examples:  STEP = 12.5
               STEP = 50
               STEP = 5
               STEP


37  SWx  [=]  {ON|OFF}        -(where x is a number from 1 to 4)-

    Also see the OUTSW command above.

    The User Switch specified by x is turned on or off.  The ON or OFF
    word must be used otherwise the command is ignored. This command
    is related to the OUTSW command, except that it controls only the
    specified User Switch (x).  OUTSW can control all four with a
    single command.

	Examples:	SW1 = ON
			SW2 OFF


38  VALUE@x [=] {param1 | param1 {+|-} param2}
                                    -(where x is a number from 0 to 9)-

    Ten variables (VALUE@0 thru VALUE@9) are available for use in
    Scripts.  Addition and subtraction can be used with these
    variables when the variable word appears as a command.  In other
    words, you can not do addition or subtraction of variables within
    a condition parameter, only when VALUE@x appears on a line unto
    itself (see examples below).  The value of a variable can be
    anything (number, text, etc.) but should be related to its
    intended use.  Trying to add a date to a frequency doesn't make
    much sense.  Parameters must be chosen from the following lists:

    param1:  FREQ (uses scanner's current frequency)
             CHAN (uses scanner's current channel)
             DATE (uses current date)
             TIME (uses current time)
          VALUE@x (uses value in VALUE@x)
           number (uses specified number)
             text (uses first word of specified text)

    param2:  VALUE@x  (uses value in VALUE@x)
              number  (uses specified number)

    Note: The INPUT@x command can accept a multiple word text entry.
    That entry is stored in the appropriate VALUE@x variable.  Using
    that variable in a MSGx- command will result in the entire entry
    being displayed.  However, the VALUE@x command will not assign a
    multiple word entry following it to a variable.  This command will
    transfer it to another variable (ie; VALUE@4 = VALUE@2).  Also,
    addition and subtraction on text values is meaningless.

    Examples:  VALUE@0 = 125.5
               VALUE@9 = VALUE@0 - VALUE@6
               VALUE@0 = FREQ + 2.5   (The value of the current frequency
                                       plus 2.5 Mhz is stored in VALUE@0.)
               VALUE@0 = VALUE@0 + 1  (The value in VALUE@0 is increased
                                       by one.)
               VALUE@8 = 125.355      (125.355 is stored in VALUE@8)


39  INDIVIDUAL KEY COMMANDS:

    Specific single character scanner keys can be used from the Script
    (ie; P for Program, M for Manual, T for Step, O for Mode, etc.)


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

SCRIPT COMMAND SUMMARY - QUICK REFERENCE

Command Name  Syntax & Form
============  =============
AUTOLOG       AUTOLOG  [=]  [{ON|OFF}]
AUTOPROGRAM   AUTOPROGRAM  [FILTER [=] x] [OPTION [=] y] filename
CHAN          CHAN [=] {y|VALUE@x}                      ( x is 0 to 9)
CHAIN         CHAIN filename
CLEAR         CLEAR                               (alternate form CLR)
DELAY         DELAY  [=]  [{ON|OFF}]
DIRECT        DIRECT
DO            DO
  LOOP	      LOOP  [UNTIL  condition]
END           END
ENTER         ENTER
FREQ          FREQ [=] {y|VALUE@x}                      ( x is 0 to 9)
GOTO          GOTO label
GOSUB         GOSUB label
  RETURN      RETURN                                 (from subroutine)
IDLE          IDLE [UNTIL condition]
IF [THEN]     IF condition [THEN]
              .... block of Script code (do something)
ELSE          [ELSE]
              .... optional Script code if ELSE is used (do something).
ENDIF         ENDIF
INPUT@x       INPUT@x  [prompt message]           ( where x is 0 to 9)
KEYCLR        KEYCLR
LIMIT         LIMIT
LOCK-OUT      LOCK-OUT [=] [{ON|OFF}]    (alternate spelling: LOCKOUT)
MANUAL        MANUAL                            (alternate word:  MAN)
MODE          MODE [=] [{nfm|wfm|am|VALUE@x}]          ( x is num 0-9)
MONITOR	      MONITOR
MSGx-	      MSGx-  Script message to display -( x is line number 1 to 9)
OUTBYTE	      OUTBYTE [=] {binary number|VALUE@x}       ( x is 0 to 9)
OUTSW	      OUTSW [=] {binary number|VALUE@x}         ( x is 0 to 9)
PAUSE         PAUSE [=] [{seconds|VALUE@x}]        (where x is 0 to 9)
PRIORITY      PRIORITY [=] [{ON|OFF}]            (alternate word: PRI)
PROGRAM       PROGRAM                           (alternate word: PRGM)
REJECT        REJECT {ON|OFF|ADD|CLEAR|ERASE|LOAD [filename]|SAVE [filename]}
RESET         RESET
REVIEW        REVIEW
SCAN          SCAN
SEARCH        SEARCH [=] [{UP|DOWN}]
SHELL         SHELL filename
SPEED         SPEED                              (alternate word: SPD)
STEP          STEP [=] [{12.5|50|5|VALUE@x}]            ( x is 0 to 9)
SWx           SWx  [=]  {ON|OFF}                        ( x is 1 to 4)
VALUE@x       VALUE@x [=] {param1 | param1 {+|-} param2}    (x is 0-9)

INDIVIDUAL KEY COMMANDS:  Specific single character scanner keys can
be used from the Script (ie; P for Program, M for Manual, T for Step,
O for Mode, etc.  See BELOW.)


SCRIPT CODES FOR KEYPRESSES
===========================

Keyboard      Short, Long, or alternate
Command       Script Command Codes
============  =========================
Manual        M  Manual  or  Man
Priority !    !  Priority  or  Pri
Limit         I  Limit
Scan          S  Scan
Speed         E  Speed or Spd
Delay         D  Delay
Mode          O  Mode
LockOut       L  Lock-Out or Lockout
Step          T  Step
Direct  *     *  Direct
Clear/Bkspc   CLR Clear
L/O Rvw       V  Review
Reset         R  Reset
Monitor spc   _  Monitor
Program       P  Program or PRGM
.             .  (decimal point)
1             1
2             2
3             3
4             4
5             5
6             6
7             7
8             8
9             9
0             0
^             SEARCH UP
v             SEARCH DOWN
Enter         ENTER


======================================================================
A FUNCTIONAL  SCRIPT - Finds And AutoLogs All "Birdies" In The Scanner
======================================================================

Here is a CE-232 Script that is dissected and explained at each step.  Its
purpose is to identify all "birdies" in your scanner and log them to a
file.  A few subsequent manual steps makes a CE-232 AutoReject file
that will prevent your scanner (PRO-2004, PRO-2005, or PRO-2006 only)
from locking up or stopping on "birdies".

This next section below is 117-chars wide and may not appear "right"
until you copy it to a word processor or text editor that can keep
from wrapping wide text.  NOTEPAD will do that.  The left side is a
comment section, line by line, for the actual script commands in the
right side.

                                     COMMENTS | THE ACTUAL SCRIPT CODE
==============================================|======================================================================
Remark: Forward slash (/), space and filename | / BIRDFIND.SCR
  Clears keyboard buffer - always recommended | keyclr
                           Displays text line | msg1- This script can be used to find and make a log file of all the
                              "        "    " | msg2- "birdies" that exist in your scanner.  The process takes about
                              "        "    " | msg3- 60-90 minutes, depending on computer speed and scanner speed.
                              "        "    " | msg4- Short out the antenna terminals so no signals can be picked up
                              "        "    " | msg5- and set the ATT switch to -10 dB. Set SEARCH LIMITS of 25 MHz &
                              "        "    " | msg6- 1300 MHz with a SEARCH ready to start upwards from 25 MHz.  Put
                              "        "    " | msg7- in the MANUAL mode before starting this script. Set the SQUELCH
                              "        "    " | msg8- so that no sounds come in and get READY!
                              "        "    " | msg9-               ***** Press G to start this script ******
NOTE 1:--\                                    | /
    Idles script until the "G" key is pressed | idle until key = g
  Clears keyboard buffer - always recommended | keyclr
                     Scanner:  MANUAL command | Man
                    Scanner:  PROGRAM command | prgm
                      Scanner:  LIMIT command | limit
                    Enters 9 into the display | 9
       Scanner:  LIMIT command selects Bank 9 | limit
              Types 1299.950 as the LOW limit | freq = 1299.950
                   Scanner: Presses ENTER key | enter
                      Scanner:  LIMIT command | limit
              Types 1300.00 as the HIGH limit | freq = 1300.00
                   Scanner: Presses ENTER key | enter
                  Scanner:  SEARCH UP command | search = up
    Scanner: MANUAL command stops SEARCH mode | Man
                    Scanner:  PROGRAM command | Prgm
                      Scanner:  LIMIT command | limit
                    Enters 9 into the display | 9
       Scanner:  LIMIT command selects Bank 9 | limit
                  Types 25.0 as the LOW limit | freq = 25.0
                   Scanner: Presses ENTER key | enter
                      Scanner:  LIMIT command | limit
              Types 1300.00 as the HIGH limit | freq = 1300.00
                   Scanner: Presses ENTER key | enter
                Scanner:  SEARCH DOWN command | search = down
    Scanner: MANUAL command stops SEARCH mode | Man
  Clears keyboard buffer - always recommended | keyclr
NOTE 1:--/                                    | /
                           Displays text line | msg1-
                              "        "    " | msg2-            +----------------------------------------+
                              "        "    " | msg3-            |    BIRDIE-FINDER SCRIPT RUNNING NOW !  |
                              "        "    " | msg4-            +----------------------------------------+
                              "        "    " | msg5-
                              "        "    " | msg6-          Stop script by pressing CTRL+A at any time
                              "        "    " | msg7-
                              "        "    " | msg8-      ....or, stop it after SEARCH has cycled past 1300 MHz....
                              "        "    " | msg9-
             Script command: starts a DO Loop | do
                  Scanner:  SEARCH UP command |    search = up
     Pauses script until SQUELCH breaks, then |    idle until sqbreak = yes
          Script command: turns AutoLogger On |    autolog on
 AutoLogs scanner display; idles for a moment |    idle until count = 8
         Script command: turns AutoLogger Off |    autolog off
  Script Loops back to the DO line just above | loop
          Script runs indefinitely until User |
                      intervenes and stops it |
=====================================================================================================================

NOTE 1:  The script lines between the above  NOTE 1:--\ and NOTE 1:--/
annotations serve to prepare the scanner for a thorough SEARCH of
25-1300 MHz by cancelling anything you may have already had programmed
in Limit Search Bank 9.  To log ALL birdies, it is essential that the
Birdie Search begin at one end of the spectrum and run continuously to
the other end. Therefore, this routine ensures it by first narrowing
the Search range and then expanding it.  Otherwise, there is no
assurance that SEARCH would begin at 25.000 MHz.  When completed, you
will have two or three AutoLog files that cover the Search period.
Each AutoLog file is one-hour. Everything logged will be a "birdie",
and so the next step is to edit the Log files, first by merging them
into a single file....then edit out everything except the actual
frequencies.

Let the below excerpt from an AutoLog file suffice for an example:

 , 67,  47.5000,nfm,D, ,Man ,    ,930902,221114,000000
 ,  3,  49.8300,nfm,D,L,Man ,    ,930902,221048,000000
 , 21,  95.7000,wfm,D, ,Man ,    ,930902,221055,000000
 , 15,  97.3000,wfm,D,L,Man ,    ,930902,221053,000000
 , 69, 121.5000, am,D, ,Man ,    ,930902,221115,000000
 , 72, 122.9250, am,D, ,Man ,    ,930902,221116,000000
 , 73, 123.1000, am,D, ,Man ,    ,930902,221117,000000
 , 74, 148.1500,nfm,D, ,Man ,    ,930902,221117,000000
 ,  9, 150.5700,nfm,D, ,Man ,    ,930902,221050,000000

The idea is to prepare an AutoReject file based on the scanner's birdies
for starters.  See pages 65 and 70 in the CE-232 Manual and the <F1>
on-line help for information on the REJECT feature and REJECT files.  In a
word, a REJECT file consists of only frequency information, one frequency
to a line, four decimal places with no stray spaces and no leading zeroes
or leading spaces.

You would then use your text editor to edit out everything except the
column of frequencies, an example using the above AutoLog file for which is
shown below:

47.5000
49.8300
95.7000
97.3000
121.5000
122.9250
123.1000
148.1500
150.5700

The above, then, constitutes a valid REJECT (*.REJ) file.  As you can see,
a script makes quick work of identifying and logging all your "birdies".
In closing, you will want to identify only "birdies" and not actual
signals, so be sure to short out the antenna connector on the back of the
scanner with a piece of wire inserted into the center contact and then
wrapped around the shell of the BNC connector.  You might then also wrap a
piece of aluminum foil over the BNC connector for further reduction of
signal entry.  Last, but not least, set the ATT switch to the -10 dB
position and adjust the SQUELCH so that the static is just silenced and
then a little bit more. Turn SOUND SQUELCH off, too.  Run the BIRDFIND.SCR
script when ready and allow 1-2 hours for the complete search.

OTHER EXAMPLE SCRIPTS

In addition to the BIRDFIND.SCR, there are over 50 other Scripts on
the CE-232 Program Disk, some just for demonstration, but plenty more
that do useful work.  You may never have to write your own, if you
sort through what's already there in the \CE-232\SCR  directory. Some
of the better and more powerful scripts included are those written by
Ian Webb and Scott Sikes.  Check out WEBBMNUA.SCR, WEBBMNUB.SCR,  and
SYKES.SCR for some prize-winning examples.  There are plenty of
others, too, so get to work!  Your primary tool in the learning phase
will be a good text viewer (LIST, XTREE GOLD, Norton Utilities, etc)
and a good text editor, (QEDIT, MS-DOS EDIT.COM, NotePad, WordPad,
etc).

DEVELOPING/WRITING A SCRIPT
===========================

Easy.  First open a blank file with the text editor of your choice. On
the first line of the file, type a forward slash, a space, and a
filename in the conventional 8.3 DOS format.  Next, type KEYCLR on the
second line.  Here's what we've got so far:

   / AutLogLk.scr  By Bill Cheek, San Diego, CA November 24. 1994
   KEYCLR

Okay so far?  Now let's set the scanner to Channel 1; start the
AutoLogger; and put the scanner into the SCAN mode:

   chan = 1
   autolog = on
   scan

Still okay?  Now, once the scanner starts scanning, life is boring
until something happens.  What can happen?  About the only thing of
significance I can think of is that the scanner will eventually detect
a signal and stop.  So the idea is to put the Script into a "wait"
mode until that "something" happens, as indicated by a Squelch break.
Once there is a Squelch break, we want the Script to do something, so
let's make it idle for enough counts that the signal gets AutoLogged,
then LockOut that channel and send the receiver on scanning again.  A
DO - LOOP is in order for this operation since there are apt to be
many stops over the course of time.

   do
      idle until sqbreak = yes
      idle until count = 16
      lockout
      loop
   end

That's it for a simple but potentially useful script. The result will
be by the time you return that all active channels will have been
locked out...and inactive ones will still be scanning. By the way,
CTRL+A aborts any running Script. Here is the entire Script:

/ AutLogLk.scr  By Bill Cheek, San Diego, CA November 24. 1994
KEYCLR
chan = 1
autolog = on
scan
do
   idle until sqbreak = yes
   idle until count = 16
   lockout
   loop
end

Save this file as AUTLOGLK.SCR and you're in business.



INCORPORATE "AND" AND "OR" LOGIC INTO YOUR CE-232 AND HB-232 SCRIPTS!
=====================================================================

It occurs to me that there is no AND / OR logic built into the CE-232
Script feature.  Or is there?  The following is one method of
incorporating intelligent decision-making with AND and OR logical
operators.  Follow with me as I set an example of each:

AND LOGIC
=========

 - Desired, but NOT possible Script statement:

     IF FREQ = 158.970 AND CHAN = 43 THEN
             :
             :
             (do something; doesn't matter what for this example)
             :
             :
     ENDIF

====

 + Ok, it would be nice to do the above, but the below does the same thing!

     IF FREQ = 158.970 THEN
        IF CHAN = 43 THEN
                :
                :
                (do something; doesn't matter what for this example)
                :
                :
        ENDIF
     ENDIF

Voila!  Very useful AND logic!  Now then...............



OR LOGIC
========

 - Desired, but not possible Script statement:

     IF FREQ = 158.970 OR CHAN = 43 THEN
             .
             (do something; doesn't matter what for this example)
             .
     ENDIF

====

 + Ok, it would be nice to do the above, but the below does the same thing:


     IF FREQ = 158.970 THEN
        GOTO labelname
     ENDIF
     IF CHAN = 43 THEN
     : labelname
               .
               (do something; doesn't matter what for this example)
               .
     ENDIF


And there you have it:  AND and OR logic for your CE-232 Scripts.


SCRIPT LIMITATIONS
==================

Scripts are a piece of cake for people who have a clue about
programing. They are not particularly intuitive and we do not support
them in the sense of "going the mile" to help others write Scripts,
nor to help debug faulty ones.

When you buy a computer, programming skill and helps do not come with
it in the price.  Likewise, we do not sell scripting skills nor even
support on scripts with the CE-232.  The feature IS there, however,
for those who are capable of taking advantage of it, or for those who
want to learn and master the art.

Script file size is not a problem (only one line at a time is read and
processed). GOTO's and/or GOSUB's to distant positions within the file
will take additional time to reach but shouldn't be a major problem,
especially on modern computers. Large files will require additional
time to prescreen for labels when the script is first started.

The Script Feature is primarily useful for only the PRO-2004/5/6
scanners. It may or may not work with any others, and in any case, we
do not contractually support the feature.  It's a gift. This tutorial,
the CE-232 Manual, and the Scripts included on the Program Disk and at
our FTP site are the extent of formal support we provide for Scripts.
We may or may not provide unofficial support via e-mail.  If you are
hopelessly bogged down in a Script, I guess you can try us in e-mail.

You can download sample and example Scripts from our FTP site at:

ftp.204.210.11.126   in the \pub\interfaces\scripts  directory.


SUMMARY AND CONCLUSION
======================

Scripts allow the user to automate a host of scanner operations from a
plain text file.

Press F5 to popup the Script Menu. Available selections are:

    +------------------------------+
    |   *** Script Menu ***        |
    |  run Script file ........F5  |
    |  Abort script .......Ctrl+A  |
    |  Pause/continue .....Ctrl+P  |
    |  Option: view script line    |
    +------------------------------+


    run Script file:  This item actually starts a script running after
                      asking the user to select the filename.

       Abort script:  Terminates a script in progress.

     Pause/continue:  Pauses a script while it is running. The script
                      may be continued by reselecting this item.

Option view script line:  This option, if enabled, causes the
                          currently executing script line to be
                          displayed at the bottom of the screen. This
                          is useful for debugging scripts.

NOTE: Commonly used scripts can be added to the script section of the
CE-232 Tools menu via the <F6> setup utility. The script may then be
activated without having to go through the file selection process.


------------------------------------------------        --
Bill Cheek - President/CEO/Publisher            \      /
COMMtronics Engineering/World Scanner Report     \    /
Box 262478 ~ San Diego ~ CA ~ 92196-2478          \  /
Voice: 619-578-9247 (1:30-5:30pm, PST, weekdays    \/
  Fax: 619-578-9247 (any time)                     /\
E-mail:  bcheek@cts.com                           /  \
ftp://ftp.cts.com/pub/bcheek                     /    \
http://ourworld.compuserve.com/homepages/bcheek /      \
------------------------------------------------        --

Copyright (c) 1998 by Bill Cheek, December 6, 1998
=====================[End of Article]===============================

