stincic

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Lickometer False Positives #13870
    stincic
    Participant

    So in the case of my program for dual lickometers would I do:

    S.S.11,
    S1,
    #START: —> S2

    S2, \Record Right Licks
    #R^rightLick: SET L = 0 —> S3
    \Record Left Licks
    #R^leftLick; SET L = 0 —> S3

    S3,
    #R^rightLick: SET L = L + 0.01 —> SX
    0.01″: IF L <= 1 [@Short, @Long]
    @Short: Z1 —> S2
    @Long: —> S2
    #R^leftLick`: SET L = L + 0.01 —> SX
    0.01″: IF L <= 1 [@Short, @Long]
    @Short: Z1 —> S2
    @Long: —> S2

    \Inputs
    ^rightLick = 5
    ^leftLick  = 4
    
    \Outputs
    ^HouseLight = 7
    
    \Control variables
    VAR_ALIAS Session Timer (sec)   = A(0) \Default = 600
    VAR_ALIAS Bin Timer (sec)       = A(1) \Default = 60
    
    ^sessionTimer = 0
    ^binTimer   = 1
    
    \Data variables
    \B(E) = Right licks/bin
    \C(E) = Left licks/bin
    \D(F) = Time of each right lick
    \G(H) = Time of each left lick
    \I(J) = Array of ITR times
    
    DIM A = 1
    DIM B = 100
    DIM C = 100
    DIM D = 10000
    DIM G = 10000
    DIM I = 10000
    
    \Working variables
    \E = Bin number
    \F = Total right licks
    \H = Total left licks
    \J = I() index
    
    \R = IRT timer
    \S = Session timer
    \T = Bin timer
    
    \Z-Pulses
    \Z1 = Start program
    \Z2 = End program
    
    \*********************************************
    \     Initialize values
    \*********************************************
    S.S.1,
    S1,
        0.001": SET A(^sessionTimer) = 600, A(^binTimer) = 60;
                SET E = 1, J = 1;
                SET B(E+1) = -987.987, C(E+1) = -987.987;
                SET D(F+1) = -987.987;
                SET G(H+1) = -987.987;
                SET I(J) = -987.987 ---> S2
    
    S2,
        #START: Z1 ---> SX
    
    \********************************************
    \    Session timer
    \********************************************
    S.S.2,
    S1,
        #Z1: ---> S2
    
    S2,
        0.01": SET S = S + 0.01; SHOW 1, Session Timer, S;
               IF S >= A(^sessionTimer) [@T, @F]
                    @T: Z2 ---> S1
                    @F: ---> SX
    
    \**********************************************
    \   Bin timer
    \**********************************************
    S.S.3,
    S1,
        #Z1:  ---> S2
    
    S2,
        0.01": SET T = T + 0.01; SHOW 6, Bin Timer, T;
               IF T >= A(^binTimer) [@T, @F]
                    @T: ADD E; SET T = 0;
                        SET B(E) = 0, C(E) = 0;
                        SET B(E+1) = -987.987, C(E+1) = -987.987---> S2
                    @F: ---> SX
    
    \*********************************************
    \    Record licks & IRT timer
    \*********************************************
    S.S.4,
    S1,
        #Z1: ---> S2
    
    S2, \Record right licks
        #R^rightLick: ADD F;
                      SET D(F) = S;
                      SET D(F+1) = -987.987;
                      ADD B(E);
                      SET I(J) = R;
                      ADD J; SET I(J) = -987.987;
                      SET R = 0 ---> S2
    
        \Record left licks
        #R^leftLick: ADD H;
                     SET G(H) = S;
                     SET G(H+1) = -987.987;
                     ADD C(E);
                     SET I(J) = R;
                     ADD J; SET I(J) = -987.987;
                     SET R = 0 ---> S2
    
        0.01": SET R = R + 0.01; SHOW 8, IRT Timer, R ---> SX
    
    \******************************************
    \    Update the display
    \********************************************
    S.S.31,
    S1,
        0.1": SHOW 2, Total Right Licks, F;
              SHOW 3, Total Left Licks, H;
              SHOW 7, Bin Number, E ---> SX
    
    \*********************************************
    \   End program
    \********************************************
    S.S.32,
    S1,
        #Z2: ---> S2
    
    S2,
        1": ---> STOPABORTFLUSH
    
Viewing 1 post (of 1 total)