Dual lickometer .mtp file

MEDState Notation Repository Forums Coding Help Archive Dual lickometer .mtp file

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13887
    pgrachev
    Participant

    Hello,

    I have so far not been successful in writing either a row or table profile for the interpretation of raw lickometer data using Med-PC to Excel. The code for the lickometers is modified from Gary’s original submission, and is as follows:

    \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

    Could somebody please help me?

    Thanks in advance,

    Pasha Grachev

    #13889
    Gary Bamberger
    Moderator

    Hello Pasha,

    First lets start with what SoftCR code is.  SoftCR code consists of two pieces of data: a Time Component and a Data Component or Control Code.

    The number before the decimal point is the Time Component.  It is keeping track of how much time has passed since the previous data element was recorded (Relative Data Mode).  In your program the value is being incremented every 10ms:

    0.01": SET R = R + 0.01; SHOW 8, IRT Timer, R ---> SX

    So if for example the number before the decimal point was 223, then

    223 * 0.01 = 2.23s

    has passed since the previous data element was recorded.

    The number after the decimal point is the Data Component or the Control Code.  It is coded in a very special way.

    The first number after the decimal point is the Control Code that is to be marked.  For example a Control Code value of .1 is a Step/Response.

    The second number after the decimal point is the Trace Line that is to be used.  There are 10 Trace Lines (0 – 9).

    All SoftCR Control Codes work this way.

    .1 = Step
    .2 = Pip
    .3 = Reset Trace Pen
    .5 = Lower Event Pen
    .6 = Raise Event Pen

    Trace Pens are in the upper window and Event Pens are in the lower window of SoftCR and SoftCR Pro.  Control Codes 1, 2, and 3 affect Trace Pens only.  Control Codes 5 and 6 affect Event Pens only.

    A Step is commonly recorded when the Animal does a response and a Pip is commonly recorded when a reinforcement is issued.

    Now in your program you have the following:

    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

    You are setting I(J) = R so you have a Time Component, but have no Data Component/Control Code.

    You would need to modify the statement to include the Data Component:

    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 + 0.10; \ Add a Step 0 for each RL
    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 + 0.11; \ Add a Step 1 for each LL
    ADD J; SET I(J) = -987.987;
    SET R = 0 ---> S2

    0.01": SET R = R + 0.01; SHOW 8, IRT Timer, R ---> SX

    With the changes above you now have valid SoftCR code in Array I for SoftCR or SoftCR Pro to read.

    I hope that this helps.
    Gary

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