Cocaine Yoked

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14817
    IOP
    Participant

    Hello,

    Ineed help with this code. The program is just doing the first infusion at the time specified at the List K, everything works at is supposed to do (nosepoke light on, tone on, and house light off) but then the program is not picking any other numbers of the list K.

    Any comment ot input is welcome!

    Thanks.

    IOP

    \Cocaine Yoked

    \2018

    \The animals will get cocaine infusions from a time list, paired with a tone and right NP port yellow light both on for 5 seconds
    \ House ligt is on and at the infusion time it will be off for 20 seconds (moking time out)
    \ Fan is always on
    \ 60-minute session

    \ This section is for Outputs

    ^Tone = 5
    ^Houselight = 6
    ^RightNPlight = 12
    ^Pump= 8
    ^Fan = 16

    \ Defined Variables

    \ P = pump on – infusion rewards
    \ K = infusions array
    \ N = session timer
    \ M = max time minutes
    \ S = seconds
    \ T = event timestamp
    \ E = event identity stamp
    \ 8 = Pump delivery

    DIM E = 6000
    DIM T = 6000

    LIST K = 9, 45, 60, 130, 180, 300

    S.S.1 \ Session start, Infusion, Right NP light on , Tone on, House lifgt off *******************

    S1,
    .01″:ON^Fan —> S2

    S2,
    #START:ON^Houselight; Z1 —>S3

    S3,
    #Z1: LIST X = K(F); SET X = X * 1″; X —>S4

    S4,
    X#T: ON^Pump, ^RightNPlight, ^Tone; Z2 —>S5

    S5,
    #Z2: OFF^Houselight —>S6

    S6,
    5″ :OFF^Pump, ^RightNPlight, ^Tone —>S7

    S7,
    15″: ON^Houselight; Z1 —>S2

    S.S.2, \ Infusion counter ********************

    S1,
    #START: SHOW 2,infusions,P —> S2

    S2,
    #Z2: ADD P; SHOW 2,infusions,P —> SX

    S.S.3, \ Session lengh ******************

    S1,
    #START: —> S2

    S2,
    60′: —> STOPABORTFLUSH

    #14818
    Gary Bamberger
    Moderator

    Hello Idaira,

    In S.S.1, S7 you send the program back to S2. S2 is waiting for a START command. I think that you want the program to go to S3:

    S7,
      15": ON ^Houselight; Z1 ---> S3

    I hope that this information helps.

    Gary

    #14819
    IOP
    Participant

    Hi Gary,

    Thanks for your response. When I tried your coding the program repeated the 9″ infusion over an over. I dont know if there is any other issue with my defined variables…

    #14820
    Gary Bamberger
    Moderator

    I just ran it and watched it step through the values in LIST K in order. Add this SHOW statement to the program so that you can see the values change:

    S3,
      #Z1: LIST X = K(F); SHOW 1,X=,X;
           SET X = X * 1" ---> S4

    Gary

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