Changeover Delay (again)

MEDState Notation Repository Forums Coding Help Archive Changeover Delay (again)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13199
    Med_Support
    Moderator
    AlcoholLab

    Here is our concurrent VI with a COD programmed into it. We can’t get the COD to work, however. Any suggestions?

    \Short Train Concurrent
    \Created 11/28/07
    
    \Outputs
    ^Houselight = 7
    ^LeftLever = 2
    ^LeftBottle = 6
    ^RightLever = 1
    ^RightBottle = 5
    
    \Inputs
    ^LeftLever = 1
    ^LeftLick = 4
    ^RightLever = 2
    ^RightLick = 3
    
    \Define Variables
    \A = # of Left Lever Presses
    \B = # of Left Reinforcers
    \C = Data Array Variables
    \.1 = LeftLever
    \.2 = LeftReinforcer
    \.3 = LeftLick
    \.4 = RightLever
    \.5 = RightReinforcer
    \.6 = RightLick
    \D = # of Left Licks
    \E = Left VI value (output array)
    \F = Right VI value (output array)
    \G = # of Right Lever Presses
    \H = # of Right Reinforcers
    \I = # of Right Licks
    \J
    \K
    \L = Dummy
    \M = Dummy
    \N = Dummy
    \O = Dummy
    \P = Dummy
    \Q = Total number of events
    \R
    \S
    \T = Timer, incremented in hundredths of seconds
    \U
    \V
    \W
    \X = Current value of Left VI from array for that specific trial
    \Y = Current value of Right VI from array for that specific trial
    \Z
    
     
    
    \Pulse designations
    \Z1 = Start experiment
    \Z2 = Start data collection
    \Z3 = Reinforcer record left
    \Z4 = Reinforcer array left
    \Z5 = Reinforcer record right
    \Z6 = Reinforcer array right
    
    \Dimensions of arrays
    DIM C = 10000
    LIST E = 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8 \interval variables
    LIST F = 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8 \interval variables
    
    PRINTVARS = A, B, D, G, H, I
    
    S.S. 1, \instructions and operant chamber start
    S1,
    1": SHOW 1, LOAD, L ; SHOW 2, RAT, M ; SHOW 3, AND, N ; SHOW 4, ISSUE, O ; SHOW 5, START, P ---> S2
    S2,
    #START: CLEAR 1, 60;
    ON ^Houselight;
    ON ^LeftLever;
    ON ^RightLever; Z1; Z2 ---> SX
    
    S.S. 2, \ SessionTimer
    S1,
    #Z1: ---> S2
    S2,
    .01": ADD T ---> S2
    
    S.S. 3, \begin session and main VI logic (Left)
    S1,
    #Z1: ---> S2
    S2,
    .01": RANDD X = E; SHOW 1, LeftVI=, X*6; SET X = X*6" ---> S3
    S3,
    X#T: ---> S4
    S4,
    #R^LeftLever: ON ^LeftBottle; Z3; Z4 ---> S5
    S5,
    10": OFF ^LeftBottle ---> S2
    
    S.S. 4, \ Left Response count and display
    S1,
    #Z1: SHOW 2, LeftResp, A ---> S2
    S2,
    #R^LeftLever: ADD A; SHOW 2, LeftResp, A ---> S2
    
    S.S. 5, \Left Reward counter and display
    S1,
    #Z1: SHOW 3, LeftReinf, B ---> S2
    S2,
    #Z3: ADD B; SHOW 3, LeftReinf, B ---> SX
    
    S.S. 6, \Lick Counter
    S1,
    #Z1: SHOW 4, LeftLicks, D ---> S2
    S2,
    #R ^LeftLick: ADD D; SHOW 4, LeftLicks, D --->SX
    
    S.S. 7, \Right Data array control
    S1,
    #Z2: ---> S2
    S2,
    #R^LeftLever : ADD Q; SET C (Q+100)=T+.1; SET C (Q+101)= -987.987 --->S2
    #R^LeftLick : ADD Q; SET C (Q+100)=T+.3; SET C (Q+101)= -987.987 --->S2
    #Z4: ADD Q; SET C (Q+100)=T+.2; SET C (Q+101)= -987.987 --->S2
    
    S.S. 8, \begin session and main VI logic (Right)
    S1,
    #Z1: ---> S2
    S2,
    .01": RANDD Y = F; SHOW 5, RightVI=, Y*6; SET Y = Y*6" ---> S3
    S3,
    Y#T: ---> S4
    S4,
    #R^RightLever: ON ^RightBottle; Z5; Z6 ---> S5
    S5,
    10": OFF ^RightBottle ---> S2
    
    S.S. 9, \ Right Response count and display
    S1,
    #Z1: SHOW 6, RightResp, G ---> S2
    S2,
    #R^RightLever: ADD G; SHOW 6, RightResp, G ---> S2
    
    S.S. 10, \Right Reward counter and display
    S1,
    #Z1: SHOW 7, RightReinf, H ---> S2
    S2,
    #Z5: ADD H; SHOW 3, RightReinf, H ---> SX
    
    S.S. 11, \Right Lick Counter
    S1,
    #Z1: SHOW 4, RightLicks, I ---> S2
    S2,
    #R ^RightLick: ADD I; SHOW 4, RightLicks, I --->SX
    
    S.S. 12, \Right Data array control
    S1,
    #Z2: ---> S2
    S2,
    #R^RightLever : ADD Q; SET C (Q+100)=T+.4; SET C (Q+101)= -987.987 --->S2
    #R^RightLick : ADD Q; SET C (Q+100)=T+.6; SET C (Q+101)= -987.987 --->S2
    #Z6: ADD Q; SET C (Q+100)=T+.5; SET C (Q+101)= -987.987 --->S2
    
    S.S. 13, \COD logic
    S1,
    #Z1: ---> S2
    S2,
    #R^LeftLever: ---> S4
    #R^RightLever: ---> S3
    S3, \Left COD
    4" ---> S5
    #R^LeftLever: ---> S4
    S4, \Right COD
    4" ---> S6
    #R^RightLever: ---> S3
    S5, \Left Post COD
    #R^LeftLever: ---> S4
    S6, \Right Post COD
    #R^RightLever: ---> S3
    
    S.S. 14, \End Session
    S1,
    #Z1: ---> S2
    S2,
    30': PRINT ---> STOPABORTFLUSH
    
    #13200
    Med_Support
    Moderator
    Gary Bamberger

    The code below should do what you want. It will force a 4 second delay from when the animal gets a reward on one lever before they can receive the reward on the other lever.

    \ Short Train Concurrent
    \ Created 11/28/07
    
     
    
    \ Outputs
    ^RightLever = 1
    ^LeftLever = 2
    ^RightBottle = 5
    ^LeftBottle = 6
    ^Houselight = 7
    
    \ Inputs
    ^RightLever = 1
    ^LeftLever = 2
    ^RightLick = 3
    ^LeftLick = 4
    
     
    
    \ Define Variables
    \ A = # of Left Lever Presses
    \ B = # of Left Reinforcers
    \ C = Data Array Variables
    \ .1 = LeftLever
    \ .2 = LeftReinforcer
    \ .3 = LeftLick
    \ .4 = RightLever
    \ .5 = RightReinforcer
    \ .6 = RightLick
    \ D = # of Left Licks
    \ E = Left VI value (output array)
    \ F = Right VI value (output array)
    \ G = # of Right Lever Presses
    \ H = # of Right Reinforcers
    \ I = # of Right Licks
    \ J
    \ K
    \ L
    \ M
    \ N
    \ O
    \ P
    \ Q = Total number of events
    \ R
    \ S
    \ T = Timer, incremented in hundredths of seconds
    \ U
    \ V
    \ W
    \ X = Current value of Left VI from array for that specific trial
    \ Y = Current value of Right VI from array for that specific trial
    \ Z
    
     
    
    \ Z-Pulse designations
    \ Z1 = Start experiment
    \ Z3 = Reinforcer record left
    \ Z5 = Reinforcer record right
    
     
    
    \ Dimensions of arrays
    DIM C = 10000
    LIST E = 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8 \ Interval variables
    LIST F = 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8 \ Interval variables
    
     
    
    PRINTVARS = A, B, D, G, H, I
    
     
    
    S.S.1, \ Instructions and operant chamber start
    S1,
    1": SHOW 1,LOAD,0, 2,RAT,0, 3,AND,0, 4,ISSUE,0, 5,START,0 ---> S2
    
    S2,
    #START: CLEAR 1,60;
    ON ^Houselight, ^LeftLever, ^RightLever; Z1 ---> SX
    
     
    
    S.S.2, \ SessionTimer
    S1,
    #Z1: ---> S2
    
    S2,
    0.01": ADD T ---> S2
    
     
    
    S.S.3, \ Begin session and main VI logic (Left)
    S1,
    #Z1: ---> S2
    
    S2,
    0.01": RANDD X = E; SHOW 1,LeftVI=,X*6; SET X = X * 6" ---> S3
    
    S3,
    X#T: ---> S4
    
    S4, \ Check if COD has completed
    #R^LeftLever: IF S.S.4 = 1 [@True, @False]
    @True: ON ^LeftBottle; Z3 ---> S5
    @False: ---> S4
    
    S5,
    10": OFF ^LeftBottle ---> S2
    
     
    
    S.S.4, \ COD of 4" after Right Reward
    S1,
    #Z5: ---> S2
    
    S2,
    4": ---> S1
    
     
    
    S.S.5, \ Left Response count and display
    S1,
    #Z1: SHOW 2,LeftResp,A ---> S2
    
    S2,
    #R^LeftLever: ADD A; SHOW 2,LeftResp,A ---> S2
    
     
    
    S.S.6, \ Left Reward counter and display
    S1,
    #Z1: SHOW 3,LeftReinf,B ---> S2
    
    S2,
    #Z3: ADD B; SHOW 3,LeftReinf,B ---> SX
    
     
    
    S.S.7, \ Lick Counter
    S1,
    #Z1: SHOW 4,LeftLicks,D ---> S2
    
    S2,
    #R^LeftLick: ADD D; SHOW 4,LeftLicks,D ---> SX
    
     
    
    S.S.8, \ Right Data array control
    S1,
    #Z1: ---> S2
    
    S2,
    #R^LeftLever: ADD Q; SET C(Q+100) = T + 0.1, C(Q+101) = -987.987 ---> S2
    #R^LeftLick: ADD Q; SET C(Q+100) = T + 0.3, C(Q+101) = -987.987 ---> S2
    #Z3: ADD Q; SET C(Q+100) = T + 0.2, C(Q+101) = -987.987 ---> S2
    
     
    
    S.S.9, \ Begin session and main VI logic (Right)
    S1,
    #Z1: ---> S2
    
    S2,
    0.01": RANDD Y = F; SHOW 6,RightVI=,Y*6; SET Y = Y * 6" ---> S3
    
    S3,
    Y#T: ---> S4
    
    S4, \ Check if COD has completed
    #R^RightLever: IF S.S.10 = 1 [@True, @False]
    @True: ON ^RightBottle; Z5 ---> S5
    @False: ---> S4
    
    S5,
    10": OFF ^RightBottle ---> S2
    
     
    
    S.S.10, \ COD of 4" after Left Reward
    S1,
    #Z3: ---> S2
    
    S2,
    4": ---> S1
    
     
    
    S.S.11, \ Right Response count and display
    S1,
    #Z1: SHOW 7,RightResp,G ---> S2
    
    S2,
    #R^RightLever: ADD G; SHOW 7,RightResp,G ---> S2
    
     
    
    S.S.12, \ Right Reward counter and display
    S1,
    #Z1: SHOW 8,RightReinf,H ---> S2
    
    S2,
    #Z5: ADD H; SHOW 8,RightReinf,H ---> SX
    
     
    
    S.S.13, \ Right Lick Counter
    S1,
    #Z1: SHOW 9,RightLicks,I ---> S2
    
    S2,
    #R^RightLick: ADD I; SHOW 9,RightLicks,I ---> SX
    
     
    
    S.S.14, \ Right Data array control
    S1,
    #Z1: ---> S2
    
    S2,
    #R^RightLever: ADD Q; SET C(Q+100) = T + 0.4, C(Q+101) = -987.987 ---> S2
    #R^RightLick: ADD Q; SET C(Q+100) = T + 0.6, C(Q+101) = -987.987 ---> S2
    #Z5: ADD Q; SET C(Q+100) = T + 0.5, C(Q+101) = -987.987 ---> S2
    
     
    
    S.S.15, \ End Session
    S1,
    #Z1: ---> S2
    
    S2,
    30': PRINT ---> STOPABORTFLUSH
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.