Pellet Detection species: any
Maintainer none Current version 0.1 View the changelog
Original Author Gary Bamberger Date last modified Mar-7-2005
License BSD MED-PC version 4
This example code is used for the detection of a pellet in the magazine. Note that for the detection to work, the hardware must be configured properly (see comments in the program).
No references given. Click to e-mail a reference to the maintainer.
Code
How to use this code Download the code Download an example macro Download the profile
  \ Inputs
^PelletRemoved = 4  \ This Input must be set to Level Mode (L)
                    \ and Inverted (-).  These settings are made
                    \ with the jumpers on the module itself.  To
                    \ test the modules for the correct setting
                    \ use MED Test.  When the tray is empty, the
                    \ LED indicator on the interface module
                    \ should be off.  If not check for something
                    \ blocking the beam.  With the LED off the
                    \ repeat counter will continue to count the
                    \ bit associated with this input.  Placing a
                    \ Pellet in the trough or blocking the
                    \ photobeam should turn the LED ON and stop
                    \ the repeat count.

\ Outputs
^PelletOp = 6


\ Z-Pulses Used in This Program
\  Z32 = Signal End of Session


\*********************************************
\          PELLET DISPENSER CONTROL
\*********************************************
S.S.8,
S1,
  #START: ---> S2

S2,     \ Time Acclimation Period/ITI
  5': ON ^PelletOp ---> S3

S3,
  0.05": OFF ^PelletOp ---> S4
  #Z32: OFF ^PelletOp ---> S1

S4,     \ Beam release must be maintained for 500ms
        \ (Fifty 10ms interrupts) to count as a Pellet removal.
        \ Abort the count if the timer times out in the second
        \ statement.  To change this value change both the
        \ 50#R and the 0.5"
        \
        \ Record the number of Pellet Deliveries.
  50#R^PelletRemoved: ON ^PelletOp; ADD G ---> S3
  0.5": ---> S4  \ Time limit to increment 50#R
  #Z32: ---> S1 
Related programs Other versions
No training programs submitted/required

No older versions available
No experimental versions available