 Ŀ
   JUMP STARTING COMMUNICATION           
   WITH THE Model 6307 THROUGH THE RS232 
                                         
 ٲ
  

 Supported Languages  : Quick Basic 4.5 , Turbo Basic 1.0, 
                        Turbo C Version 2.0, and Turbo Pascal Version 5.00+

  CONTENTS OF THIS DISK
  ---------------------
  Main Directory
  --------------
  MAN6307.TXT    - This file!

  MANUAL.TXT     - Manual of Subroutines
  
  DEMO6307.EXE   - Executable demonstration program for the Model 6307

  TURBOPAS Directory
  ----------------
  DEMO6307.PAS   - Source code of Demo program written in Turbo Pascal 5.5

  DEVICES.PAS    - Source code of Driver written in Turbo Pascal (TPU) 5.5
  
  TURBOC Directory
  -----------------  
  DEMO6307.C     - Source code of Demo program written in Turbo C 2.0

  DEVICES.C      - Source code of Driver written in Turbo C 2.0
  
  DEVICES.H      - Header file of driver 

  QUICKBAS Directory
  ------------------
  DEMO6307.BAS   - Source code of Demo program written in Quick Basic 4.5

  DEVICES.BAS    - Source code of Driver written in Quick Basic 4.5

  README.TXT     - read this if your using quick basic compiler

  TURBOBAS Directory
  ------------------
  DEMO6307.TAS   - Source code of Demo program written in Turbo Basic 1.0

  DEVICES.TAS    - Source code of Driver written in Turbo Basic 1.0

  --------------------

  You have to include the driver provided in this diskette so as
to save you the trouble of making the protocol to communicate flawlessly
with the Model 6307. Just copy the appropriate source code for your 
kind of compiler (Turbo C,Quick Basic, Turbo Basic  & Turbo Pascal only).
For the Model 6307, only three commands are necessary to receive from or 
send data to the PC, these are the following;

	InitCom  
	ReadData 

    Ŀ
     *** If you are using TURBO PASCAL, you must use      
         the directive {$N+} if you have a coprocessor or 
         {$E+} if none, to use the given procedures.      
         It is also necessary to compile the devices.pas  
         to turn it into TPU file so you can use the      
         commands.                                        
    

 InitCom :
 -------
Declaration  Sub  InitCom(ComNo%, BaudRate%, Code%) 'Turbo/Quick Basic
	     Procedure InitCom (ComNo : byte; BaudRate: Word; 
				var Code : integer); { T pascal }
	     void InitCom (byte ComNo, word BaudRate, int *Code); /* Turbo C */
    
    This procedure initializes the com to your specified baud rate.
    For the Model 6307 the baud rate is fixed to 4800 so for this procedure
    you have to send 4800 as your Baudrate variable.
    You also have to send the correct COM port for the variable "ComNo".

 ReadData :
 --------
Declaration Sub  ReadData(Parameter&,Data#,ErrorCode%) 'Quick/Turbo Basic
	    Procedure ReadData(Parameter:word;
			   var Data:double;         
			   var Code:integer);       { turbo pascal }
	    void ReadData (word ParamNo, double *Data, int *Code); /* TC */

     This procedure will get the specified data from the model 6307.
     The following parameters are valid for the model 6307 :

     Parameter       description        possible UNIT error codes

*for readdata routine

          3          Compensated
                     Conductivity       1 : conductiviy over
                                        7 : temperature limit 
                                            for conductivity over execeeded
                                        8 : temperature limit
                                            for conductivity under exceeded
                                        9 : temperature over range
                                       10 : temperature under range

          7          Uncompensated
                     Conductivity       1 : conductiviy over
                                        7 : temperature limit 
                                            for conductivity over execeeded
                                        8 : temperature limit
                                            for conductivity under exceeded
                                        9 : temperature over range
                                       10 : temperature under range

          4          Salinity           3 : Salinity Over
                                        7 : temperature limit 
                                            for conductivity over execeeded
                                        8 : temperature limit
                                            for conductivity under exceeded
                                        9 : temperature over range
                                       10 : temperature under range

          5          Temperature        5 : thermistor input shorted 
                                        6 : thermistor input open
                                        9 : temperature over range
                                       10 : temperature under range


         12          pH

  ---------
  Device Driver ErrorCode :
  ---------                  
      The following will be returned 
      if any communication errors transpired:

      -1 = Invalid port no.  [Valid 1 to 5]
      -2 = Invalid Baud rate  [valid 4800 only] 
      -3 = TimeOut no response  [ No Response for more than 2 sec ]
      -4 = Device Busy [Parameter passed cannot be serviced at the moment]
      -5 = Unknown parameter     [Parameter not supported]
      -6 = Invalid Command       [Command not supported ]
      -7 = Invalid Data [ Data too big,invalid format etc.] 
     -10 = No RS232 card installed in selected com port

  We recommend therefore that you check the errorcode if you use 
  any of the subroutines/procedures before continuing your program.
  An errorcode = 0 means no error and the data/command is valid.

Note : There are 2 set of errors positive errors and negative errors.
       If the error is negative then the error is a device error 
       (see Error Table). If the error is positive then the error is
       a display error (see Error Table)

  Error Table
 __________________________________________________________________________   
|Error # |      Definition                                                 |
|--------+-----------------------------------------------------------------|
|  +14   |  pH under range                                                 |
|  +13   |  pH over range                                                  |
|  +12   |  reserved                                                       |
|  +11   |  reserved                                                       |
|  +10   |  Temperature Under Range                                        |
|  + 9   |  Temperature Over Range                                         |
|  + 8   |  Temperature under exceeded temperature limit for conductivity  |
|  + 7   |  Temperature over exceeded temperature limit for conductivity   |
|  + 6   |  Thermistor input is OPEN                                       |
|  + 5   |  Thermistor input is shorted                                    |
|  + 4   |  reserved                                                       |
|  + 3   |  Salinity over range                                            |
|  + 2   |  reserved                                                       |
|  + 1   |  Conductivity over range                                        |
|    0   |  NO ERROR                                                       |
|   -1   |  Invalid port no.  [Valid 1 to 5]                               |
|   -2   |  Invalid Baud rate  [valid 4800 only]                           |
|   -3   |  TimeOut no response  [ No Response for more than 2 sec ]       |
|   -4   |  Device Busy [Parameter passed cannot be serviced at the moment]|
|   -5   |  Unknown parameter     [Parameter not supported]                |
|   -6   |  Invalid Command       [Command not supported ]                 |
|   -7   |  Invalid Data [ Data too big,invalid format etc.]               |
|   -8   |  reserved                                                       |
|   -9   |  reserved                                                       |
|   -10  | No RS232 card installed in selected com port                    |
 --------------------------------------------------------------------------

  There is an executable demo program named Demo6307.exe which you can run
  and its source code Demo6307[.pas][.bas][.tas][.c] which you can examine 
  to see the implementation of the subroutines.

  Note on pentiums and win 95
  ---------------------------
  User must use a grounded power cable for pentium class pc before
  using this program.
  This is not compatible with win 95 dos box, we recommend user
  to use win 95 MS_DOS mode or booting a clean dos.


  --------------------
  end of man6307.txt
  --------------------
