

                                  FBAT program                
                                  05/01/97 -med

        The files included are:

             FBAT.TXT    - This file 
             FBAT.EXE    - FBAT program file (a 16 bit MSDOS program)
             FBAT32.EXE  - 32 bit version of FBAT for Windows
             SETUP.BAT   - Batch file to setup a 6500 or FP40
             LABEL.BAT   - Batch file to send a label
             LABEL.TXT   - Sample label file  
             CONVERT.EXE - Curve data conversion program
             CONVERT.TXT - Documentation for CONVERT program 
             LDECODE.EXE - Label data conversion program
             LDECODE.TXT - Documentation for LDECODE program 
              
             FBAT.PAK   - Sources, archived, contains the following:
               FBAT.PAS     - source to MSDOS FBAT program 
               FBAT32.DPR   - source to 32 bit FBAT32 program
               FBAT32.RES   - 32 bit version resource file
               FSUNIT.PAS   - Source to FBAT common interface unit
               FCUNIT.PAS   - Source to FBAT communication unit
               FRYEREGS.INC - Register definitions
               CONVERT.PAS  - Source to CONVERT.EXE
               LDECODE.PAS  - Source to LDECODE.EXE

               (Use UNPACK.EXE to unpack the sources from the archive.)

        16 Bit Version:

        To run the FBAT.EXE program, you will also need the file 
        FRYERS.COM. The FRYERS.COM driver must be installed prior to 
        using a program that uses it to talk to the Frye Electronics 
        instrumentation.  See the Fryers documentation for further 
        information on the usage of the FRYERS.COM driver.

        32 Bit Version:

        To run the FBAT32.EXE program, you will also need the file 
        FRYERS32.DLL. The FRYERS32.DLL driver must be either in the same 
        directory as the FBAT32 program, or in the Windows main 
        directory. See the Fryers documentation for further information 
        on the usage of the FRYERS32.DLL driver.

        Note: CONVERT.EXE and LDECODE.EXE are MSDOS programs, but they 
        will run as is in any version of Windows since they do not need 
        to access hardware directly.

        The main purpose of the FBAT32 program is to provide backwards 
        compatibility for old programs that used the FBAT control method. 
        We recommend that you use the FRYERS32.DLL in Windows95 or 
        WindowsNT where possible because the FBAT32 program is slow. This 
        is due to Windows which can take from 0.25 to 1.0 seconds to run 
        a FBAT command (caused by attaching and detaching the COM port).


                                        1


        Program Usage:

        The FBAT program is provided as a sample program using the RS232 
        communications between a Frye Instrument and the PC to control a 
        Fonix 6500 or FP40 instrument. The FBAT program will send one 
        command to the instrument from the MSDOS command prompt. It can 
        be used with a MSDOS batch file to send multiple commands for an 
        extended setup or control operation.

        Note that the FBAT program is designed for use with all 
        instruments in all possible modes of operation. Some RS232 
        commands may not be available on all instruments or in a specific 
        mode on the instrument. For more information on the commands 
        available and their use with specific Frye instruments, refer to 
        Fryers and FIPP documentation, and the related appendix for your 
        instrument.

        Large data arrays such as a label or curve frame can be sent to 
        the instrument from a file rather than entering the data on a 
        command line. File names must start with a letter. Numbers are 
        assumed to be an immediate data value.

        Requirements:

        The FBAT program requires an IBM PC or compatible computer. You 
        will also need a serial port assigned to COM1, COM2, COM3, or 
        COM4.  The FBAT32 program requires Windows 95 or Windows NT. 

        To run the FBAT program on a 16 bit MSDOS computer:

        1. Connect the instrument to the PC's RS232 port. 
        2. Run FRYERS.COM program to load the RS232 driver into the PC. 
        3. Turn on the instrument and configure it for normal operation.

        To run the FBAT32 program on a Windows based computer:

        1. Connect the instrument to the PC's RS232 port. 
        2. Turn on the instrument and configure it for normal operation.

        An example batch file SETUP.BAT is provided which uses the FBAT 
        commands to setup a 6500 or FP40 to an initial state. The program 
        assumes that there is a 6500 or FP40 instrument attached to the 
        COM1, COM2, COM3, or COM4 port. 
           
        The FBAT program will allow you to send any command to the 
        attached instrument. It does not check for the validity of the 
        command within it's context. Thus it is possible to send a 
        command which has little meaning in the context of the FBAT 
        program or to the instrument to which it is being sent. 







                                        2


        Source Code:

        The FBAT program was written in Turbo Pascal. The source is 
        provided in the files FBAT.PAS, FSUNIT.PAS and FCUNIT.PAS. If you 
        wish to modify the program, you will need Turbo Pascal version 
        6.0 or Borland Pascal version 7.0 to compile the programs. 

        The FBAT32 program uses the FBAT32.DPR, FBAT32.RES, FSUNIT.PAS, 
        FCUNIT.PAS and FRYEREGS.INC source files, it is compiled using 
        Delphi version 2.0. Note that the two versions share two files, 
        FCUNIT and FSUNIT. These files contain the program source code. 
        The other files are used to provide the needed stuff for the 
        different compilers. The FCUNIT and FSUNIT are the important 
        source files.


        FBAT.EXE and FBAT32.EXE

        The FBAT or FBAT32 program sends commands to the attached Frye 
        instrument from the MSDOS command line. In Windows95 or WindowsNT 
        even though you are at a MSDOS command prompt, it can still run 
        32 bit programs (they are called console programs).

        For 16 bit MSDOS the command is given as:

          "FBAT [-Cn] [-In] [-Tn] [-F Rfilename] cmd [count data]" 
        or
          "FBAT [-Cn] [-In] [-Tn] [-F Rfilename] Sfilename" 

        For 32 bit Windows then command is given as:

          "FBAT32 [-Cn] [-Tn] [-F Rfilename] cmd [count data]" 
        or
          "FBAT32 [-Cn] [-Tn] [-F Rfilename] Sfilename" 

        The items in brackets [] are optional (to be discussed later). 
        'cmd' is the command number to be sent to the instrument, 'count' 
        is the number of data words to be sent, and 'data' is the actual 
        data. The components of the command should be separated by a 
        space. If the count value is zero, no data needs to be provided. 
        If no count value is given, the count is assumed to be zero. 
        Refer to the FIPP documentation for the command numbers and 
        format of the data sent and received. 

        Note: Options (those items in brackets []) must be given first in 
        the command line (immediately after 'FBAT') before the 'cmd' or 
        Sfilename values. The 'cmd' or Sfilename entry must be given.

        Commands may be given in ASCII form, or in hexadecimal. Hex 
        numbers must be preceded with a dollar sign "$". 
        Example: $100C





                                        3


        If a filename is given (Sfilename) instead of a command number, 
        it is assumed that the indicated file contains a command sequence 
        in ASCII numbers. One line per number. This allows large commands 
        to be sent that would not otherwise fit on a single MSDOS command 
        line.

        The "-F filename" is an optional receive filename. If a command 
        option of "-F" is encountered followed by a space, followed by a 
        filename. The response from the instrument will be placed into a 
        text file of the given name (any existing file of the same name 
        is overwritten). The data is given as an absolute decimal number 
        of the array of words returned by the instrument. Post processing 
        of the returned data will most likely have to be done to properly 
        interpret the resulting data. FBAT simply provides and ASCII file 
        transport for the command packets, it does not interpet the 
        actual command packets (except for labels).

        The "-Cn" is an optional COM port command specifying the comport 
        to use, where 'n' specifies a COM port number between 1 and 4 (or 
        1 to 9 for FBAT32).  There should be no space between the C and 
        the number. If the "-Cn" option is not given COM1 is assumed to 
        be the port to use. If a valid fryers driver is not found on the 
        specified port, an error message will be generated and the 
        program will be terminated.

        For 16 bit version only:
          The "-In" is an optional IRQ interrupt number that can be   
          specified for use with the selected COM port. The number should     
          be between 0 and 15. If no number is given, the default   
          interrupt for the COM port will be used. There should be no   
          space between the 'I' and the number in the command.
         
        The "-Tn" is an optional delay that may be added to the poll 
        time-out function. By default, if a command is not returned 
        within five seconds from the time it is sent, or if a poll is not 
        being received from the instrument, the program will be 
        terminated. This time can be changed with the 'Tn' command. There 
        should be no space between the 'T' and the number in the command.

        The default delay is five seconds. For most commands this is 
        sufficient. There are some commands which may require a longer 
        time period. An example would be a standard pure tone sweep 
        request with noise reduction set to 16. This can take up to 3 or 
        4 minutes to complete. In such cases, the poll time-out delay can 
        be adjusted with the "-T" command. The time is given in 0.055 
        millisecond 'ticks'. As an example, the default delay is 5.5 
        seconds, or a value of 100. 

        Note: items in brackets [] are optional items. Don't use the 
        brackets in the command, they are only used in the description to 
        indicate that the item is optional.





                                        4


        Text commands:

        If the data is large, or is to be derived by computer, the 
        command can be read from a file instead of command line 
        parameters. Instead of specifying the command number, use the 
        name of the file the command is to be read from "FBAT filename". 

        The format of the file must be one number per line, with the 
        command number being the first number in the file followed by the 
        data count on the next line, followed by the individual data 
        elements on each line after that. All data must be given in 
        ASCII form.

        All numbers must be in integer form (no decimal points).


        Numbers:

        Command numbers may be given as decimal or as Hexadecimal. 
        Decimal numbers must start with a number character or a minus 
        sign followed by a number. The number ends with the first non-
        numeric character found.  Hexadecimal numbers start with a '$'. 
        It is not valid to preceded a hex number with a minus sign. The 
        hex number must be valid. The hex number ends on the first non-
        valid hex digit. Valid hex numbers are 0-9 and A-F. 
         

        Labels:

        There are currently as of this writing two label commands (6 and 
        66). These commands are treated special because they accept text 
        rather than data words. The text can be read either from a file 
        specified in the command (FBAT 66 LabelFile), or it can be 
        entered manually by specifying the command number (FBAT 6 or 
        FBAT 66) without any other parameters. 

        If you give the command number, a simple editor will be invoked 
        which will allow you to enter the label information from the 
        keyboard. 

        If you provide a filename after the command number, the label 
        information will be assumed to be in a file of the specified 
        name. The file is to consist of standard ASCII text of one text 
        line per label line to be sent.












                                        5


        A sample batch file, LABEL.BAT, is provided to show an example of 
        sending a label to the 6500 or FP40. If the instrument is 
        connected to COM1, use the command "LABEL 1". If the instrument 
        is connected to COM2, use the command "LABEL 2" (Note the space 
        between the program name and the number).

        If you add the LABEL.TXT filename to the command: 

          "LABEL 1 LABEL.TXT"

        the label will be read from that file. Otherwise, the default 
        label editor will be used to obtain the data manually from the PC 
        keyboard.


        SETUP.BAT

        The SETUP.BAT program shows an example of initializing a Fonix 
        6500 or FP40 instrument.  The SETUP batch file assumes that a 
        Fonix 6500 or FP40 instrument is attached to the serial port on 
        the PC. 

        If the instrument is connected to COM1, use the command 
        "SETUP 1". If the instrument is connected to COM2, use the 
        command "SETUP 2" (Note the space between the program name and 
        the number).

        The program will send a series of commands to the instrument. The 
        commands configure the instrument to place it in the pure tone 
        mode with the frequency set to 2000Hz. The amplitude is set to 
        70db. The distortion is set to total distortion. The Gain mode is 
        set on, and Noise reduction is set to 2.


        CONVERT.EXE

        Since the curve data read by the FBAT program is in absolute 
        integer form, it is not easy to use by some programs such as 
        Dbase or Lotus. The CONVERT program has been provided to convert 
        the absolute data read in by the FBAT program into real ASCII 
        text numbers usable by programs that can import ASCII text files. 
        See the CONVERT.TXT file on how to use the CONVERT program.

        LDECODE.EXE

        The LDECODE program converts a label result from the FBAT program 
        into a readable ASCII text file. 









                                        6


        Special note:

        If you run the 16 bit version of Fryers in a MSDOS windows of 
        Windows95, the 32 bit version will not run until you close the 
        MSDOS window that the 16 bit version of Fryers was run in. This 
        is caused by Windows 95 giving the serial port resources to the 
        MSDOS window at the time that the 16 bit Fryers driver asks for 
        the serial port hardware. Windows will leave the serial port 
        hardware attached to the MSDOS window until the window is closed. 

        The reason for this is that Windows doesn't know what the program 
        running in the MSDOS window is doing, so it makes the worst case 
        assumption that the hardware must remain attached to the window 
        until such time as the MSDOS window goes away. 

        Normally this is not a problem, but it can cause concern if you 
        run the 16 bit version and then immediately try to run the 32 bit 
        version in the same window or leave the MSDOS window open in the 
        background. It won't work. 

        The above problem is an interesting side effect of the attempt to 
        maintain reverse compatibility to old MSDOS programs while 
        running under Windows95. Since you can't run the 16 bit version 
        of FBAT in Windows NT, this problem never comes up there.



        History:  06/29/89 -med
                  01/19/92 -med
                  04/01/92 -med
                  11/16/92 -med
                  10/04/93 -med
                  09/27/94 -med
                  04/13/95 -med
                  05/01/97 -med 

        <end>



















                                        7
