BarTender

From MagnetoWiki
Revision as of 18:41, 19 March 2008 by Houpt (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview of the Program

  1. All Experiments are loaded (LoadExperiments(); called by main)
    • All expts in the same directory as the application get loaded at when first run
    • Experiments are stored in text files of type EXPT, creater BARt
    • The experiment object holds the number of rats and variables per rat, and the tag abbreviations;
    • when a bar code is scanned, the weights window will ask the expt file to interepret the tag
    • The experiment object also holds the current on weights; the on weights are stored in a file with the name “EXPT on wgts” (i.e. for an experiment with tag CL, the weights are stored in the file “CL on wgts”.
  2. "On Weight" command -> makes on WeightsWindow the front most window
  3. WeightsWindow waits for input of the tag on the bottle ( waits_for_text flag is set to TRUE)
    • The waiting for a tag is just waiting for keystrokes – either hand entered, or entered by the bar code reader
    • if the WeightsWindow receives a return or enter, then it has gotten the full tag (waits_for_text flag is set to FALSE)
    • Having gotten the bottle tag, the weights window now:
    1. ProcessTag();
      • figure out the experiment, item, and subject number
    2. ForceRedraw();
      • If this is the first tag, then the window needs to be updated with the current expt, which means pulling up the different variables, etc.
    3. WaitForWeight();
      • update weight of that item – wait for the scale to transmit the weight
    4. ProcessWeight();
      • Store the weight in the appopriate bottle object(either as on weight or off weight).
    5. Clear();
      • Start all over again ( waits_for_text flag is set to TRUE)
  4. When the window is closed, the on weights will get stored on disk in a file with the name “EXPT on wgts” (i.e. for an experiment with tag CL, the weights are stored in the file “CL on wgts”.

Setting up the Balance

Sartorius BP-3100S

Macintosh->Serial port Mac->25 pin printer cable -> null modem adaptor-> balance

Balance menu setup (* = factory default):

1-1-2 stable conditions
5-1-7 = 9600 baud
5-2-3* = odd parity
5-3-1* = 1 stop bit
5-4-2* = hardware handshake with 2 char after CTS
6-1-5 autoprint at stability
6-2-2* autoprint not stoppable

If no weight is being reported (i.e. the balance is working, but the Mac doesn't appear to see it):

  • Turn scale off
  • unplug serial cable from back of scale
  • Turn scale on
  • When weight comes up, plug serial cable back in