Med_Support
Forum Replies Created
-
AuthorPosts
-
Med_Support
ModeratorThe time now is in seconds. I deleted the S/300 in S.S.1, S3 and I think that is what you meant. The last reward timer is not showing up in the display. I changed ^rewarddevice to ^pellet and that still did not work. I also tried changing it to 7 since 6 is softCRcode in S.S.1, S2. Any other ideas for why it may not be working? Thanks!
Med_Support
ModeratorJon Beyor
andersem,
The program currently runs in decimal minutes, EXAMPLE: 1.50 = 1 minute 30 seconds.
You can change it to just seconds by going to line 127 in bold below (S.S.1, S3,) and remove the /60 so that it reads SHOW 1, Session,S;
S3, \ Time Session Length
0.01″: SET S = S + 0.01;
SHOW 1,Session,S/60;Here is some code to set a reward timer (add another State Set) you could bin Y if you wanted to as well.
\*************************************************** \ LAST REWARD TIMER \*************************************************** S.S.5, S1, #ZA(^RewardDevice): ---> S2 S2, #ZA(^RewardDevice): Set Y = 0 --->S2 0.1": SET Y = Y + 0.1; SHOW 6,Last Reward,Y ---> S2
Regards,
JonMed_Support
Moderatorblee13
This just might work for what I need! Thanks!
Med_Support
ModeratorJim Frei
Hi Blee13,
I’m a little confused on what you’re trying to calculate. You mention latency, but it sounds like you’re trying to time how long the animal is in the food dish because you say “subtract time of exit and entry ( C(E) – W(A) ) to get a latency period”. If you’re trying to time how long the beam is broken here is some sample code to help with that:
\*************************************************** \ RESPONSE DEFINED - 20ms BREAK, 20ms RELEASE \*************************************************** S.S.2, S1, \ Inputs in Level Mode generate an input "count" on each \ interrupt. With a 10 ms system resolution 2 counts \ will be reached in 20 ms. The Z3 pulse is used to \ signal a completed Response. The second statement \ resets the counter every 20 ms so that a partial \ Response of less than 20 ms will not be counted. #R1: ADD Y; IF Y >= 2 [@Response, @NoResponse] @Response: SET Y = 0; Z3 ---> S2 @NoResponse: ---> SX 0.02": SET Y = 0 ---> S1 S2, \ As long as the input is broken the second statement \ causes a re-entry to this State. This resets the \ internal 20 ms timer so it never times out. When the \ input is released for 20 ms the timer times out and a \ Z4 pulse signals the release. 0.02": Z4 ---> S1 #R1: ---> S2 \*************************************************** \ RESPONSE TIMER \*************************************************** S.S.3, S1, #START: SET Z(I) = -987.987 ---> S2 S2, \ Wait for a signal that the input has been broken. #Z3: SET T = 0 ---> S3 S3, \ Wait for signal that the input has been released. \ Record the length of the Response. 0.01": SET T = T + 0.01 ---> S3 #Z4: SET Z(I) = T; ADD I; SET Z(I) = -987.987 ---> S2
If that’s not what you’re trying to do please post back.
Jim
Med_Support
ModeratorTo MED-PC the light is just an output. MED-PC doesn’t care what is connected to that output. It could be a retractable lever, pellet dispenser, pump, sonalert, stimulus light, or a light from a different vendor. To turn on a output all you need to do is write ON and the output number. Example:
ON 5 To turn off the output you just write OFF and the output number: OFF 5 If for example you want the output on for 1s after a response on input 1 you then time how long the output is turned on: S.S.4, S1, #R1: ON 5 ---> S2 S2, 1": OFF 5 ---> S1
I hope that this info helps.
GaryMed_Support
Moderatorsharmalab007
Hi Gary :
I’m planning to add an external light source which is manufactured from a different vendor. If possible, Can you please give me the code to shine light of 5mV during the program execution.
Med_Support
ModeratorGary Bamberger
Hi Suraj,
The easiest way is to replace the RANDD command with the LIST command:
RANDD P(^ITI) = A;
becomes:
LIST P(^ITI) = A(J);
This will draw the ITI from List A in order so it will be the same in both boxes.
Then what you might want to do is change the order of the values of the LIST from day to day:
Day 1
LIST A = 60, 90, 120, 150, 180 \intervalsDay 2
LIST A = 120, 180, 60, 150, 90 \intervalsDay 3
LIST A = 150, 90, 60, 180, 120 \intervalsYou can either have several different versions of the program with the day they are to be run listed in the name or you can load the program and go to “Configure | Change Variables” select LIST A and change the values for that day.
Gary
Med_Support
Moderatorsharmalab007
Hi Gary,
I have two operant boxes . I use the same program for both. The total time is the same for both, however the ITI varies. How can I make them have the same ITI simultaneously?Thanks
Suraj
Med_Support
Moderatorsharmalab007
Thankyou very much again Gary. Yes this is really helping my understanding of the program. You were right about the code for determining ITI rate, since I was getting zeros though there were HE for ITI.
Suraj
…Hi Gary,
Just a quick question. How does the program distinguish HE variability made by the mouse. For instance a mouse could spend 1 s or more than a minute in the nose poke hole. How does the HE counter treat such a situation? Where in the H array does the data go. For example, does a 5 s long HE go into one or multiple H elements?Thanks
Suraj
Med_Support
ModeratorGary Bamberger
This program does not distinguish between the length of Head Entries. It is the time the Head Entry is started that is recorded.
When a Head Entry is started/detected an input is sent to the program.
As long as the Head Entry beam remains broken no more inputs are sent to the program.
When the Head Entry is released and broken again a new input is sent to the program.Gary
Med_Support
ModeratorGary Bamberger
Hi Suraj,
A)
The number of values in LIST B is essentially arbitrary. The value is drawn from LIST B randomly:RANDD P(^Cue) = B;
The RANDD command draws a number from LIST B without replacement. That means that once a number has been drawn from LIST B it cannot be drawn again until every number has been used at least once and then the list is replenished. The longer the list the more variability there can be between sessions. For example:
LIST B = 0, 1
If on the first trial a 1 is drawn, then the second trial must be a 0. But if you expand the length of the list to be:
LIST B = 0, 1, 1, 0
Then if on the first trial a 1 is drawn, then on the second you could get a 1 or a 0.
Right now all of the numbers in LIST B are set to 1 so every trial is rewarded, but you can freely change the length and the values to match whatever percentage of rewarded vs. non-rewarded trials meets your needs.
B)
This program is currently written to use 1s bins:H(0) = Total Responses Recorded H(1) = Responses that took longer than 30s H(2) = Number of Head Entries that happened between 0.0 - 1.0s after the Trial started H(3) = Number of Head Entries that happened between 1.1 - 2.0s after the Trial started H(4) = Number of Head Entries that happened between 2.1 - 3.0s after the Trial started ... H(29) = Number of Head Entries that happened between 27.1 - 28.0s after the Trial started H(30) = Number of Head Entries that happened between 28.1 - 29.0s after the Trial started H(31) = Number of Head Entries that happened between 29.1 - 30.0s after the Trial started
The binning of Head Entries is done with the following code:
S.S.3, \\ HE Tracking S1, #START: ---> S2 S2, #R^Headentry: BIN H, I, .1, 1, 0, 31 ---> S3 S3, 0.33": ---> S2 S.S.4, \\ Index for HE Bins S1, #START: SET I = 500 ---> S2 \\ Outside Bins Until Beginning of First Trial S2, 0.1": ADD I ---> S2 #Z1: SET I = 0 ---> S2
I don’t really have the space to fully explain everything here, but in S.S.3, S2 the BIN command is what records the Head Entries. The command is defined as follows:
Syntax:
BIN P1,P2,P3,P4,P5,P6Where:
P1 = Array which will hold the frequency distribution.
P2 = A variable or array element containing the number to be added to the frequency distribution.
P3 = The units of P2. If one is recording time, then P3 is how frequently P2 is incremented.
P4 = The width of each bin or cell of the distribution.
P5 = Array element, variable, constant, or number denoting the first counter or array element containing the BIN
distribution. It is also the element into which the total frequency will be recorded.
P6 = Array element, variable, constant, or number denoting the last counter or array element into which the BIN
distribution is recorded.It is parameters P3 and P4 that sets the resolution (in this case 0.1s) and width (1s) respectively.
You can read more about the BIN command in the online help file by starting Trans IV and going to Help | Contents. When the Help Window opens you can then go to the Index Tab and then find the BIN command in the list that appears.
C)
The P Array is defined as follows:DIM P = 5
^ITI = 0
^CUE = 1 \\whether reinforced or not
^MAX = 2 \\max number of trials
^Phase = 3
^event_index = 4
^event_time = 5It is basically used to help control the flow of the program.
The Phase is what part of the Trial is currently active:
P(^Phase) = 0 = preCue
= 1 = Cue
= 2 = postCueD)
P(^Max) is the maximum number to trials to run. After a Trial is run the program checks in S.S.2, S6 if the maximum number of trials has been reached and if yes, the program ends.E) S.S.2, \\ run S1, #START: SET D(^Trial) = 0 ---> S2 \ Wait for Start command and initialize the trial counter to 0. S2, 0.01": RANDD P(^ITI) = A; \ Randomly draw an ITI value from LIST A SHOW 2,ITI,P(^ITI); \ Display the ITI value drawn to the screen RANDD P(^Cue) = B; \ Randomly draw rewarded/non-rewarded Trial from LIST B SET P(^ITI) = P(^ITI) * 1"; \ Convert the ITI time from LIST A to MED Ticks ADD D(^Trial) ---> S3 \ Increment the Trial Counter S3, \\ ITI, Z1 marks start of trial P(^ITI)#T: K1; \ K-pulses communicate between Boxes. \ This would tell a program running in a different Box that a Trial is starting. \ I'm guessing that somewhere at some point in time a Yoked program also \ existed that worked in conjunction with this program. SET P(^Phase) = 0; \ Phase = 0 = preCue Z1 ---> S4 \ Z-pulses communicate between State Sets \ This would tell State Sets 4, 5, 6, & 7 that a Trial is starting
F)
S2, #Z14: SET Z(P(^event_index)) = P(^event_time) + .1; ADD P(^event_index); SET Z(P(^event_index)) = -987.987 ---> SX #Z1: SET Z(P(^event_index)) = P(^event_time) + .2; ADD P(^event_index); SET Z(P(^event_index)) = -987.987 ---> SX #Z2: SET Z(P(^event_index)) = P(^event_time) + .3; ADD P(^event_index); SET Z(P(^event_index)) = -987.987 ---> SX #Z3: SET Z(P(^event_index)) = P(^event_time) + .4; ADD P(^event_index); SET Z(P(^event_index)) = -987.987 ---> SX #Z4: SET Z(P(^event_index)) = P(^event_time) + .5; ADD P(^event_index); SET Z(P(^event_index)) = -987.987 ---> SX #Z5: SET Z(P(^event_index)) = P(^event_time) + .6; ADD P(^event_index); SET Z(P(^event_index)) = -987.987 ---> SX
This is the code that keeps track of the Event Index’s that are being recorded in Array Z.
For example when a Z1 pulse arrives then the program knows that a Trial or preCue is starting and to record that event with the time and .2.
The value -987.987 seals the Z array so that you do not get all 5000 data elements saved to the data file. You only get the data that you care about. Everything up to that value is saved and once that value is hit nothing after is saved to the data file.
G)
So here is the numbers from the new D Array:D: Rate of HE
Number of Responses
Time Spent Head Entries During the
Session Time Trials Run in ITI During ITI ITI
0: 605.900 5.000 485.900 0.000 0.000Rate of HE Rate of HE
Number of Responses Number of Responses Number of
Head Entries During the Head Entries During the Head Entries
During PreCue PreCue During Cue Cue During PostCue
5: 0.000 0.000 2.000 0.000 6.000Rate of HE
Responses
During the
PostCue
10: 0.000There were 2 Head Entries detected during the Cue and 6 during the postCue. The Head Entry Rate is calculated in S.S.2, S7
S7, \\ rate in responses/min, 12 trials X 10s = 120s, 2 min
30″: OFF ^Fan;
SET D(^ITIHE_rate) = H(2) / (D(^ITI_time) / 60);
SET D(^cueHE_rate) = D(^cue_HE) / 2;
SET D(^postcueHE_rate) = D(^postcue_HE) / 2;
SET D(^precue_rate) = D(^precue_HE) / 2 —> STOPABORTFLUSHBut this State only runs after all 12 trials (SET P(^Max) = 12 from S.S.1, S1) have been completed. From the data file it looks like you stopped the program manually after 5 trials so S.S.2, S7 did not run.
I think there is a mistake in the equations above. I believe that you need to use H(1) instead of H(2) because H(1) contains any responses that happened during the ITI.
So that is another long set of answers, but I’m sure your knowledge of how this all works is growing.
Gary
Med_Support
Moderatorsharmalab007
Hi Gary,
Thankyou very much for the detailed reply. Its really helpful!
I will follow up with some more questions shortly.
Suraj…
Hi Gary,
Again thanks much for your answers. So, i finally got the head entries registered now. It was indeed the input value. I had changed it to 3 but however didnt set up the hardware file correctly. Attached is data from a partial run where i poked 8 times. I have some more questions:
a) I understood your explanation of LIST B however I do not understand why there are 15 ones instead of 12 ones since there are 12 trials per session.
b) Does this program have 1 s bins or 2 s bins? the note says 2 but its not obvious to me where in the program the code is.
c) What is DIM P and what is Phase?
d) Under SS1 what is set P(^max)=12?
e) Can you translate SS2 (S1 to S3)?
f) Can you explain SS7? Where does one get -987.987 from? How do you read S2 ?
g) Though I got HE separated for pre, post and cue the rates were zero. I am not sure why this is so.
Thanks
Suraj
Med_Support
ModeratorN S M
It worked! Thank you so much for your help!
Med_Support
ModeratorGary Bamberger
Hello Suraj,
Let’s see if I can answer some of your questions.
A)
The H Array is probably the most difficult to explain. It is being filled with the number of Head Entries that happened at various times since the Trials were started:H(0) = Total Responses Recorded H(1) = Responses that took longer than 30s H(2) = Number of Head Entries that happened between 0.0 - 1.0s after the Trial started H(3) = Number of Head Entries that happened between 1.1 - 2.0s after the Trial started H(4) = Number of Head Entries that happened between 2.1 - 3.0s after the Trial started ... H(29) = Number of Head Entries that happened between 27.1 - 28.0s after the Trial started H(30) = Number of Head Entries that happened between 28.1 - 29.0s after the Trial started H(31) = Number of Head Entries that happened between 29.1 - 30.0s after the Trial started
It is dimensioned to be 32 (0-31) elements long because that is the size required to hold all of the possible Head Entries times that happen during the 30s Trial Length (10s PreCue, 10s Cue, 10s PostCue).
Here is the data in the H array from the file that you sent:
H: 0: 0.000 0.000 0.000 0.000 0.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 0.000 0.000 0.000 0.000 30: 0.000 0.000
It looks like you had no responses. In the program the Head Entry is on Input 6. There are several possibilities as to why there were no responses recorded:
1) The Head Entry input is not currently connected to Input 6. It could be connected to a different input or not connected at all.
2) The MED-PC Hardware Configuration file is setup incorrectly and Input 6 is not mapped to the Head Entry detector.
3) The hardware is setup correctly and functioning correctly, but in this experiment there were no Head Entry inputs detected.
The fact that the Z Array is Dimensioned to 5001 (0-5000) elements is an arbitrary choice. I’m sure it was chosen because that is larger than all of the possible data that the program will generate. It is a good practice to create the arrays larger than needed because if in the future the number of Trials is changed, then the array will still be large enough to contain all of the data.
LIST B helps decides if a Trial where the Animal responds correctly during the Cue is to be rewarded. A value is drawn from LIST B at the beginning of a Trial. If the value drawn is a 1, and the Animal responds correctly during the Cue, then the Animal is rewarded for the correct response. If the value drawn is a 0, and the Animal responds correctly during the Cue, then the Animal is NOT rewarded for the correct response.
B)
The Event Index is a record of the times that various things happened during the Trial. The number before the decimal point is the time of the event. The number after the decimal point is the event that happened. Here is the meaning of the numbers after the data point..1 = Head Entry
.2 = Start of 10s PreCue or Trial Start
.3 = Start of 10s Cue
.4 = Start of 10s PostCue
.5 = End of 10s PostCue or Trial End
.6 = Pellet Reward was issuedHere is the values that were recorded in your data file:
Z: 0: 1800.200 1900.300 2000.400 2100.500 3300.200 5: 3400.300 3500.400 3600.500 5100.200 5200.300 10: 5300.400 5400.500 6000.200 6100.300 6200.400 15: 6300.500 7200.200 7300.300 7400.400 7500.500 20: 8700.200 8800.300 8900.400 9000.500 10800.200 25: 10900.300 11000.400 11100.500 12600.200 12700.300 30: 12800.400 12900.500 13800.200 13900.300 14000.400 35: 14100.500 14701.200 14801.300 14901.400 15001.500 40: 15901.200 16001.300 16101.400 16201.500 17701.200 45: 17801.300 17901.400 18001.500
-
- The 1st number says that at 180s (1800 / 10) since the Session was started the 1st Trial or PreCue (.2) was started.
-
- The 2nd number says that at 190s (1900 / 10) since the Session was started the Cue (.3) was turned on.
-
- The 3rd number says that at 200s (2000 / 10) since the Session was started the Cue (.4) was turned off and the PostCue now begins.
-
- The 4th number says that at 210s (2100 / 10) since the Session was started the 1st Trial or PostCue (.5) ended.
Why is the number divided by 10. Because of the following program code: S.S.8, \ Event Timer S1, #START: ---> S2 S2, 0.1": ADD P(^Event_Time) ---> S2 Every 0.1" or 100ms P(^Event_Time) is incremented. 100ms * 10 = 1s. So to convert the numbers to seconds you need to divide the value by 10.C)
The D Array is definied as follows:DIM D = 10 ^Time = 0 \\session timer ^Trial = 1 ^ITI_time = 2 ^ITI_HE = 3 ^ITIHE_rate = 4 ^preCUE_HE = 5 ^preCUE_rate = 6 ^cue_HE = 7 ^cueHE_rate = 8 ^postcue_HE = 9 ^postcueHE_rate = 10
And here is the values from the data file that you sent:
D: 0: 1830.100 12.000 1469.900 0.000 0.000 5: 0.000 0.000 0.000 0.000 0.000 10: 0.000
I’ve added an explanation for the data elements below:
D: Rate of HE
Number of Responses
Time Spent Head Entries During the
Session Time Trials Run in ITI During ITI ITI
0: 1830.100 12.000 1469.900 0.000 0.000Rate of HE Rate of HE
Number of Responses Number of Responses Number of
Head Entries During the Head Entries During the Head Entries
During PreCue PreCue During Cue Cue During PostCue
5: 0.000 0.000 0.000 0.000 0.000Rate of HE
Responses
During the
PostCue
10: 0.000Values 4-10 are 0 because there were no Head Entries Recorded.
D)
The Set O = 5 is being used to set the Rise/Fall Time to 5ms. The reason for the Rise/Fall time is to prevent popping and/or clicking sounds when a Tone is turned on. If you try to go from 0dB to 85dB too quickly, then the speaker will not be able to handle it and you could hear popping and/or clicking sounds instead of the desired Pure Tone so the time is set to allow to speaker to go from 0dB to 85dB in 5ms.The SET L = 12000 is being used to set the duration to 12000ms or 12s. The desired Tone length of 10s and is really controlled by the ToneOn and ToneOff commands. Setting the default duration to 12s is either a holdover from a previous program or as a failsafe to make sure the Tone doesn’t run indefinitely.
E)
The Named Constant ^Time is set to 0 (^Time = 0) before State Set 1. So D(^Time) is really D(0). The code in question:S2,
0.1″: SET D(^Time) = D(^Time) + 0.1;
SHOW 1,SessionTime,D(^Time)/60 —> S2Is your Session Timer. Every 100ms or 0.1″ the program is adding 0.1 to the value in D(0). It is then displaying that time to the screen so you can know how much time has passed since the START command was issued. The value in D(0) is divided by 60 so that it converts the time into Decimal Minutes before displaying the value to the screen with the SHOW command. Decimal Minutes can be a little confusing at first until you understand how the value past the decimal point can be incremented up to .99 and not stop at 60 as some might expect:
0.1s (100ms) / 60 = 0.00 minutes (displayed to the screen)
0.2s (200ms) / 60 = 0.00 minutes
0.3s (300ms) / 60 = 0.01 minutes
…
0.9s (900ms) / 60 = 0.02 minutes
…
1.5s (1500ms) / 60 = 0.03 minutes
…
2.1s (2100ms) / 60 = 0.04 minutes
…
58.8s (58800ms) / 60 = 0.98 minutes
…
59.4s (59400ms) / 60 = 0.99 minutes
…
60.0s (60000ms) / 60 = 1.00 minutesSo that is a lot of information. I hope that it helps and that you can now understand what your program is doing.
Best Regards,
GaryMed_Support
ModeratorGary Bamberger
In S.S.1, S1 you set X = 1 and in S3 you use X#R^Lever giving you an FR 1.
When the pump turns on you issue a Z1 which is responded to in S.S.3, S1. However the pump only stays on for 0.05″. If you want it to stay on for 1s you need to change the program as follows:
S2, 1": OFF ^Pump ---> S1
For your Lickometer the following might work for you:
S.S.4, S1, 0.01": SET F(E) = -987.987 ---> S2 S2, #START: ---> S3 S3, #R^Lickometer: SET F(E) = S; ADD E; SET F(E) = -987.987 ---> SX S.S.8, S1, #START: ---> S2 S2, 0.01": SET S = S + 0.01 ---> SX
You should be able to do something similar for timestamps of the lever.
Gary
Med_Support
ModeratorYou have provided no information on what hardware you have in the interface cabinet, how many chambers you have, how many inputs/outputs there are per chamber etc. It is very difficult to advise on how to proceed.
The only advice that I can provide given the information that I have is to run the MED-PC Hardware Configuration Utility (Start | Programs | MED Associates | MED-PC IV | Hardware Configuration Utility).
When the program starts go to Define | Guided Sequence.If you have a standard setup of all SmartCtrl or all SuperPort cards, then answering the questions in the Guided Sequence should setup the DTA file correctly for you.
If you have a setup that contains a mix of different cards, then it would be best for you to call MED Associates when you can be in front of the computer. They will help walk you through setting up the DTA file and also make sure that all of the cards are configured correctly.
Gary
Med_Support
Moderatorblee13
As always, thanks for your help Gary!
Med_Support
ModeratorGary Bamberger
All variables and arrays in MSN are initialized to 0 when the programs starts. You don’t have to do anything for this to happen, it is given to you.
With your code sample it looks like you are close, but there is a problem with the IF statement:
S6, 0.01": IF F >= 10 [@10, @Not10] @10: SET V = T(F) + T(F-1) + T(F-2) + T(F-3) + T(F-4) + T(F-5) + T(F-6) + T(F-7) + T(F-8) + T(F-9); IF V = 8 [@Switch, @Stay] @Switch: ---> S12 @Stay: ---> S2 @Not10: ---> S2
What happens if V = 9 or 10. It will not switch. You need to check IF V >= 8.
Gary
Med_Support
Moderatorbatters27
Ok thanks. This actually makes me feel better that it’s not a programming issue..!
Thanks again.
Med_Support
ModeratorGary Bamberger
You clearly have a hardware problem. Either the hardware is not wired together/setup correctly or the MED-PC Configuration file is not setup correctly. Unfortunately this is not something that can be solved easily through the forum. It would be best if you called MED Associates Support 1-802-527-2343 when you can be in front of the hardware. They will help you troubleshoot the problem further and assist with the return of any equipment that proves to be defective.
Gary
Med_Support
Moderatorbatters27
Hi Gary,
When I go to configure/signals and stimulate a response on input 2 the program DOES turn on outputs 3 and 5 (right stimulus light and feeder releases a pellet).
Connecting the left lever and the responses do not seem to work.
Does this mean input 2 is not configured correctly?
I do not have the Testinout program. I also am not sure how to run MED Test- should this be installed with my software?
Also, I understand the boxes are all Daisy chained. Since none of the boxes are working with the right lever, does this mean and issue with box 1 is causing none of them to work?
Thanks again
Med_Support
ModeratorGary Bamberger
I just ran the program using the values that you provided and it seems to be working perfectly.
When I press the Right Lever (Input 2), Output 3 and 5 turn on for 0.1″.
If you run MED Test do you see an input when you press the Right Lever?
Which input do you see in MED Test?If you go to Configure | Signals and Simulate a Response on Input 2, does the program turn on Outputs 3 and 5?
If you connect the Left Lever to input 2 does the program work?
Do you have the program TestInOut.mpc?
If you run that program do you see an input when you press the Right Lever?The problem is most likely one of two things:
1) The right lever is not working and possibly need to be returned for repair.
2) The MED-PC Hardware Configuration File is not setup correctly and/or does not have Input 2 configured.Please let me know if this helps solve your problem.
GaryMed_Support
Moderatorbatters27
B is the number of reinforcers (50), W is time of the session (I’ve been using 900) and F is the Fixed Ratio (just setting it at 1 for right now). I don’t have anything for X…..
…
Im wondering if the Right levers are wired correctly? They come out and retract on cue I just can’t seem to get the food hopper to release a pellet when the right lever is pressed. The Right Cue light also does not come on regardless of number of presses on the right. I see in the back of the levers they have 3 connections, is it possible the wires are going to the wrong places?
I’m wondering if it is a wiring issue since NONE of the programs I am running will allow a pellet to be released but the left lever pressing works just fine?
Thanks again for all your help, this is driving me nuts.
Med_Support
ModeratorGary Bamberger
What values are you using for the variables B, F, W, and X?
I want to try running the program so I can see for myself what is happening.
Gary
Med_Support
Moderatorbatters27
Thanks Gary for your help. I don’t think that is the issue either- Ive copied below the program I have for the right lever training and everything looks as you suggest. I have other programs too where everything seems fine but the pellet is not released upon the correct number of presses on the right lever…
\To run this program, set "F" equal to the FR value you want \and set "B" to the number of reinforcers you want. (for example \set "B" to 500 when you are shaping and to 40 when the rat is \pressing by itself for the entire session. The session will end \when the specified number of pellets is reached. If you need \to decrease the FR value when the program has already started change \not only the value of "F", but also set the value of "Y" back to zero. \("Y" keeps tabs on the number of responses the rat has made toward the \FR requirement) \ \ \\\INPUTS, OUTPUTS \R1: RIGHT LEVER \L1: LEFT LEVER \ \ 1: LEFT LEVER ^LLVR \ 2: RIGHT LEVER ^RLVR \ 3: FEEDER ^FEED \ 4: LEFT STIM LIGHT ^LSLT \ 5: RIGHT STIM LIGHT ^RSLT \ 7: HOUSE LIGHT ^HSLT \ \ ^LLVR=1 ^RLVR=2 ^FEED=3 ^RSLT=5 ^HSLT=7 \ s.s.1, \session length s1, #start : --->s2 s2, .1": if T = X [@T, @F] @T:on^HSLT;ON^RLVR --->s3 @F: --->s2 s3, .1": if T = W [@end, @go] @end: ---> S4 @go: ---> s3 s4, .1": OFF^HSLT; OFF^RLVR; OFF^FEED ---> stopabortflush s.s.2, s1, #start : --->s2 s2, .1": if T = X [@T, @F] @T:on^HSLT;ON^RLVR --->s3 @F: --->s3 s3, .1": if U = B [@true, @false] @true: OFF^HSLT; OFF^RLVR; OFF^FEED ---> stopabortflush @false: ---> s2 s.s.3, \contingency state and data display right lever s1, #start : set r = f; show 1, FR, f---> s2 s2, #r2: add y;add a; show 3, rtot, a;z1; if y = r [@ratioyes, @rationo] @ratioyes: on^FEED;ON^RSLT; add U; add l; set y = 0 ---> s3 @rationo: --->sx s3, .1" : OFF^FEED; OFF^RSLT ---> s2 s.s.4, \elapsed time s1, #start --->s2 s2, 1" : add t; show 5, secs, t --->sxMed_Support
ModeratorGary Bamberger
In S.S.3, S2 you are looking for an input on #R1.
I’m guessing that your Right Lever is on input 2 so you need to change the program to look for an input on #R2.
Gary
Med_Support
Moderatorbatters27
I corrected this on my computer but it still doesn’t work for the right lever. none of the 8 boxes will release a food pellet when the right lever is pressed. I am assuming this is a program issue but maybe it isn’t? none of my programs will work for the right lever. All the programs allow the right lever to come out at the start of the session but pressing on the right lever does not seem to connect with the food hopper releasing a food pellet.
Is this a program issue or a hard wire issue? I have checked and checked and all the wires seem to be connected to the correct Input/Output connectors.
I don’t know what else to try?
Med_Support
ModeratorGary Bamberger
Let’s take a look at the first error message:
Source: testPright Line: 64 ERROR # 1 @ratioyes:on^FEED;ON^RSLT;addU;addl;sety=0--->s3 Offending text: ^RSLT A constant is missing '^' or undeclared constant
The first line tells us the name of the program and the line number where it thinks the problem exists. NOTE: This may not necessarily be the program that you have open and are currently working on. Also frequently the problem is one or two lines before the listed line number.
The third line list the code that Trans IV thinks is the cause of the problem.
The last two lines try give a more detailed explanation of the problem. The problem in this case is you are trying to use a constant “^RSLT” that has not been previously declared.
Here is a list of the constants that is declared in the program:
^LLVR=1
^RLVR=2
^FEED=3
^LSLT=4
^HSLT=7The constant ^RSLT is not in this list. When I add the following constant to the list:
^RSLT=5
then the program compiles just fine.
I’m guessing that the Right Stim Light is on output 5. If it is not, then make sure to use the correct output number when you declare the missing constant.
I hope that this information helps.
GaryMed_Support
Moderatormcwaters
Sorry, we should have caught that. Thank you!
Med_Support
ModeratorGary Bamberger
Yes, change the SX in State 2 to S2
S2, 1#R^LeftLever: ADD A; SET E(A) = N; SHOW 2,ACTIVE,A ---> S2
That should reset the 60 minute counter. Sorry for the mistake.
GaryMed_Support
Moderatormcwaters
Hi Gary,
Thank you for your help. When replacing our S.S.2 section for yours, all boxes stopabortflush after 60 minutes, regardless of response. Is there a way to make it so that the only boxes that stopabortflush are those without a left lever response for 60 minutes? In other words, we want rats with left lever responses to continue for the full 2 hours.
Thanks again!
Med_Support
ModeratorGary Bamberger
I think that the following change will do what you want:
S.S.2, \ This is the state set that contains the response count and display of the active lever S1, #START: SHOW 2,ACTIVE,A ---> S2 S2, 1#R^LeftLever: ADD A; SET E(A) = N; SHOW 2,ACTIVE,A ---> SX 60': Z2 ---> S3 #Z2: ---> S1 S3, 1": OFF ^HouseLight, ^LeftLeverOperate, ^RightLeverOperate ---> STOPABORTFLUSH
Gary
Med_Support
Moderatorandersem
oh goodness, that worked. I had the input value for the right lever position rather than the response, which is why it would add one each time the lever goes out. Thanks again!
-
-
AuthorPosts