Med_Support
Forum Replies Created
-
AuthorPosts
-
Med_Support
Moderatorpmallet
Thanks for the quick reply Gary. I am not familiar with programming in pascal, but I will look into it.
Med_Support
ModeratorGary Bamberger
There are no MedState Notation or Macro commands that are designed to send an email. Your best bet is to write a function in the User.pas or maybe the Backproc.pas that can send the email.
Gary
January 21, 2017 at 6:13 pm in reply to: Dual lever- with different punishment time and reward amount #12779Med_Support
Moderatorc_salcido
Ok, so this is what i currently have for the dual levers coming out at the same time, but have no idea how to extend it for the left lever having lets say 4 pellets and a wait time of 40 secs or right lever with 1 pellet 5 secs of wait time until the both levers can come out again so the animal may choose.
Thanks in advance!\Dual lever \Written by C. Salcido \ INPUTS ^LeftLever = 7 ^RightLever = 6 \ OUTPUTS ^Dispenser = 8 ^LeftLight = 10 ^RightLight = 9 ^HouseLight = 12 \ CONSTANTS \ A = Lever Presses \ B = Rewards \ C = Failures \ D = Trial Number \ X = Time \ Y = Data Array DIM Y=59 \Basic FR Logic S.S.1, S1, #START: ON^RightLever; ON^LeftLever; On^HouseLight; On^RightLight; On^LeftLight; Z3 ---> S2 S2, #R^RightLever: ON^Pellet; OFF ^RightLever, ^RightLight, ^LeftLever, ^LeftLight; Z1 ---> S3 #R^LeftLever: ON^Pellet; OFF ^LeftLever, ^LeftLight, ^RightLever, ^RightLight; Z1 ---> S3 S3, 1#Z4: ON ^RightLever, ^RightLight, ^LeftLever, ^LeftLight, ---> S2 \Scoring a reward S.S.2, S1, #START: SHOW 2, RIGHTLEVER,R ---> S2 #START: SHOW 1, LEFTLEVER,L ---> S2 S2, #R^RIGHTLEVER: ADD R; SHOW 2,RIGHTLEVER,R ---> SX #R^LEFTLEVER: ADD L; SHOW 1,LEFTLEVER,L ---> SX S3, 0.05": OFF^Pellet ---> S2 \Scoring for a lever press in less than 10 seconds S.S.3, S1, #START: SHOW 2, RIGHTLEVER,R ---> S2 #START: SHOW 1, LEFTLEVER,L ---> S2 S2, #R^RIGHTLEVER: ADD R; SHOW 2,RIGHTLEVER,R ---> SX #R^LEFTLEVER: ADD L; SHOW 1,LEFTLEVER,L ---> SX \Scoring for a failure-to-press in less than 10 seconds S.S.4, S1, #START: SHOW 3, Failures, C ---> S2 S2, #Z2: ADD C; Show 3, Failures, C ---> S2 \Experiment Timer S.S.5, S1, #START: ---> S2 S2, 30': ---> STOPABORTFLUSH \Trial Timer S.S.6, S1, #START ---> S2 S2, 10.1": IF X>=10 [@True, @False] @True: Z2; SET Y(I)=X, X=0; ADD I ---> S3 @False: ---> S3 #Z1: ---> S3 S3, #Z4: ---> S2 \Trial Counter S.S.7, S1, #START: SET D=1; Show 4, Trial Number, D ---> S2 S2, #Z4: ADD D; Show 4, Trial Number, D ---> SX \ Recording IRT's S.S.8, S1, #START ---> S2 S2, #Z1: SET Y(I)=X, X=0; ADD I ---> SX \X Timer S.S.9 S1, #START ---> S2 S2, .1": SET X=X+.1; SHOW 5, X, X ---> SX #Z4: SET X = 0 ---> SX \ Another Trial Timer S.S.10, S1, #START: ---> S2 S2, 30": Z4 ---> S2
Med_Support
ModeratorAude
Dear Gary!
Thank you so much for your SUPER FAST answer! As I am in UK I will test the code tomorrow and let you know any way!!!
Med_Support
ModeratorThe following code should do what you want:
\ Outputs ^Pellet = 3 \ A() = Control Variable with Assigned Aliases as Defined Var_Alias Number of Pellets to Dispense = A(0) \ Default = 20 ^NumPellets = 0 DIM A = 1 \ Z-Pulses Used in this Program ^Z_Reward = 1 \ Z1 = Signal Reinforcement \*************************************************** \ PELLET DISPENSER CONTROL \*************************************************** S.S.2, S1, 0.01": SET A(^NumPellets) = 20 ---> S2 S2, \ Wait for Reinforcement Signal #Z^Z_Reward: ON ^Pellet; ADD P ---> S3 S3, \ Check if delivered desired Number of Pellets 0.05": OFF ^Pellet; IF P >= A(^NumPellets) [@Done, @More] @Done: SET P = 0 ---> S2 @More: ---> S4 S4, \ Must wait a certain amount of time before \ trying to dispense the next pellet. This \ delay can be shortened for some Pellet \ Dispensers. 0.5": ON ^Pellet; ADD P ---> S3Med_Support
ModeratorColoSAuser
It works wonderfully and is quite simple. I tried generating a list, but did not incorporate it into its own State Set. Thanks for your help.
Med_Support
ModeratorGary Bamberger
Hello,
The easiest way would be to create a list with the times and then a State Set that draws from those times every 30 minutes. S.S.1, S1 & S2 will also need to be modified:
LIST Z = 7.5", 5", 2.5", 1.25", 0" S.S.1, S1, 0.001": SET A(^CorrectLev) = 1, A(^Reinforcer) = 3; SET A(^TimeOut) = 20, A(^SessionTime) = 240, A(^FRVal) = 1; SET A(^MaxReinf) = 150, A(^SoftCR) = 1; SET J = 5, B(J) = -987.987 ---> S2 S2, \ First Statement: Wait for START signal, turn HouseLight ON, \ test for Correct Lever and turn associated stimulus ON. \ \ Second Statement: Update screen display with default values \ for Control Variables. This will show any changes made via \ the "Configure | Change Variables" Window prior to START. #START: CLEAR 1,60; SET A(^TimeOutTicks) = A(^TimeOut) * 1"; SET B(J+^Trial) = 1, B(J+^NextTrial) = -987.987; SHOW 2,Tot Cor Rsp,B(^CorrectResp), 3,Tot Incor Rsp,B(^IncorrectResp), 4,Reinforcers,F; SHOW 6,Trial #,B(J+^Trial), 7,Cor Rsp,B(J+^CorrectResp), 8,Incor Rsp,B(J+^IncorrectResp); ON ^HouseLight, ^LeftLever, ^RightLever; LOCKON ^Fan ---> S3 1": SHOW 1,Lever Code,A(^CorrectLev), 2,Reinforcers,A(^Reinforcer); SHOW 4,Time Out,A(^TimeOut), 5,Session Time,A(^SessionTime), 6,FR Value,A(^FRVal); SHOW 7,Max Reinforcers,A(^MaxReinf), 8,SoftCR Code,A(^SoftCR) ---> SX S.S.14, S1, #START: LIST A(^ReinfTimeTicks) = Z(K); SHOW 11,Reinforcer Time,A(^ReinfTimeTicks)/1" ---> S2 S2, 30': LIST A(^ReinfTimeTicks) = Z(K); SHOW 11,Reinforcer Time,A(^ReinfTimeTicks)/1" ---> SX #Z^Z_End: ---> S1I hope that this helps.
GaryMed_Support
ModeratorThe SUMARRAY command takes four parameters.
The 1st is the variable that you want the summed value to be placed into. In your case this is the variable S.
The 2nd is the array that you want summed. In your case this is the array U.
The 3rd is the location in the array where the summing should begin. Most of the time this is 0, but it does not have to be.
The 4th is the location in the array where the summing should end. Most of the time this is the last element in the array, but it does not have to be.So if you are trying to sum up the results from the last 10 trials in array U, then the command would be:
SUMARRAY S = U,0,9
Another thing that I just noticed is in S4 you are checking IF K > 11 [@Reset, @Continue]
If you are trying to sum up the results from the last 12 trials, then this is correct.
If you are trying to sum up the results from the last 10 trials, then you will want to change this to IF K >= 10 [@Reset, @Continue]If you are trying to sum up the results from the last 12 trials in array U, then the command would be:
SUMARRAY S = U,0,11
If that doesn’t solve the problem, then please email me the entire program and I will be happy to take a look at it for you.
Best Regards,
GaryMed_Support
Moderatorvestela
The value I comes from the Trans IV translator help about SumArray: “Notice that a variable, I, is used in the call to HarmonicMean to indicate the last element in the C array that should be included in the calculation. Variable I tracks the number of completed ratios and is incremented after the call to HarmonicMean.” (It’s the only example included for the statistical commands)
Also, if I try to take it out, I get errors that “A constant is missing ‘^’ or undeclared constant or attempt to change the value of a constant”
I took out that K = 0 from S3, but it still isn’t working. Should I email you the entire file of code?
Thank you for your help.
Med_Support
ModeratorGary Bamberger
Hi,
I think that the problem is in S3. Every single time that state executes you are setting K = 0. So you are always assigning the value to U(0).
In S5 I am not certain where the value I comes from. It may be set elsewhere in your code and contain the correct value, but I can’t tell from the code snippet that you included.
Please let me know if this information helps or if you still have problems.
Best Regards,
GaryMed_Support
ModeratorGary Bamberger
Hi Andy,
I don’t think what you want is possible. Your best bet is to write your program to run both procedures. When the program starts it runs the FR5. After the FR5, the program would then time the delay and then move onto the PR. The delay can be a Var_Alias or even calculated at run time based on some equation and/or the animals performance with the FR5.
For the data it would be best if each procedure used different variables. At the end of each session use the FLUSH command to save the data to disk.
It is not exactly what you are looking for, but it is the closest that I can come up with.
I hope that this information helps. Please let me know if I can help you in any other way.
Best Regards,
GaryMed_Support
ModeratorGary Bamberger
Re: #R as an IF Condition
Reply #2 on: December 01, 2016, 11:49:05 amNot certain what you are trying to accomplish here. You can
have more than one input in a State so it is possible to know
if the response was a Left Lever Press or a Right Lever Press:S5,
#R^LeftLever: —> S6 \ Correct Response
#R^RightLever: —> S7 \ Incorrect ResponseYou can even have the Right Lever Press arrow back to
S5 with —> SX or —> S5.I hope that this information helps. In order to give you a more
specific answer I would need to know exactly what you are
trying to do.Gary
Med_Support
ModeratorJon Beyor
No, that is not a valid IF statement.
-
This reply was modified 8 years, 9 months ago by
Med_Support.
-
This reply was modified 8 years, 9 months ago by
Med_Support.
-
This reply was modified 8 years, 9 months ago by
Med_Support.
-
This reply was modified 8 years, 9 months ago by
Med_Support.
-
This reply was modified 8 years, 9 months ago by
Med_Support.
October 7, 2016 at 9:02 am in reply to: Time to first response, but excluding cases when response is already active #12717Med_Support
ModeratorJim Frei
Hi Aaron,
Unfortunately without the rest of the code I cannot say for sure what the problem is, but I am thinking S2 should actually be:
S2, 0.1": IF Q > 0 [@Break, @NoBreak]
Assuming that Q is set to something > 0 when a beam break is occurring and set to back to 0 when the beam is not broken.
If that does not help you will need to post or send the rest of the code for me to check out. You can post it here or email it to me at support@med-associates.com
Take care,
Jim
Med_Support
ModeratorJim Frei
Hi BethAnn,
Please see the email i sent you.
Thank you,
Jim
Med_Support
ModeratorJim Frei
Hi BethAnn,
I will reply to your email that you sent in.
Jim
Med_Support
ModeratorGary Bamberger
The data looks fine to me:
\ B() = Response Counts
\ B(0) = Total Responses
\ B(1) = Total Correct Response Count
\ B(2) = Total Incorrect Response Count
\ B(3) = Total Rewards
\ B(4) = % Correct
\ B(5) = % Incorrect
\ B(6) = Last PR Value that was Met\ D(0) = Total Responses on Left Lever
\ D(1) = Total Responses on Right Lever
\ D(J) = Responses on Left Lever this Time Bin
\ D(J+1) = Responses on Right Lever this Time BinB:
0: 23.000 13.000 \ 23 Total Responses 13 Correct Right Responses
2: 10.000 4.000 \ 10 Incorrect Left Responses 4 Rewards Earned
4: 0.000 0.000
6: 6.000 \ 6 = Last Progressive Ratio value that was met\ Left Lever Right Lever
D:
0: 10.000 15.000 \ Totals
2: 6.000 4.000 \ 1st Minute
4: 4.000 11.000 \ 2nd MinuteThe reason that the total is higher in the D Array is that there must have been 2 responses on the right lever during the reward (S.S.2, S3) or Timeout (S.S.2, S4).
S.S.7 does not care what State S.S.2 is in. It just counts all responses.
I hope that this information helps.
Best Regards,
GaryMed_Support
Moderatorandersem
Thank you for the help!
…
This might be a silly question again. I am doing the exact same thing with the same program just using the R lever as the active lever. It seems to be adding a count to the Right lever counts. Here is the code:
\ Inputs
^LeftLever = 1
^RightLever =3
\ Outputs
^Pellet = 3
^LeftLight = 4
^LeftLeverOperate= 1
^HouseLight = 7
^Fan = 9
^RightLight = 5
^RightLeverOperate = 2\ A() = Control Variables with Assigned Aliases as Defined
Var_Alias Session Length (min) = A(0) \ Default = 300 minutes
Var_Alias Correct Lever (1=Left 2=Right) = A(1) \ Default = 2-Right
Var_Alias Reward Device (1=Pellet 2=Dipper 3=Pump) = A(2) \ Default = 1-Pellet
Var_Alias Reward Time (sec) = A(3) \ Default = 0.05 seconds
Var_Alias Time Out Following Reward (sec) = A(4) \ Default = 20 seconds
Var_Alias SoftCR Data Array (1=Yes 0=No) = A(5) \ Default = 1-Yes^Session = 0
^CorrectLev = 2
^RewardDevice = 1
^RewardTime = 3
^TimeOut = 4
^SoftCR = 5
^RewardTicks = 6
^TimeOutTicks = 7\ List Data Variables Here
\ B() = Response Counts
\ B(0) = Total Responses
\ B(1) = Total Correct Response Count
\ B(2) = Total Incorrect Response Count
\ B(3) = Total Rewards
\ B(4) = % Correct
\ B(5) = % Incorrect
\ B(6) = Last PR Value that was Met\ List Working Variables Here
\ I = Subscript for the IRT Array C
\ P = Current PR Value
\ R = Ratio Response Counter
\ S = Elapsed Time in Session
\ X = Subscript for Progressive Ratio List Z
\ Z() = Progressive Ratio Default ListDIM A = 7
DIM B = 6LIST Z = 1, 2, 4, 6, 9, 12, 15, 20, 25, 32, 40, 50, 62, 77, 95, 118, 145, 178, 219, 268, 328, 402, 492, 603, 737, 901, 1102, 1347, 1646, 2012
\ Z-Pulses Used in this Program
^Z_Pellet = 1 \ Signal Pellet Reinforcement
^Z_Dipper = 2 \ Signal Dipper Reinforcement
^Z_Pump = 3 \ Signal Pump Reinforcement
^Z_EndReward = 4 \ Signal End of Reward
^Z_End = 32 \ Signal End of SessionDIM D = 5000
\ D(0) = Total Responses on Left Lever
\ D(1) = Total Responses on Right Lever
\ D(J) = Responses on Left Lever this Time Bin
\ D(J+1) = Responses on Right Lever this Time Bin\ J = Index into Time Bin Array D
\***************************************************
\ Progressive Ratio Schedule
\ S1 – Set Default Values
\ Session Length (300 minutes)
\ Correct Lever (1-Left)
\ Reward Device (1-Pellet)
\ Reward Time (0.05 seconds)
\ Time Out Following Reward (20 seconds)
\ SoftCR Data Array (1-Yes)
\***************************************************
S.S.1,
S1,
0.01″: SET A(^Session) = 300, A(^CorrectLev) = 2, A(^RewardDevice) = 1;
SET A(^RewardTime) = 0.05, A(^TimeOut) = 20, A(^SoftCR) = 1 —> S2
S2,
0.001″: ON ^fan —> S3
S3, \ First Statement: Wait for START signal, turn HouseLight ON
\ and turn associated stimulus ON.
\
\ Second Statement: Update screen display with default values
\ for Control Variables. This will show any changes made via
\ the “Configure | Change Variables” Window prior to START.
#START: CLEAR 1,200;
SET A(^RewardTicks) = A(^RewardTime) * 1″;
SET A(^TimeOutTicks) = A(^TimeOut) * 1″;
ON ^HouseLight, ^RightLight, ^LeftLever, ^RightLeverOperate;
SHOW 1,Session,S —> S4
1″: SHOW 1,Session Length,A(^Session), 2,Correct Lever,A(^CorrectLev), 3,Reward Device,A(^RewardDevice);
SHOW 4,Reward Time,A(^RewardTime), 5,Time Out,A(^TimeOut), 6,SoftCR Code,A(^SoftCR) —> SXS4, \ Time Session Length
0.01″: SET S = S + 0.01;
SHOW 1,Session,S;
IF S/60 >= A(^Session) [@EndSession, @ContinueTiming]
@End: Z^Z_End —> S5
@Cont: —> SXS5, \ Wait for Screen Update and end with
\ STOPABORTFLUSH for Automatic Data Saving
2″: —> STOPABORTFLUSH\***************************************************
\ MAIN PROGRAM
\***************************************************
S.S.2,
S1, \ Draw first Progressive Ratio from List Z
#START: LIST P = Z(X) —> S2S2, \ Test for Correct Lever
#R(^Rightlever): ADD B(0), B(1), R;
IF R >= P [@PR_Value_Met, @False]
@PR_Met: ADD B(3);
SET B(6) = P, R = 0;
ZA(^RewardDevice) —> S3
@False: —> SX
#R^leftLever: ADD B(0), B(2) —> SX
#Z^Z_End: —> S5S3, \ Wait for End of Reward Signal
#Z^Z_End: —> S5
#Z^Z_EndReward: —> S4S4, \ Time Out Interval Following Reward
\ Update Progressive Ratio P from LIST Z
A(^TimeOutTicks)#T: ON ^HouseLight, ^RightLight, ^LeftLeverOperate, ^RightLeverOperate;
LIST P = Z(X) —> S2
#Z^Z_End: —> S5S5, \ End of Session – Turn Lights Off
\ Calculate % Correct and % Incorrect
0.01″: OFF ^HouseLight, ^RightLight, ^LeftLeverOperate, ^RightLeverOperate;
IF B(0) = 0 [@NoCalc, @Calculate]
@NoCalc: —> S6
@Calculate: SET B(4) = B(1) / B(0) * 100;
SET B(5) = B(2) / B(0) * 100;
SHOW 7,% Correct,B(4), 8,% Incorrect,B(5), 10,Last PR Met,B(6) —> S6S6, \ Holding State at End of Session
1′: —> SX\***************************************************
\ REWARD CONTROL TIMER
\***************************************************S.S.3,
S1,
60′: Z^Z_End —> STOPABORTFLUSH \ End if no reward received in 60 minutes
#Z^Z_Pellet: ON ^Pellet;
OFF ^HouseLight, ^LeftLeverOperate, ^RightLight, ^RightLeverOperate —> S2S2, \ Time Reward Device for A(^RewardTime) seconds
\ Default value set in S.S.1, S1 & S2
A(^RewardTicks)#T: OFF ^Pellet;
Z^Z_EndReward —> S1\***************************************************
\ UPDATE DISPLAY
\***************************************************S.S.4,
S1,
#START: SHOW 2,Correct Rsp,B(1), 3,Incorrect Rsp,B(2), 4,Rewards,B(3), 5,PR Value,P —> S2S2,
1″: SHOW 2,Correct Rsp,B(1), 3,Incorrect Rsp,B(2), 4,Rewards,B(3), 5,PR Value,P —> S2\***************************************************
\ LAST REWARD TIMER
\***************************************************
S.S.5,
S1,
#ZA(^RewardDevice): —> S2S2,
#ZA(^RewardDevice): Set Y = 0 —>S2
0.1″: SET Y = Y + 0.1;
SHOW 6,Last Reward,Y —> S2\***************************************************
\ TIME BIN CONTROL
\***************************************************
S.S.6,
S1,
0.01″: SET D(J) = -987.987 —> S2S2,
#START: SET D(J) = 0, J = 2, D(J+2) = -987.987 —> S3S3, \ Every 1 minutes increment the index
\ into the Time Bin Array
1′: SET J = J + 2, D(J) = 0, D(J+2) = -987.987 —> SX\***************************************************
\ RECORD LEFT/RIGHT LEVER RESPONSES
\***************************************************
S.S.7,
S1,
#START: —> S2S2, \ Record the Total Responses and the
\ number of Responses this Time Bin
#R^LeftLever: ADD D(0), D(J) —> S2
#R^RightLever: ADD D(1), D(J+1) —> S2I pressed the L lever 6 times and the R lever 3 times in the first minute. In the second minute the L lever was pressed 4 times and the R lever was pressed 10 times. Thanks again for the continued help. Below is the output that I received:
Start Date: 06/28/16
End Date: 06/28/16
Subject: 0
Experiment: 0
Group: 0
Box: 12
Start Time: 9:08:14
End Time: 9:10:09
MSN: PR R Active timed
C: 0.000
E: 0.000
F: 0.000
G: 0.000
H: 0.000
I: 0.000
J: 4.000
K: 0.000
L: 0.000
M: 0.000
N: 0.000
O: 0.000
P: 6.000
Q: 0.000
R: 0.000
S: 109.320
T: 0.000
U: 0.000
V: 0.000
W: 0.000
X: 4.000
Y: 13.400
A:
0: 300.000 1.000 2.000 0.050 20.000
5: 1.000 5.000 2000.000
B:
0: 23.000 13.000 10.000 4.000 0.000
5: 0.000 6.000
D:
0: 10.000 15.000 6.000 4.000 4.000
5: 11.000
Z:
0: 1.000 2.000 4.000 6.000 9.000
5: 12.000 15.000 20.000 25.000 32.000
10: 40.000 50.000 62.000 77.000 95.000
15: 118.000 145.000 178.000 219.000 268.000
20: 328.000 402.000 492.000 603.000 737.000
25: 901.000 1102.000 1347.000 1646.000 2012.000Med_Support
Moderatorafern
Hi Gary,
This is incredibly helpful. Thank you for such a prompt and detailed response. I shall try this to see how it works.
Anushka
Logged
Med_Support
ModeratorGary Bamberger
Hello Anushka,
The best way to do this is to create a LIST. You fill this list with times until the next tone.
Example:
LIST Z = 20″, 30″, 30″, 40″, 40″, 40″, 50″, 50″, 50″, 50″, 60″, 60″, 60″, 60″, 60″, 70″, 70″, 70″, 70″, 80″, 80″, 80″, 90″, 90″, 100″
If it was me I would use a program like MATLAB to come up with the numbers for the poisson distribution and then use the pre-calculated numbers to create the list.
Once you have the list the next thing is to draw the Inter-Tone Times from the list.
S.S.5, S1, #START: RANDI U = Z ---> S2 S2, U#T: ~OnFreq(MG, BOX, 5000);~; RANDI U = Z ---> S2
There are three ways to draw a value from the list.
LIST
Syntax: INPUT: LIST P1 = P2(P3) —> NEXTWhen LIST is used as an Output command it will draw each number, one at a time in sequential order, until the program is done or the numbers have all been used. If the latter occurs, LIST simply starts again at the beginning of the list.
RANDD
Syntax: INPUT: RANDD P1 = P2 —> NEXTRANDD pulls numbers from a list randomly without replacement. Think of a bucket full of numbers. When a number is drawn from the bucket that number is now considered used and is set aside making it no longer available. That number cannot be drawn from the bucket again until all numbers have been drawn at which point the bucket is refilled with all of the available numbers.
RANDI
Syntax: INPUT: RANDI P1 = P2 —> NEXTRANDI is closely related to RANDD with the difference being in that RANDI randomly selects from an array, but with replacement. Using the bucket analogy again, when a number is drawn from the bucket that number is immediately put back into the bucket and becomes available to be drawn again.
I hope that this information helps.
GaryMed_Support
ModeratorGary Bamberger
Your code looks fine and I believe that it should work, however, in order for the code to work the input needs to be in LEVEL MODE. When the input is in level mode an input is generated every interrupt for as long as a head entry is detected.
To change the input to level mode you need to remove the card from the interface cabinet and change either the switch (SmartCtrl cards) or the jumper (all others) from Transition (T) to Level (L) Mode for the input in question.
Please call MED Associates if you need help with doing this.
Gary
Med_Support
ModeratorGary Bamberger
The data looks fine to me
\ D(0) = Total Responses on Left Lever \ D(1) = Total Responses on Right Lever \ D(J) = Responses on Left Lever this Time Bin \ D(J+1) = Responses on Right Lever this Time Bin \ Left Lever Right Lever D: 0: 13.000 58.000 \ Total 2: 1.000 48.000 \ 1st minute 4: 6.000 0.000 \ 2nd minute 6: 0.000 0.000 \ 3rd minute 8: 0.000 0.000 \ 4th minute 10: 0.000 0.000 \ 5th minute 12: 0.000 0.000 \ 6th minute 14: 0.000 0.000 \ 7th minute 16: 0.000 0.000 \ 8th minute 18: 0.000 0.000 \ 9th minute 20: 0.000 0.000 \ 10th minute 22: 0.000 0.000 \ 11th minute 24: 0.000 0.000 \ 12th minute 26: 6.000 10.000 \ 13th minute 28: 0.000 0.000 \ 14th minute
Med_Support
Moderatorandersem
It seems to be combining the responses of both the right and the left lever across time. Any ideas? Below is the output.
File: C:\MED-PC IV\DATA\!2016-04-13 Start Date: 04/13/16 End Date: 04/13/16 Subject: 0 Experiment: 0 Group: 0 Box: 12 Start Time: 9:45:25 End Time: 9:58:46 MSN: PR L Active timed C: 0.000 E: 0.000 F: 0.000 G: 0.000 H: 0.000 I: 0.000 J: 28.000 K: 0.000 L: 0.000 M: 0.000 N: 0.000 O: 0.000 P: 6.000 Q: 0.000 R: 0.000 S: 793.390 T: 0.000 U: 0.000 V: 0.000 W: 0.000 X: 4.000 Y: 15.900 A: 0: 300.000 1.000 1.000 0.050 20.000 5: 1.000 5.000 2000.000 B: 0: 71.000 13.000 58.000 4.000 0.000 5: 0.000 6.000 D: 0: 13.000 58.000 1.000 48.000 6.000 5: 0.000 0.000 0.000 0.000 0.000 10: 0.000 0.000 0.000 0.000 0.000 15: 0.000 0.000 0.000 0.000 0.000 20: 0.000 0.000 0.000 0.000 0.000 25: 0.000 6.000 10.000 0.000 0.000 Z: 0: 1.000 2.000 4.000 6.000 9.000 5: 12.000 15.000 20.000 25.000 32.000 10: 40.000 50.000 62.000 77.000 95.000 15: 118.000 145.000 178.000 219.000 268.000 20: 328.000 402.000 492.000 603.000 737.000 25: 901.000 1102.000 1347.000 1646.000 2012.000
Med_Support
ModeratorGary Bamberger
Hello,
The following might work for you.
Gary
DIM D = 5000
\ D(0) = Total Responses on Left Lever
\ D(1) = Total Responses on Right Lever
\ D(J) = Responses on Left Lever this Time Bin
\ D(J+1) = Responses on Right Lever this Time Bin\ J = Index into Time Bin Array D
\***************************************************
\ TIME BIN CONTROL
\***************************************************
S.S.6,
S1,
0.01″: SET D(J) = -987.987 —> S2S2,
#START: SET D(J) = 0, J = 2, D(J+2) = -987.987 —> S3S3, \ Every 1 minutes increment the index
\ into the Time Bin Array
1′: SET J = J + 2, D(J) = 0, D(J+2) = -987.987 —> SX\***************************************************
\ RECORD LEFT/RIGHT LEVER RESPONSES
\***************************************************
S.S.7,
S1,
#START: —> S2S2, \ Record the Total Responses and the
\ number of Responses this Time Bin
#R^LeftLever: ADD D(0), D(J) —> S2
#R^RightLever: ADD D(1), D(J+1) —> S2Med_Support
ModeratorGary Bamberger
Hi Devan,
The program that you attached won’t even compile. Example:
S4, IF N>=5 [@True, @False] @True: Z^Z_Sucrose ---> S5 @False: ---> S2
This is not valid code and if I tried to compile it, it would say illegal or missing input statement. There are several locations in the program where the same problem exists.
This makes it a little hard to give advice because you could not possibly be using this program to run your experiments.
Now having said that it looks like you are trying to use a PHM-100VSS pump. The pump is only turned on when a Z^Z_Sucrose pulse is issued. In S.S.1, S4 & S7 this Z-pulse is issued. In S10, S13, S16, S19, S22, S25, S28, and S31 no Z-pulse is issued.
Hopefully this is the cause of the problem. If that doesn’t help, then the next step is to see if you can turn on the pump when using MED Test. If it doesn’t work in MED Test it will never work when running your MED-PC program.
Please let me know if this helps solve your problem.
Gary
Med_Support
ModeratorJim Frei
Hi Devan,
When turning on the pump, why are you trying to call a Pascal command? Why not simply say ON ^Pump?Take care,
Jim
Med_Support
ModeratorMed_Support
ModeratorJon Beyor
Devan,
Please give me a call, 802-527-2343, ask for Jon in support.
Med_Support
ModeratorDevan
Thank you again for your reply.
I actually need to use the FLUSH command (or I think I do) to save and record data that I don’t want to print ( as I understand, you must print to visualize an array of data). Ideally, I would like a second tally of the three output devices in addition to the total responses I already have displayed in the SHOW rows. In other words, I would like only the total session responses displayed (to be noted at the end of a session) while a 30 minute FLUSH command would record and save each total only within each half hour, clearing the totals after each 30 min FLUSH. This way I can log the session totals via the Med PC interface screen and the 30 minute totals I can pull up via the hard drive.
I will continue to struggle with this but would greatly appreciate your help again.
Respectfully,
Devan
January 25, 2016 at 12:41 pm in reply to: Dual lever- with different punishment time and reward amount #12785Med_Support
Moderatorc_salcido
Thank you, Jon! And I have sent the email. I really appreciate the help.
January 25, 2016 at 8:56 am in reply to: Dual lever- with different punishment time and reward amount #12783Med_Support
ModeratorJon Beyor
Please tell me exactly what you want your program to do and email it to support@med-associates.com (attention Jon).
I know you want both lever to extend and then each to have different punishment and reward but be specific and email me exactly what your looking for and I will send you some code. You are also duplicating a lot of stuff in the code you posted which you will need to clean up as well. We will get to that as well.
Thanks,
JonJanuary 23, 2016 at 9:45 am in reply to: Dual lever- with different punishment time and reward amount #12781Med_Support
Moderatorc_salcido
Jon,
Does setting each state and extending the appropriate scenario involve using an array? I apologize, I am still learning what all of this means! Thanks for your time!Med_Support
ModeratorJon Beyor
I updated the program to collect the response data in 30 min bins ( attached ) , I also removed the FLUSH commands making your program save during responses ( not sure why you would do this). I do not know of a way to send data to MATLAB and have no experience with that program.
-
This reply was modified 8 years, 9 months ago by
-
AuthorPosts