Getting Started Writing Programs to Communicate With Fonix Equipment
                 05/17/11 - med


If you have previously written programs to communicate with Fonix equipment,
then you should already be familar with the Fryers communications 
interface. While we still provide the old style interface for those who
have built a library and knowledge base for that method, we strongly
recommend that you consider migrating to the new FryeCom driver interface to
communicate with Fonix equipment. 

If you are new to writing programs to communicate with Fonix equipment, 
then you should use the FryeCom method. Because the FryeCom interface
sits on top of the Fryers layer, you can still study how it works to
gain an understanding of how the Fonix communications interface works.
However, it is not a requirement to getting started. 

To hit the ground running with the FryeCom programming...
First read the ProgrammingWithFipp.txt file to learn what you will be doing.
Next read the FryeCom-API.txt file to learn how you will be using the 
FryeCom driver. The file FryeCom-Example.txt provides a simplified example 
of how to program using the FryeCom driver. Note: you don't need to use this
code, it is just to show you an example to gain an understanding of what you
will be doing. We provide several files that you can use as a starting point
(FryComD and FippCore).  

Unless you will be using the older Fryers driver interface, you can ignore 
the Fryers32-cmds.txt, Fryers32-description.txt, Fryers32DLL.txt, 
FryersFlags.txt, and Fryers-Overview.txt files. (Unless you wish to learn how 
things work under the hood.)

Once you are done with the FryeCom/Fryers documentation, look in the 
FippDoc directory for the Commands.txt which contains the description of
the FIPP commands used by Fonix Equipment. Also read the related files
for the instrument you will be talking to, especially the xxxCMDS and 
xxxNOTE files which describe which commands are specific to your instrument.
The Curve.txt and PackedDateFormat.txt files are also useful to learn how
data is stored in curve frames and Fonix date format. 
(Note: the AFIPP directory contains the commands for the Fonix audiometers.)

You can also see information on the most commonly used FIPP commands on
the Frye web site at:
http://www.frye.com/products/download/comm/programming.html
Click on the Programming and Technical Support/Documentation link.


Several very useful programs are FCheck and TestCom.
Fcheck is used to test the communications interface. You can use it to 
find out what port the instrument is attached to and/or if or what any
problems there might be with the communications port. 

TestCom provides a simple interface to allow you to test the FIPP commands. 
We use this program internally for testing. It is a good way to find out
if the command works on your instrument and how it works. The directory
sources\testcom contains the source code for the program (in Pascal/Delphi).


Start programming: 

When you are ready to start coding, look at the Programming\Sources
directory for example programming sources. If you will be using C++ or 
Pascal/Delphi, grab a copy of the files located in Common. They provide 
the basic tools you will need to start coding. 

Of particular interest are:

Common required files for all programs:
FryeDefs : The Frye Electronics common definitions used by all Frye programs.
Fryers   : The basic definitions for the Fryers communications interface. 
FcomDefs : The FryeCom driver specific defines.
FryeComD : The FryeCom driver loader and interface modual.
- Optional -
FryeComS : An alternate static DLL load replacement for FryeComD.
Note: We recommend using FryeComD as it provides better program control.  

FippCore : The Core object for the FIPP commands. 
           Use this object as the base object for your own object, or
           you can just use it directly as a stand-alone object. 


Other files:
BitRev    : used for bit reversal
FryeColors: The color definitions used by Frye programs.
FCEerrMsg : Converts Fryecom error numbers into text messages.
FippUnit  : This is an extensive file that contains calls for all
             Fipp commands as of the time of it's creation.
FryeStr   : String handling routines used by Frye programs.
FryeTools : Toolkit of various routines used by Frye programs.
IniReg    : Routines to manage Registry and INI files.
LabelUnit : Routines to manage the Fonix Labels.
TextFile  : Object to manage comma delimited and regular text files.
Fryers32  : For programming to the old Fryers interface only (the old way).

The directory FBatCom contains the batch script program that can be used
to send commands to an instrument via a Windows batch file. 
Sources\FBatCom contains the source code for the program (in Pascal/Delphi).

The directory BcrvExample contains two example programs that collect data
from a Fonix analyser and displays the results on a graph. 
BCrvCore uses the FippCore object to do the work. 
BCrvFull uses the FippUnit wrapper ontop of the FippCore object to do the 
work. Both programs are written in Borland C++ Builder. 

If you are working with the Fonix FA10/FA12 audiometer, the directory
sources\audiometer contains examples for programming to the audiometer.
Note: These audiometer programs have not been updated to use the FryeCom 
interface. They still use the older Fryers32 call interface.

<eof>

