Food magazine exit for ITI start

MEDState Notation Repository Forums Coding Help Archive Food magazine exit for ITI start

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13897
    Bastiaan
    Participant

    Hello,

    I am trying to create a protocol for the 5 choice serial reaction time task where an exit from the food magazine triggers the onset of the new trial (Thus the start of the ITI).
    Since some of my animals manage to stay in the magazine for a period that spans multiple ITI phases, increasing the number of omissions (regardless of their attention to the wall).

    The main issue is that due to occupancy of the system, and the multitude of protocols which are run in the operant boxes, I am not allowed to change the toggle mode to the level mode.

    Is there an alternative programming option that circumvents switching from Toggle to Level mode?

    #13898
    Gary Bamberger
    Moderator

    You would need some additional hardware.

    If you split the signal from the head entry and send it to another input and then invert that input, you can receive a second input when the animal retracts his head.

    This would give you an input on 6 when the animal breaks the head entry beam and an input on 7 when the animal releases the head entry beam.

    I hope that this helps.

    Gary

    #13899
    Bastiaan
    Participant

    Hi Gary,

    Many thanks.
    I have been thinking, would it also be possible just to invert the polarity, without splitting the signal?
    For most of our tests it does not matter, or would even be better, if the input is registered when the animal releases the head entry beam. For the few other tests the head entry triggers a counter for the magazine light, this would simply have to be re-written.

    Best,

    Bas

    #13900
    Gary Bamberger
    Moderator

    Hi Bas,

    That might work. Being in Toggle mode you would only get one input when the head entry is released.

    I would recommend clearly marking the card somehow indicating that the input polarity has been reversed. Even if you want to know when the head entry has been released now, there might be a time in the future when the delay to the head entry, or the time of the head entry is the desired piece of data.

    Gary

    #13901
    Bastiaan
    Participant

    Hi Gary,

    After some consideration I remembered this would not be an option afterall. Since the reward latency is a read out we do not want to lose.

    I have tried to implement the beambreak code (which you suggested to someone else) into the Start of New ITI (see code). For we have decided that switching to Level might in the end be the better option, also for our other protocols, as this lets us track the amount of time spend in the magazine.

    \**********************
    \*  START OF NEW ITI  *
    \**********************
    S.S.3,
    S1,
    #z9: SET J=0; IF ((A(0)+A(1)+A(2))>=S(4)) [@MaxTrials, @NotMaxTrials]
    @MaxTrials: OFF ^Fan, ^HouseLight; SET U(V) = -987.987; SET E(V) = -987.987; SET F(D) = -987.987 ---> STOPABORTFLUSH
    @NotMax Trials: z11; ADD A(9); SHOW 8,Trials,A(9) ---> s2
    
    	
    S2,       #R1: ADD I; IF I >= 2 [@BeamBreak, @NoBeamBreak]
                     @Break: Z14; SET Y = 0 ---> S3
                     @NoBreak: ---> SX
      0.02": SET I = 0 ---> S2
    
    S3,    
      0.02": Z15 ---> S2
      #R1: ---> S3 
    
    S4,
    #Z14: SET L = 0 ---> S5
    
    S5,
    0.01": SET L = L + 0.01 ---> S5
    #Z15: SET A(16) = A(16) + L ---> S4
    
    s6,
    #Z15: ADD J; IF(J>=S(2)) [@EndOfITI, @ContinueITI]
    @EndOfITI: RANDD C = N; IF(C=1) [@OneCorrect, @OneNotCorrect]
    @OneCorrect: ON ^LightOne; z1 ---> s1
    @OneNotCorrect: IF(C=2) [@TwoCorrect, @TwoNotCorrect]
    @TwoCorrect: ON ^LightTwo; z1 ---> s1
    @TwoNotCorrect: IF(C=3) [@ThreeCorrect, @ThreeNotCorrect]
    @ThreeCorrect: ON ^LightThree; z1 ---> s1
    @ThreeNotCorrect: IF(C=4) [@FourCorrect, @FiveCorrect]
    @FourCorrect: ON ^LightFour; z1 ---> s1
    @FiveCorrect: ON ^LightFive; z1 ---> s1
    @ContinueITI: ---> sx
    #z6: ---> s1

    I have however left all other #R1 commands unchanged. As triggering the receptacle should automatically send the program to a new state.
    Would this work, or would I have to change all #R1 commands into an IF clausule?

    Bas

    #13902
    Gary Bamberger
    Moderator

    I don’t have all of the code to your program so it is a little hard to answer.

    The 5CSRT program normally uses input 6 for the head entry. It looks like you are using input 1.

    In other portions of the code head entries are just counted. (Ex: During timeouts, etc.) If you leave that code looking for the #R1, then the program will count an input for as long as the head entry is held.

    You will want to change those inputs over so that they are looking for the Z-pulse instead.

    Finally in this code:

    S2,
      #R1: ADD I; IF I >= 2 [@BeamBreak, @NoBeamBreak]
                     @Break: Z14; SET Y = 0 ---> S3
                     @NoBreak: ---> SX
      0.02": SET I = 0 ---> S2

    You will want to change the SET Y = 0 to be SET I = 0.

    I hope that this helps.

    Gary

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.