H_PROG Manual                                                     Page i:


H_PROG V1.1

Contents:
Introduction......................................................Page 1
Menu 1, starting and ending remote mode ..........................Page 3
Initialisation Menu, changing ports and default directories.......Page 4
Menu 2, Staring Calcium measurements and saving data files........Page 5
Menu 3, Manually setting parameters...............................Page 7
Menu 4 Starting single wavelength measurements....................Page 8
Problems, Technical stuff.........................................Page 9

This program is freeware, and you are encouraged to copy it and give
it to people who can use it (see the last page for more information). 


Ian Musgrave Ph.D.
Prince Henry's Institute of Medical Research
PO Box 5152, Clayton 3168
Victoria, Australia.
email Ian.Musgrave@med.monash.edu.au
phone +61 3 550 4286 fax +61 3 550 6125


H_PROG Manual                                                   Page 1:


INTRODUCTION:

This is a simple program for controlling the Hitachi F-2000 
spectrophotometer, imaginatively called H_PROG.EXE. It is intended 
mainly for measurement of intracellular ions using either ratio 
(eg FURA2, BCECF) or single wavelength (eg. FLUO3, Sodium green) dyes.

BASIC INFORMATION:

This is a very simple program. Basically you can only start a 
measurement, stop it, save the data in spreadsheet compatible CSV format 
and draw a crude graph of the ratio values. It cannot SET any 
parameters, due to the nature of the Hitachi command set. To do this you
have to return control of the Hitachi F-2000 to itself and set them (eg 
excitation and emission wavelengths) manually. Sorry about that, but that 
is how Hitachi wrote the command language. 

Currently you can measure either a single ratio dye (using the CALCIUM
protocol) or a single wavelength dye. The program cannot do wavelength 
scans, although it is possible to program it in and I may do it at a 
later stage. 

WHAT THE PROGRAM DOESN'T DO. 

There is no printing facility as I assume you will transfer the CSV files 
to EXCEL, QATTROPRO or something similar for post processing. These have 
better graphing algorithms than I could ever write. 

I have also not written a ratio to calcium section for the same reason 
(also peak detection problems). I have written a suite of EXCEL files 
(which should be LOTUS and QUATTROPRO compatible) to do just that. They 
should be included with this program 

There is no autofluorescence correction, as this is quite tricky to do at
the moment (again, you can fix it up in a spreadsheet).  

KNOWN PROBLEMS:

The subroutine that checks that a file already exists
may not work properly on all BIOSes. If it says a file known to exist
is not there, I can provide a version for the variant BIOS. 

The algorithm that does the online graphing (as opposed to the
graphing of saved data) doesn't purge old data, so that you get bits of 
graph carrying over. I have tried unsuccessfully to fix this. The Graphs 
are VERY crude and ugly, but they were only designed to give a rough idea 
of what is happening.

MACHINE COMMUNICATION PARAMETERS:

The Hitachi should be set to 4800 baud, no parity, 8 data bits one stop
bit for optimum efficiency. You can choose other parameters though. You do 
need either a null modem cable or a null modem adapter to connect the
Hitachi to your computer (see page 4-13 of the manual for a confusing
description). These are available in virtually every computer
and electronics store. Otherwise see the cable wiring diagram in section
4 of the Hitachi manual and get your workshop to make it. 


H_PROG Manual                                                      Page 2:


STARTING THE PROGRAM:

It is usually best for the Hitachi F-2000 to be already on, as the power 
spike generated when the lamp is turned on may scramble you computer. 
Alternatively make sure a power conditioner is in the circuit.

To start the program, merely type H_PROG at the DOS prompt in the 
subdirectory where H_PROG.EXE has been installed. H_PROG can be run under 
Windows (tm) by using the H_PROG.PIF file that has been provided. The program 
has two switches, /ver, which gives you the version of the program, and /H 
which gives VERY brief help.

The program will load up and display Menu 1, the opening menu. The menu 
items can be chosen by pressing the menu number or the associated hot key 
(the highlighted letter). You can also use the space bar or arrow key to 
move to the appropriate item and then press enter. Help is available by 
pressing F1 in all menus except the initialisation menu, 
where, for obscure technical reasons,  you have to use F1 then spacebar.

USING THE HELP READER: 

Pressing the Page up key pages up, pressing the
Page down key pages down. The arrow , home and end keys do just what
you would expect them to. The escape key [ESC] returns you to the 
program. 

MENUS:

There are 5 menus associated with the program, their general descriptions 
are below.

---------------------------------------------------------------------
Menu 1, Main Menu: 

This starts (or stops) remote control of the Hitachi F-2000, then sends
you to either the measurement menu, the parameter menu or the single 
wavelength menu. There is also the ability to display saved files 
as a graph of the ratios and the option to change communication 
parameters and default directories via the initialisation menu.

---------------------------------------------------------------------
Menu 2, Measurement menu:

Most of the menu  items are self explanatory, the program assumes you 
are only measuring one ratio reagent, be it FURA, SBFI or BCECF.

---------------------------------------------------------------------
Menu 3, Parameter menu:

Allows you to change the parameters for Ratio measurement

---------------------------------------------------------------------
Menu 4, Single Wavelength Dye:

Measures intensity changes over time for a single wavelength dye 
(eg. FLUO3, Sodium Green, bisoxynol).  The setup is basically 
similar to the ratio measurements 


H_PROG Manual                                                  Page 3:


MENU 1, MAIN MENU: 

1) Start Remote Control: This starts remote control of the Hitachi F-2000, 
the Hitachi MUST be in remote control mode before any other command is sent.

2) End Remote Control: This stops remote control of the Hitachi F-2000, 
allowing you to change parameters or otherwise operate the Hitachi F-2000 
manually.

3) Intracellular Calcium: Sends you to menu 2, the intracellular calcium 
measurement menu. You can of course measure virtually any ratio dye from 
this menu. (eg. SBFI, BCECF).

4) Change Calcium Parameters: Sends you to menu 3. Allows you to manually 
change the ratio measurement parameters.

5) Single Wavelength Dye: Sends you to Menu 4. Allows you to measure any 
single wavelength dye (eg. FLUO 3).

6) Graph Saved Data. Graphs RATIO data saved in CSV format. NOTE! this 
CANNOT graph single wavelength data (different file formats).

7) Change Default Setup. Sends you to the initialisation menu, where you 
can change communications parameters and default directories. You can use 
these changes in the one session or save them to an INI file.

8) Quit: Exits H_PROG. The program creates a file called lastrun.sav which 
records wether you had saved file 0 before exiting, and some other 
housekeeping info (i.e., If you were using Single wavelength or ratio mode
and if the Hitachi is turned on).



H_PROG Manual                                                     Page 4:


INITIALISATION MENU:

This allows you to change the default communications parameters and the
default directories of the program. These parameters are stored in a 
file is called HITACHI.INI which resides in the program directory. This file
should have been created during setup. You can alter this file from the menu, 
or with a text editor. Please note that the entries MUST be in the form that 
they have in the original INI file. eg. the Parity values MUST begin with an 
",". 

Communications: 

NOTE: The parameters must FIRST be set up on the HITACHI F-2000 manually
THEN you have to make the program agree with the HITACHI. (Stupid system,
but that's how the command language is).

COM Ports:
Because of limitations in how BASIC handles com ports, you only get a 
choice of Com1: and Com2:. (It is possible to get Com3: and Com4:
but that is serious interrupt programming, a bit beyond my present
expertise). Com1: is usually assigned to the mouse, so Com2: is the default. 

Baud:
Restricted to the choices available with the HITACHI F-2000, the highest 
rate it can handle is 4800. Use 4800 unless you have data clashes, then 
try a lower rate.

Parity:
For most computers N,8,1 is best (No parity, 8 data bits, one stop bit).
Again, the choices are restricted by what the Hitachi can handle. Several 
of the combinations in the Hitachi manual cannot be used with DOS machines.

NOTE 2: If you alter the INI file with a text editor, then you can include
values for parity that I have left out (there were too many weird ones). 
The program will accept them, DOS may not.

Directories:

I have set up the program so that the program files, data and temp files 
are stored in different directories. This allows easy control of files.
As temp files are deleted at the end of each operation, you could ignore 
a separate directory for these, but it allows you to set a RAM disk as your 
temp file storage, speeding things up.   

The Menu system:

You change Communications parameters either by a simple "press a key" 
system. Directories are typed in, there is a primitive system to check that
it is a valid file name. Only existing directories are accepted. You will 
be prompted for another name if a non-existent directory is typed in.

You can choose to use the altered parameters only for a particular session, 
or save then to the INI file. If things go badly wrong you can restore the
internal defaults in the program.



H_PROG Manual                                                      Page 5:


MENU 2, INTRACELLULAR CALCIUM MEASUREMENT:

1) Start Measuring Calcium: Does just what it says. 
The program starts a timer when the measurement starts, this allows you 
to synchronise drug and stimulus addition. The program automatically stops 
after a preset time. Either the experimental time set with the program or
the time set manually on the Hitachi, whichever comes first. You can also
stop before either of these times using the Stop menu item. If the machine
is set to automatically print a run, the timer will idle while it does this. 

The program prompts you if you try to start a new measurement before 
saving the old one. 

2) Stop Measuring Calcium: If you want to stop before the preset 
ending time.

3) Save Data: Saves the data in File 0 (the active file) in the
Hitachi. There is currently no way to get the data "live" as it is 
measured.  The program prompts you for a file name, you can use any of 
the editing keys described below. [Enter] accepts the file name, [Tab] 
pops up a list of file names and [ESC] abandons the task.

You can ONLY save RATIO data with this command (another brilliant Hitachi 
"feature"). To save single wavelength data you must use the save command 
from that menu.

The program copies the data to temporary files, then creates 
a CSV (comma separated value) file. This is somewhat slow, but I can speed 
it up later. The data is written as Time, WL1, WL2 and Ratio.

The data is then graphed as the ratios, the scale is automatic 
between 0 and Rmax for the run (this may give some peculiar graphs)
The algorithm that handles artefacts can also use a little work. There 
is another problem in the display, it may go off scale due to a 
problem in the way BASIC handles integers.

4) Change Calcium parameters: sends you to the parameter menu (menu 3)
where you can manually set the Hitachi parameters for wavelength, 
experimental duration etc.

5) Clear timeout: Should something go wrong, and you have a data 
overflow, the F-2000 will timeout (and display timeout on the F-2000
screen), you have to use this command to clear it to receive further 
commands.

6) Display Graph of saved files: Graphs the Ratio values in the saved 
files. But ONLY ratio files (single wavelength files have the wrong format).
 
7) Change experimental length. Allows you set shorter run times than that
set manually on the Hitachi.


H_PROG Manual                                                   Page 6:


EDITING file name input:

You can edit the default string in the input line, rather than retype
it. The following are the valid editing keys:

     INSERT         Toggles the insert mode and over-type mode.
     DELETE         Delete character at cursor.
     BACKSPACE      Destructive backspace.
     LEFT ARROW     Move the cursor to the left.
     RIGHT ARROW    Move the cursor to the right.
     HOME           Move the cursor to the beginning of the field.
     END            Move the cursor to the end of the field.
     CTL-HOME       Move cursor to the start and erase the field.
     CTL-END        Erase from the cursor to the end of the field.
     CTL-BkSpace    Erase from the cursor to the start of the field.

The program "remembers" the file name from run to run, allowing for easier
data entry.



H_PROG Manual                                             Page 7:


MENU 3, PARAMETER MENU:

All this does is to put you into the screen for setting the 
ratio parameters and returns you to manual control. You then have to change 
any settings by hand from the F-2000 key board. At this time I have 
no way of changing these values using the Hitachi command set.

Press 1 to return to the Measurement Menu, or r to return to the 
Main Menu 



H_PROG Manual                                                Page 8:


MENU 3, SINGLE WAVELENGTH DYE:

Measures a particular emission/excitation pair over time. As for the, 
ratio measurements all parameters must be set up manually. 

1) Start Measuring: Does just what it says. The program 
prompts you if you try to start a new measurement before saving the 
old one. For further details see the Calcium Measurement page.  

2) Stop Measuring: If you want to stop before the preset 
ending time.

3) Save Data: Saves the data in File 0 (the active file) in the
Hitachi.  The program copies the data to temporary files, then creates a 
CSV (comma separated value) file. This is somewhat slow, but I can speed 
it up later. The data is written as Time and WL(intensity). There is 
currently no way to automatically extract the particular wavelength settings. 
The data is then graphed as intensity, the scale is automatic 
between 0 and Rmax for the run (this may give some VERY peculiar graphs)

You can ONLY save SINGLE WAVELENGTH data with this command. To save 
RATIO data you must use the save command from that menu

4) Change Parameters: sends you to the parameter menu for single wavelength
measurements where you can change the parameters manually

5) Restart with New Parameters: Returns you to the measurement menu with
the new parameters in place.

6) Clear timeout: Should something go wrong, and you have a data 
overflow, the F-2000 will timeout (and display timeout on the F-2000
screen), you have to use this command to clear it to receive further 
commands.

7) Change experimental length: Allows you to set values shorter that 
manually entered in the Hitachi.

8) Returns you to the main menu, checks for unsaved data.



H_PROG Manual                                            Page 9:


PROBLEMS:

If the program doesn't run the Hitachi, 

1) Check that you have a null modem cable rather than a straight
through RS232 cable connecting the computer and the Hitachi. A
breakout box will help you here. Null modem adapters can be bought at 
any electronics shop.

2) Check that the communication parameters in the HITACHI.INI file match 
the settings on the Hitachi. Remember, the program settings must match 
the machine settings as the program CANNOT change the machine settings.
(curse you Hitachi!)

3) Check you are not using non standard com settings. 8 data bits,
1 stop bit and no parity is best. You CANNOT use 7 data bits and no
parity together, despite what the Hitachi manual shows (You CANNOT 
use 7 data bits for numeric data anyway). Try setting the 
terminator to carridge return/line feed if this doesn't work. Make sure
you have the right com port as well.

4) If all else fails, try using the enclosed QBASIC program to see if
you can get a response by sending the Hitachi commands (see your manual
page 4-15 and on and 3-6  in the intracellular calcium manual) over this 
program (use CAPSLOCK on, as the Hitachi only recognises uppercase). If 
after fiddling with the parameters in this program you still cannot get
the thing to run, e-mail or fax me.

FUTURE DEVELOPMENTS:

As this is a part time project things go a little slowly. However, as this 
is the program I use to measure calcium, depolarisation etc. I will look 
after it.

The data saving routine needs to be speeded up, and the graphs done better.
I will eventually make a program to calculate [Ca2+]i from a nominated 
calibration file(s). I will also add autofluorescence handling. Even further 
in the future I will add spectral scans. However, as it is H_PROG should 
do most of what you want. 

TECHNICAL GUFF:

This program is freeware (yes FREE) and you are encouraged to give copies 
to people who can use it. This program must not be sold, hired or used in 
any way for profit. Standard disclaimers apply (ie. if you start World War 3
with this software, it 'aint my fault). Remember, this is a free program 
which was written by an amateur, and you get what you pay for. (see 
copyright notice below).

This program was written and compiled using MICROSOFT QUICKBASIC 4.5 (no,
not the pretend version you get with DOS 5.0 and up). It should run on any
IBM compatible XT/AT/386/486 running DOS 3.1 or higher. I have used it on
XT's, 386 and 486 machines without it blowing up. There are no fancy colours,
graphical routines or even mouse calls so that even the scummiest XT can 
run it (I actually use an XT!).

This program is copyright to Ian Musgrave (1995) except for those portions
that are copyright to Christy Gemmell (FINDFILE from altquick.lib) and 
Harold Thomson (QINPUT and QEXIST from qb4bas.lib)(many thanks for these
marvellous utlities folks). A big tip of the hat to Anders Lonnemo for 
discussion about communication topics and how to get around the lack of a 
data terminator on the FILE 0 data stream. Thanks also to Mat Hart, whose 
VIEWFILE.BAS inspired useful changes to my HELPVIEW module and Ryan Heldt 
whose HELDTMENU showed me how to set up my own menu system.

At a later stage I will provide source code for those who wish to try to
beef up the system. I have not as yet put it in because (A) it is very
spagettied (B) it is completely unannotated. This is a part time project
so this will take a while. If you have a burning desire for source code 
e-mail me at the address below. Remember, it is QuickBasic 4.5, and will 
not run with the QBASIC that comes with DOS, but will run under 
Visual Basic. Meanwhile enjoy.   

Please send all feed back, queries etc to
Ian Musgrave Ph.D.
Prince Henry's Institute of Medical Research
PO Box 5152, Clayton 3168
Victoria, Australia.
email Ian.Musgrave@med.monash.edu.au
phone +61 3 550 4286 fax +61 3 550 6125

