


                        Audiometer ASCII RS232 Operation
                                  10-06-92 -med


        Communicating with the audiometer:

        There are two optional ways to communicate with the Audiometer. 
        You can use the standard Frye Instrument Packet Protocol or a 
        simplified ASCII based interface.

        For extensive computer control of the audiometer it is strongly 
        recommended that the Frye Instrument Packet Protocol be used to 
        ensure reliable data transfer. 

        With the ASCII interface you will not be able to control the 
        audiometer, you can only request data from it. This is done as a 
        safety aspect since ASCII data does not include inherent error 
        detection which could cause possible bad commands to be received 
        by the audiometer. 

        To control the audiometer from a computer, you MUST use the FIPP 
        method of communication. This won't prevent programming errors, 
        but it will at least reduce the probability of errors in 
        communicating with the audiometer.

        The ASCII method was provided to make it easier to communicate 
        with the audiometer with devices that can not be easily 
        programmed to operate with the FIPP method. 

        The default method of communication (FIPP/ASCII) is selected by a 
        jumper inside the audiometer. The jumper is located next to the 
        RS232 connector on the CPU/Keyboard printed circuit board. Follow 
        the RS232 cable from the backpanel to the CPU/Keyboard printed 
        circuit board. To the left of the ten pin connector on the PCB 
        you will find a jumper. If the jumper is placed on pins 1 and 2, 
        the audiometer will operate in the FIPP mode on startup. If the 
        jumper is placed on pins 2 and 3, the audiometer will operate in 
        the ASCII mode on startup. The audiometer is shipped from the 
        factory with the jumper on pins 1 and 2 (FIPP mode). Commands can 
        be used to switch the audiometer to the other mode while 
        operating.

        When the audiometer is turned on, it will transmit the copyright 
        message and version information out the RS232 port in ASCII. 
        Regardless of whether the RS232 option is set for FIPP mode or 
        ASCII mode. Once the message has been transmitted, the audiometer 
        will switch to the selected mode of operation. For FIPP mode it 
        will start sending polls, for ASCII mode it will send a command 
        prompt. 






                                        1


        FIPP mode:

        In the FIPP mode, all commands are sent to the audiometer using 
        the standard Frye Instrument Packet Protocol. This protocol is 
        supported on IBM PCs and compatibles with the FIPP RS232 toolkit 
        which is provided with all RS232 kits sold with Frye instruments.

        The FIPP mode allows a much wider range of commands to operate 
        the instrument, including the ability to control the audiometer 
        from the computer. Refer to the FIPP documentation for a 
        description of using the FIPP commands.

        ASCII mode:

        In the ASCII mode, there are only a limited number of commands 
        they are as follows:


          AUTO ON   (x) = enable automatic status transmission (default)
          AUTO OFF  (x) = disable automatic status transmission 
          ECHO ON   (x) = echo commands as they are being sent
          ECHO OFF  (x) = don't echo commands being sent (default)
          FIPP ON   (x) = switch to FIPP mode of operation
          RESET     (x) = reset the audiometer (power on conditions)    
          T             = transmit audiometer status
          VER           = return version/copyright notice

        The commands marked with (x) must be exact. That is the command 
        must be given as shown or it will be ignored. The other commands 
        only require the characters indicated. If any other characters 
        are given on the command line they will be ignored and the 
        command will work anyway.

        The AUTO, ECHO and FIPP commands will respond with "OK" if they 
        are processed correctly. 

        The Transmit command will respond with the audiometer status.

        The VERsion command will respond with the version/copyright 
        information.

        The RESET command will simulate the audiometer being turned off 
        and then back on. If you want to restore the audiometer to power 
        on conditions, you can use this command. Note that if the 
        internal jumper is set to FIPP mode, the audiometer will return 
        to FIPP operation after the RESET command has been sent. The 
        RESET command will respond with "OK" then reset the audiometer.

        If a command is not properly entered the audiometer will respond 
        with "?" to indicate that the command was not understood and thus 
        not processed.

        The audiometer will send a prompt ">" when it is ready for input. 



                                        2


        Audiometer status:

        The audiometer status that is provided is a single line of data 
        indicating the current status of the audiometer. 

        The length of the line is variable depending on the data sent.

        The status line looks like this:

        !PS:0000 PM:0000 LF:1000 LL:700 LI:0 LO:0 LS:0 LX:0 
        RF:1000 RL:700 RI:0 RO:0 RS:0 RX:0

        Note: the line is split here for lack of room, but is actually 
        all one line as it is transmitted.

        The line is preceded with "!" to indicate that it is status 
        information. 

        All register values are separated by a single space.

        The information provided is the control panel register data. The 
        full description of the control panel register data can be found 
        in the audiometer FIPP documentation. 

        The "PS" data is the push button information from the audiometer 
        presented in HEX format. This is the PBSTAT register.

        The "PM" data is also in HEX. This is the PBMISC register.

        The "LF" data is the Left Frequency setting. This value is a 
        normal ASCII decimal number. This is the LFREQ register.

        The "LL" data is the Left Level setting. This value is a normal 
        ASCII integer number. This is the LLEVEL register.
        Note that this number is the HL level times ten. There is no 
        decimal point used which is the reason for multiplying the number 
        times ten. 

        The "LI" data is the left Input selection. This is the LSRC 
        register. This is a simple decimal number indicating the setting 
        of the input switch on the audiometer.

        The "LO" data is the Left Output selection. This is the LDEST 
        register. This is a simple decimal number indicating the setting 
        of the input switch on the audiometer.

        The "LS" data is the left Simulator selection. This is the LSIM 
        register. This is a simple decimal number indicating the setting 
        of the simulator switch on the audiometer.







                                        3


        The "LX" data is the Left Level Offset selection. This is the 
        LLOFFS register. This value is a normal ASCII integer number. 
        Note that this number is the HL level times ten. There is no 
        decimal point used which is the reason for multiplying the number 
        times ten. 

        The "RF" data is the Right Frequency setting. This value is a 
        normal ASCII decimal number. This is the RFREQ register.

        The "RL" data is the Right Level setting. This value is a normal 
        ASCII integer number. This is the RLEVEL register.
        Note that this number is the HL level times ten. There is no 
        decimal point used which is the reason for multiplying the number 
        times ten. 

        The "RI" data is the Right Input selection. This is the RSRC 
        register. This is a simple decimal number indicating the setting 
        of the input switch on the audiometer.

        The "RO" data is the Right Output selection. This is the RDEST 
        register. This is a simple decimal number indicating the setting 
        of the input switch on the audiometer.

        The "RS" data is the Right Simulator selection. This is the RSIM 
        register. This is a simple decimal number indicating the setting 
        of the simulator switch on the audiometer.

        The "RX" data is the Right Level Offset selection. This is the 
        RLOFFS register. This value is a normal ASCII integer number. 
        Note that this number is the HL level times ten. There is no 
        decimal point used which is the reason for multiplying the number 
        times ten. 
























                                        4


        Automatic mode:

        When the AUTO ON mode is selected, the audiometer status is 
        automatically sent to the computer anytime a switch setting is 
        changed. This allows the computer to not have to continuously 
        poll the audiometer to find out if it has changed status or not. 
        Note that the automatic status transmission includes the patient 
        response switch so that you will know if the patient has pressed 
        the patient response switch.

        If automatic mode is not selected, then you can obtain the status 
        information with the Transmit command. The Automatic mode is on 
        by default on power up.

        Note that if the Automatic mode is selected, there may be some 
        confusion in the transmitted data if you have ECHO ON selected 
        since all received data is immediately echoed, it may get mixed 
        in with the data being sent automatically by the audiometer. For 
        this reason it is recommended to not use the ECHO ON mode when 
        using the Automatic mode of operation. It won't affect the 
        audiometer operation, but it may confuse the computer collecting 
        the information from the audiometer. 

        Whether the Automatic mode is ON or OFF, the audiometer will 
        still accept commands even if it is currently sending status. 
        The operation is fully interrupt based to prevent lost data.

        On power up, the default mode of operation is AUTO ON and 
        ECHO OFF. That is, the ASCII data will be transmitted anytime a 
        knob is changed on the front panel and any received data will not 
        be echoed. This assumes that the mode selection jumper is in the 
        ASCII position.
























                                        5


        Special note: 

        It is assumed that the commands will be give by a computer and 
        not a human being. As such, there is no command line editing 
        implemented in the audiometer. This would have significantly 
        increased the size of the code and made the operation more 
        complex and less reliable. Since a command sent by a computer 
        doesn't need to be edited, it was decided that editing did not 
        need to be implemented. 

        What this means is that if you are entering the commands to the 
        audiometer manually and you make a mistake you will have to re-
        enter the command again. You have to type the command in 
        perfectly for it to work. 

        If you make a mistake while entering a command, you can cancel 
        the command by sending a ^C (control C). This will cause the 
        command to be canceled. The audiometer will respond with a "?" 
        followed by a normal prompt.

        As you can gather by the above, you can send the ASCII mode 
        commands to the audiometer with a CRT terminal or computer 
        operating as a CRT terminal. The audiometer is set for 9600 baud 
        eight data bits, no parity. It is configured to look like a modem 
        to the computer. This means that a standard straight through 
        RS232 cable can be used to talk to the audiometer.

        When the audiometer sends an automatic transmission (auto on and 
        a key is changed on the audiometer panel), the command prompt 
        will be regiven at the end of the transmission. Since the 
        previous command prompt was not responded to, this may possibly 
        cause some confusion with some computer software. 

        If you are uncertain of the condition of the audiometer, you can 
        always send it a ^C which will cause it to respond with a 
        question mark "?" followed by a new prompt ">". At that point you 
        may enter a new command.

        Note: It takes time for each command to be processed. The exact 
        amount of time depends on the activity going on in the 
        audiometer. If the frequency or an option switch was changed, 
        there can be a delay of as much as 1/4 second (250mS) before the 
        audiometer can respond. The typical response time while the 
        audiometer is idle (no switches being changed) is less than 50mS.

        The best way to ensure that the audiometer is ready for a new 
        command is to watch for the command prompt character ">". When 
        you receive the command prompt, it means that the audiometer has 
        accepted the previous command and is ready for the next command.

        Alternately, you can simply wait one second after sending the 
        command and assume that the audiometer will be ready when you 
        send the next command.

        <eof>

                                        6
