Med_Support
Forum Replies Created
-
AuthorPosts
-
Med_Support
ModeratorGary Bamberger
Hello Liane,
In S3 you are waiting only 10ms for the animal to respond. Not much time for a response to happen. If you change the code as follows it should do what you want:
S3, 0.01": ON ^CenterRed ---> S4 S4, 10.39": IF B > 0 [@True, @False] @True: SET B = 0 ---> S5 @False: ---> S7 #R^CenterKey: ADD B ---> SXGary
June 17, 2011 at 11:26 am in reply to: is it possible to code two inputs to happens concomitant? #13097Med_Support
ModeratorGary Bamberger
Hello Liane,
Sorry for taking so long in getting back to you.
The IF S.S.1 = 3 checks which State that S.S.1 is currently in. If S.S.1 is in State 3, then input 1 must already be broken. The only reason that S.S.1 would be in S3 is if input 1 was currently broken.
If input 1 is already broken as indicated by S.S.1 being in S3 and we just received a Z pulse telling us that input 2 is broken, then both beams are broken at the same time and your code can continue on with the reward or punishment.
The ERROR 89:”)” expected is probably something to do with an IF statement or an array variable, but without the actual program I cannot give you a better answer. If you want to email me a copy of the program I will be able to tell you exactly why it can’t compile and how to fix it.
Gary
June 2, 2011 at 9:46 am in reply to: is it possible to code two inputs to happens concomitant? #13095Med_Support
Moderatorlianedahas
Gary, I am really grateful for your help.
What I am trying to do is to demand that a rat nose break two light beams in the same time (that will provide a response – in fact, a single one, but two inputs for Med programation – more precise than using only one beam).
Perhaps, the short time between one and other response, needed in your code, will not disturb my intentions, I will try.
But I am not having success in translate your code, it appears an ERROE 89:”)” expected. What may be wrong?
And I would like to understand what “s.s.1=3” means. How can I quantify a state set?
…
Does somebody understood what I am triyng yo do?
May 16, 2011 at 1:59 pm in reply to: is it possible to code two inputs to happens concomitant? #13093Med_Support
ModeratorGary Bamberger
Not certain what you mean by the same time?
If you mean that they must start at the exact same interrupt, then that will almost never happen. For two inputs to be started within less than 10ms of each other is pretty much impossible for a human much less an animal. Now it is possible that they could happen within less than 1s of each other.
The code sample that I provided looks to see if there is a response on both inputs at the same time. If both inputs are showing a response, then the code issues a Z1 pulse. Your program must then respond to that input and do whatever the consequence is supposed to be. Example:
S.S.5, S1, \ Turn on Shock output as a consequence \ of both inputs happening at same time. #Z1: ON 5 ---> S2 S2, 1": OFF 5 ---> S1
There is one feature with my code sample that may not meet your needs. The animal could respond and hold input 1 for 10s before responding on input 2. So the inputs did not start at the same time, but there was a point where they were happening at the same time.
If you need the inputs to always start at the same time, I don’t think it is possible to write code to check for that. I also don’t think it is generally possible for the animals to do that.
Please let me know if this helps answer your questions or if there is some detail about what you are trying to do that I am missing.
Gary
May 13, 2011 at 10:03 am in reply to: is it possible to code two inputs to happens concomitant? #13091Med_Support
Moderatorlianedahas
Thank you, Gary!
I am a new user of WMPC, and I am not understanding in this code you made where is the unique consequence for both inputs, i.e., I need to guarantee that both inputs occurs in the same time and then, give one consequence (output) for them. Is it possible?May 12, 2011 at 3:15 pm in reply to: is it possible to code two inputs to happens concomitant? #13088Med_Support
ModeratorGary Bamberger
Hello Liane,
Now that is tricky, but it is possible. I guess the first thing you would need to do is change the inputs so that they are in Level Mode. Once you have done that the code below should work:
DIM Y = 1 \ Z-Pulses Used in this Program \ Z1 = Signal Both Inputs are on \ Z3 = Input 1 Response \ Z4 = Input 1 Release \ Z5 = Input 2 Response \ Z6 = Input 2 Release \*************************************************** \ INPUT 1 DETECTION \*************************************************** S.S.1, S1, #START: ---> S2 S2, \ Wait for Input 1 Response Signal \ Check for Input 2 Response #Z3: IF S.S.2 = 3 [@Both, @One] @Both: Z1 ---> S3 \ Tell the rest of the program @One: ---> S3 S3, \ Wait for Input 1 Release Signal #Z4: ---> S2 \*************************************************** \ INPUT 2 DETECTION \*************************************************** S.S.2, S1, #START: ---> S2 S2, \ Wait for Input 2 Response Signal \ Check for Input 1 Response #Z5: IF S.S.1 = 3 [@Both, @One] @Both: Z1 ---> S3 \ Tell the rest of the program @One: ---> S3 S3, \ Wait for Input 2 Release Signal #Z6: ---> S2 \*************************************************** \ INPUT 1 DEFINED - 20ms RESPONSE, 20ms RELEASE \*************************************************** S.S.3, 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 constitute a Response. #R1: ADD Y(0); IF Y(0) >= 2 [@BeamBreak, @NoBeamBreak] @Break: Z3; SET Y(0) = 0 ---> S2 @NoBreak: ---> SX 0.02": SET Y(0) = 0 ---> S1 S2, \ As long as the Input is on the second statement \ causes a re-entry to this State. This resets the \ 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 \*************************************************** \ INPUT 2 DEFINED - 20ms RESPONSE, 20ms RELEASE \*************************************************** S.S.4, S1, #R2: ADD Y(1); IF Y(1) >= 2 [@BeamBreak, @NoBeamBreak] @Break: Z5; SET Y(1) = 0 ---> S2 @NoBreak: ---> SX 0.02": SET Y(1) = 0 ---> S1 S2, 0.02": Z6 ---> S1 #R2: ---> S2
I hope that this helps.
GaryMed_Support
ModeratorGary Bamberger
When I try to compile your program here is the error messages that I receive:
Source: unblockingpilot2 Line: 415 ERROR # 1 #z^onWhite:~SetFreq(MG,BOX,0);~;~SetAmp(MG,BOX,90);~;~SetRF(MG,BOX,10);~;~ToneOn(MG,BOX);~;--->s2 Offending text: ^ONWHITE A constant is missing '^' or undeclared constant Source: unblockingpilot2 Line: 418 ERROR # 1 #z^offWhite:~ToneOff(MG,BOX);~;--->s1 Offending text: ^OFFWHITE A constant is missing '^' or undeclared constant Source: unblockingpilot2 Line: 427 ERROR # 12 #z^onHouse:^onHouse;--->s2 Offending text: ^onHouse; Failure to find legal output command following ';' or ':' Source: unblockingpilot2 Line: 429 ERROR # 12 #z^offHouse:^offHouse;--->s1 Offending text: ^offHouse; Failure to find legal output command following ';' or ':' Source: unblockingpilot2 Line: 436 ERROR # 1 #z^onFlashl:^onRight, ^onLeft;--->s2 Offending text: ^ONFLASHL A constant is missing '^' or undeclared constant Source: unblockingpilot2 Line: 439 ERROR # 12 0.4":^OffRight,^offLeft;--->s3 Offending text: ^OffRight,^offLeft; Failure to find legal output command following ';' or ':' Source: unblockingpilot2 Line: 441 ERROR # 12 0.4":^OnRight,^onLeft;--->s2 Offending text: ^OnRight,^onLeft; Failure to find legal output command following ';' or ':' Source: unblockingpilot2 Line: 442 ERROR # 12 #z^offFlash:^offRight,^offLeft;--->s1 Offending text: ^offRight,^offLeft; Failure to find legal output command following ';' or ':'
* Errors 1 and 2: ^OnWhite and ^OffWhite do not exist.
* Errors 3 and 4: I believe that you meant to put ON ^House and OFF ^House instead of ^OnHouse and ^OffHouse.
* Error 5: ^OnFlashL does not exist.
* Errors 6, 7, and 8: These are the same types of errors as 3 and 4.
Med_Support
ModeratorMed
Thanks Gary, I’ll try it out and let you know if it works.
…
This works great, thanks!
Med_Support
ModeratorGary Bamberger
Hello,
You could try this:
S2, #R^ToneLever: ADD R; IF R >= 3 [@FRMet, @Cont] @FRMet: ---> S3 @Cont: ---> S2 #R^InactiveLever: SET R = 0 ---> S2
Best Regards,
GaryMed_Support
ModeratorDena Carbonari
Thanks, Gary!
-Dena-
Med_Support
ModeratorGary Bamberger
You just need to specify the specific array elements when using the Var_Alias command:
Var_Alias Delay 1 = U(0) Var_Alias Delay 2 = U(1) Var_Alias Delay 3 = U(2) Var_Alias Delay 4 = U(3) LIST U = 0, 5, 10, 20 S.S.1, S1, #START: RANDD T(113) = U ---> S2
Med_Support
Moderatortip184
Thanks Gary,
I think your code will work. If I read it correctly, x will provide all of the info that I need – 11 when both are broken, 10 when Beam2 is broken, 1 when Beam1 is broken, and 0 when neither is broken. Not really any Boolean math involved in this approach. It might be that I need to use x for Beam 1 and w for Beam 2, then compute x+w as the state of the two beams.
As always, I appreciate your help!Jeff
Med_Support
ModeratorGary Bamberger
Hi Jeff,
If you want to remove the Z-pulses, then this would most likely work:
\***************************************************************** \ BEAM 1 BREAK DEFINED - 20ms BREAK, 20ms RELEASE \***************************************************************** S.S.2, \ Beam Break Defined - 20ms Break, 20ms Release. 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 second statement resets \ the counter every 20 ms so that a partial Beam Break of \ less than 20 ms will not constitute a Response. #R1: ADD Y; IF Y >= 2 [@BeamBreak, @NoBeamBreak] @Break: SET Y = 0, X = X + 1 ---> S2 @NoBreak: ---> SX 0.02": SET Y = 0 ---> S1 S2, \ As long as the Beam is broken the second statement \ causes a re-entry to this State. This resets the \ the internal 20 ms timer so it never times out. When \ the Beam is released for 20 ms the timer times out. 0.02": SET X = X - 1 ---> S1 #R1: ---> S2 \***************************************************************** \ BEAM 2 BREAK DEFINED - 20ms BREAK, 20ms RELEASE \***************************************************************** S.S.3, S1, #R2: ADD Z; IF Z >= 2 [@BeamBreak, @NoBeamBreak] @Break: SET Z = 0, X = X + 10 ---> S2 @NoBreak: ---> SX 0.02": SET Z = 0 ---> S1 S2, 0.02": SET X = X - 10 ---> S1 #R2: ---> S2
You can then use your boolean statement to check the status of X.
Gary
Med_Support
Moderatortip184
Thanks Gary. I have used this code before to monitor duration of nose pokes, and I think that you are right – it will work. However, it simply defers the collection of the info that I need to the next step (i.e., the reading and comparing of the z codes). I was hoping that there was a more direct solution.
With this code I next need a S.S. that monitors the Zs. If Z1 means R1 on and Z2 means R1 off (and similarly Z3 and Z4 for R2) then the routine will look something like this:
S.S. \Hole = state of illumination of one or both phototransistors #Z1: Set Hole = Hole + 1 ---> Sx; \ but will processing proceed if #Z1 is detected? #Z2: Set Hole = Hole - 1 ---> Sx; #Z3: Set Hole = Hole + 10 ---> Sx; #Z4: Set Hole = Hole - 10 ---> Sx;
Because the two sensors are out of phase with each other, this will produce a cycling output of 00, 01, 11, 10, 00… for rotation in one direction, and 00, 10, 11, 01, 00… for rotation in the opposite direction (if my phototransistors are aligned properly).
What I had hoped to do was to avoid the Z pulses. Would something like this work:
S.S.2 S1, .02": set Hole1 = 0 ---> Sx; \ resets Hole1 if NOT #R1 #R1: set Hole1 = 1 ---> Sx; \ Hole1 is set to 1 as long as #R1 beam is broken S.S.3 S1, .02": set Hole2 = 0 ---> Sx; #R2: set Hole2 = 10 ---> Sx; S.S.4 S1, .01": Set Hole = Hole1 + Hole2; if (CODE to compare current Hole with last Hole to see if wheel has moved) [@moved,@notmoved] @moved: set move = move + 1 ---> Sx; @notmoved : ---> Sx;
The easiest solution would be a single Boolean statement:
Set Hole = (10 * #R2) + #R1
if #R equated to 1 (or TRUE) when on and 0 (or FALSE) when off.
Am I making it harder than it needs to be?
Jeff
Med_Support
ModeratorGary Bamberger
I think this code sample will accomplish what you want
\*************************************************** \ BEAM BREAK DEFINED - 20ms BREAK, 20ms RELEASE \*************************************************** S.S.2, \ Beam Break Defined - 20ms Break, 20ms Release. 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 Beam Break. The second statement resets \ the counter every 20 ms so that a partial Beam Break of \ less than 20 ms will not constitute a Response. #R1: ADD Y; IF Y >= 2 [@BeamBreak, @NoBeamBreak] @Break: Z3; SET Y = 0 ---> S2 @NoBreak: ---> SX 0.02": SET Y = 0 ---> S1 S2, \ As long as the Beam is broken the second statement \ causes a re-entry to this State. This resets the \ the internal 20 ms timer so it never times out. When \ the Beam is released for 20 ms the timer times out \ and a Z4 pulse signals the release. 0.02": Z4 ---> S1 #R1: ---> S2
It will send a Z-pulse with the IR Beam is broken and another when it is released.
Gary
July 12, 2010 at 11:05 am in reply to: Installation of SG-215D4 Hardware with operant chambers using DIG-716 modules #12475Med_Support
ModeratorM Winzenburg
Hi Greg,
You have a rather unique custom setup, so before I explain how to configure it, I’ll try to explain the SG-215D4s. These passive panels have 32 ports which can be used with up to 2 SuperPort cards. The confusion is because the panel is labeled “Inputs” on the left side, and “Outputs” on the right side. While they can be used with a combination of inputs and outputs, they can also be used with all inputs or all outputs.In your case, in addition to your 1 DIG-716 4IN/8OUT SmartCtrl cards for chambers 5 and 6, you also have 2 SuperPort Output cards for chamber 5 and 2 SuperPort Output cards for chamber 6. Connect the first DIG-726 card to the top DB-25 connection on the SG-215D4 panel for Box 5. Connect the second DIG-726 card to the bottom DB-25 connection on the SG-215D4 panel for Box 5. In the same way, connect the DIG-726 cards to the SG-215D4 panel for Box 6.
Each SG-215D4 will then connect to the output wires of the 3 ENV-124AM Pigeon Keys per chamber. Each of these pigeon keys has 12 outputs each consisting of multi-colored lights. Since you have only 32 possible ports, you will have to determine which lights you want to use and connect them accordingly. This step can be completed later, if necessary.
Now that you have your hardware set up, you need to add the DIG-726 SuperPort Outputs to your configuration file. From what you have described, it sounds like you have your SmartCtrl cards set up correctly. However, since you are using more than one type of output card, you would need to select Define -> Outputs (Custom) and configure the additional 32 outputs for chambers 5 and 6 manually. If you have questions on how to manually configure outputs, let me know and I will describe in further detail.
All SmartCtrl and SuperPort cards have a pre-set output port of 792, so it is the offsets that would need to be set correctly in order to get the cards to work. Keep in mind that the offsets go up by 2 per card, and they must also match the jumper or dipswitch setting on the card.
Your cards have been set as follows:
Box 5 – SmartCtrl Offset 8
– SuperPort (1) Offsets 10/11
– SuperPort (2) Offsets 12/13Box 6 – SmartCtrl Offset 14
– SuperPort (3) Offsets 16/17
– SuperPort (4) Offsets 18/19Once you get the hardware properly configured, you simply refer to the output number in your program. While boxes 1 through 4 have 16 outputs each, Boxes 5 and 6 have 40 outputs each. The outputs for your boxes 5 and 6 would be as follows:
1 – House Light Operate
2 – Clicker Operate
3 – Grain Feeder Operate
4 through 8 – Not Used
9 through 40 – Pigeon Key Lights as determined by youI realize this is a fairly complicated setup, so please do contact me if you need further assistance.
Best regards,
Mary…
For the sake of clarity, I should also add that SmartCtrl cards do not connect with SG-215D4 panels. These panels are for use with SuperPort cards only. The DIG-716 SmartCtrl cards connect with SG-716 connection panels only (1 card to 1 panel).
Med_Support
ModeratorGary Bamberger
I’m glad that you were able to figure it out on your own. You actually learn a lot more that way.
Gary
Med_Support
ModeratorGary Bamberger
Re: medpc 2 excel
May 18, 2010, 01:01:05 pmThe problem is that those cells in the Excel spreadsheet have the Date format applied to them. To fix right click on the affected cells and select Format Cells. Then when the window pops up just select the General format.Gary
Med_Support
ModeratorGary Bamberger
I’m not 100% certain what you are trying to do from your brief description. You have responses (#R2 and #R1) in the code that don’t arrow to anywhere and two timed inputs in the same State. I’ve provided some sample code below, but like I said I’m not 100% certain that it is what you are trying to do.
S.S.1, \ Control Blinking Light S1, #Z8: ---> S2 S2, 0.01": ON ^RightLight ---> S3 S3, 0.5": OFF ^RightLight; ADD B ---> S4 S4, 0.5": IF B = 10 [@True, @False] @True: SET B = 0 ---> S1 @False: ---> S2 S.S.2, \ Look for Response S1, #Z8: ---> S2 S2, #R2: Z1; Z7 #R1: Z12 7": ---> S1
Med_Support
ModeratorGary Bamberger
Re: medpc 2 excel
May 18, 2010, 09:08:05 amI’m not going to be able to solve this one through the forum. Please email me a copy of the profile that you created and the data file that you are using trying to transfer into Excel. A copy of the program that created the data file would be helpful as well.
Gary
Med_Support
ModeratorGary Bamberger
Re: Med Extractor
May 14, 2010, 11:25:35 amNot certain what you mean by array format. Do you have any examples of what you want the data to look like?
Med_Support
ModeratorAlcoholLab
Re: Med Extractor
May 12, 2010, 01:42:23 pmThank you, Gary. I’m assuming you’re talking about the MP2XL program which we have. My question is how to get information from arrays to convert itself into array format. I’ll have a look at the manual again, but if you have any suggestions that would be most helpful.
Thank you again.
Med_Support
ModeratorGary Bamberger
Re: Med Extractor
May 12, 2010, 08:39:11 amThere is the program MED-PC to Excel sold by MED Associates. It can read MED-PC data files in all four formats and transfer the data into Excel or Access. While doing the transfer it can label the data and even perform simple mathematical equations on the data.
I hope that this information helps.
Med_Support
ModeratorS.Temple12
thanks, that fixed all the problems perfectly
Med_Support
ModeratorLooking at your code I think that your problem is in S.S.3, S.S.8, and S.S.9.
In S.S.3 you had:
Code: [Select] S.S.3, \ Random Side Selection S1, #Z3: RANDI Y = K ---> S2 S2, 0.01": IF Y = 1 [@Left, @Right] @Left: Z5 ---> SX @Right: Z6 ---> SX
Once S2 executes the program goes to SX (back to S2). You want it to go back to S1 so that the program waits for the next Z3-pulse:
S.S.3, \ Random Side Selection S1, #Z3: RANDI Y = K ---> S2 S2, 0.01": IF Y = 1 [@Left, @Right] @Left: Z5 ---> S1 @Right: Z6 ---> S1
S.S.8 and S.S.9 both suffer form the exact same problem so I will only discuss S.S.8. Your code for S.S.8 is:
S.S.8, \Left Responses S1, #Z5: ON ^LeftStim ---> S2 S2, 1": ADD E ---> S3 S3, 0.01": IF E <= 10 [@True, @False] @True: ---> S4 @False: ---> S5 S4, #R1: ADD L; OFF ^LeftStim; Z1; Z4; SET E = 0 ---> SX #R2: ADD V; OFF ^LeftStim; Z4; SET E = 0 ---> SX S5, 0.01": OFF ^LeftStim; Z4; SET E = 0; ADD B ---> SX
The first problem is that you don’t check if there was a response until after the 10 second timer has run out. The second problem is that after you turn off the Stim Light the program goes to SX (back to S4 or S5 respectively). I believe that you want the program to go back to S1 to wait for another Z5-pulse.
S.S.8, \ Left Responses S1, #Z5: ON ^LeftStim; SET E = 0 ---> S2 S2, #R1: ADD L; OFF ^LeftStim; Z1; Z4 ---> S1 #R2: ADD V; OFF ^LeftStim; Z4 ---> S1 1": ADD E; IF E <= 10 [@Cont, @Omission] @Cont: ---> S2 @Omission: ADD B; OFF ^LeftStim; Z4 ---> S1
With the above code the program will count any response within 10 seconds of the Stim Light. If no response happens, then it is counted as an omission.
Notice that the Response inputs were placed first. If the 1 second timer was placed first and a response happened at the exact same time as the 1 second timer times out, then the response would have been ignored and the 1 second timer code would have been executed.
Med_Support
ModeratorGary Bamberger
If I understand you correctly you only want the program to start timing when you issue the START command. If you look at S.S.2 and S.S.3 you will see that they have no #START command. Those two State Sets start immediately when the program is loaded. If you add a new State that waits for the START command and then goes on with the rest of the program, it should do what you want. The modified program with the two State Sets waiting for the START command is posted below.
\ Outputs ^Feeder = 3 ^HouseLights = 4 \ Inputs ^Counter = 3 DIM C = 8 DIM D = 8 DIM P = 8 DIM N = 8 LIST W = 1",2",3",4",5",6",7",8",9",10",11",12",13",14",15",16",17",18",19",20" LIST U = 30",90",150" S.S.1, \ General Control S1, #START: ON ^HouseLights ---> SX S.S.2, \ Tone Operator S20, #START: ---> S1 S1, 90": K3; Z8 ---> S2 \ Trial Counter S2, 0.1": IF (Q = 2) OR (Q = 3) OR (Q = 5) OR (Q = 8) [@True, @False] @True: ---> S3 @False: ---> S10 S3, #T: K1; Z1 ---> S4 S4, 30": ---> S5 \ ITI Head Insertion 1 Measured S5, 1": RANDI A = U ---> S6 S6, A#T: K2; Z5 ---> S7 S7, 30": ---> S8 \ ITI Head Insertion 2 Measured S8, 1": ~InitANL926;~; \ Reset ANL-926 ~SetFreq(MG, BOX, 3000);~; \ Initialize Frequency ~SetAmp(MG, BOX, 80);~; \ Initialize Amplitude ~ToneOn(MG, BOX);~; \ Issue Start Stimulus K4; Z9 ---> S9 S9, 90": ~ToneOff(MG, BOX);~ ---> S1 S10, 30": ---> S11 S11, 1": RANDI A = U ---> S12 S12, 30": ---> S13 S13, 1": ~InitANL926;~; \ Reset ANL-926 ~SetFreq(MG, BOX, 3000);~; \ Initialize Frequency ~SetAmp(MG, BOX, 80);~; \ Initialize Amplitude ~ToneOn(MG, BOX);~; \ Issue Start Stimulus K5; Z2 ---> S14 S14, 90": ~ToneOff(MG, BOX);~ ---> S1 S.S.3, \ # of Head Insertions Measure S1, #START: ---> S2 S2, #R^Counter: ADD K; IF K >= 2 [@True, @False] @True: SET K = 0; Z4 ---> S3 @False: ---> SX 0.2": SET K = O ---> S2 S3, #R^Counter: ---> S3 0.2": ---> S2 S.S.4, \ ITI 1 # of Head Insertions Measure S1, #Z1: ---> S2 S2, 30": ADD E ---> S1 #Z4: ADD D(E) ---> SX S.S.5, \ ITI 2 # of Head Insertions Measure S1, #Z5: ---> S2 S2, 30": ADD S ---> S1 #Z4: ADD P(S) ---> SX S.S.6, \ CS # of Head Insertions Measure During Trials 2 5 6 8 Only S1, #Z9: ---> S2 S2, 30": ADD B ---> S1 #Z4: ADD C(B) ---> SX S.S.7, \ Time Increments S1, #START: ---> S2 S2, 0.1": SET T = T + 0.1 ---> SX S.S.8, \ Pellet Operator S1, #Z9: ---> S2 S2, 30": ---> S3 S3, 0.01": RANDI H = W; ADD J ---> S4 S4, H#T: ON ^Feeder; SET M = 20" - H ---> S5 S5, M#T: OFF ^Feeder; IF J = 3 [@True, @False] @True: SET J = 0 ---> S1 @False: ---> S3 S.S.9, \ Pellet Operator S1, #Z2: ---> S2 S2, 0.01": RANDI H = W; ADD J ---> S3 S3, H#T: ON ^Feeder; SET M = 20" - H ---> S4 S4, M#T: OFF ^Feeder; IF J = 4 [@True, @False] @True: SET J = 0 ---> S1 @False: ---> S2 S.S.10, \ Total CS Head Counter During Trials 2 5 6 8 Only S1, #Z9: ---> S2 S2, 90": ADD L ---> S1 #Z4: ADD N(L) ---> SX \ CS Response Measure S.S.11, \ Trial Counter S1, #Z8: ADD Q; SHOW 1,TRIAL,Q ---> SX S.S.12, \ Shut Off S1, 0.1": IF Q = 9 [@True, @False] @True: OFF ^HouseLights ---> STOPABORTFLUSH @False: ---> S1
Med_Support
ModeratorGary Bamberger
Re: MPC2XL Manual?
June 16, 2009, 10:56:56 amI have sent a copy of the manual to your email address.
Med_Support
ModeratorChris Richards
Re: Med-PC IV options
April 23, 2009, 12:18:14 pmHi Jim,
We actually sell a software product that provides an interface API that allows input/output control from other programming languages. Here’s a link for you to check out:
-Chris
March 5, 2009 at 11:12 am in reply to: Same timer code got different time results on two computers #13161Med_Support
ModeratorChris Richards
When you log onto your Med PC computers, are you doing it with a user account that has administrator priviledges for those computers? MED-PC IV needs to run with Real Time Priority, and if you’re logging in with a user account that doesn’t have admin privileges, then someone who does needs to give you the rights to change priority levels – your IT support group would be the people to contact about this. A quick way to check is to go into Task Manager, select the Processes tab, find MEDPC_IV.exe, right mouse click on it and choose Set Priority – Realtime should have a black dot next to it. If Windows won’t let you do this, then you don’t have admin priviledges and you’ll need to contact your IT people to help you out.
Med_Support
Moderatorethrail
Thanks Gary, the program will be in your inbox shortly. -e
Med_Support
ModeratorGary Bamberger
Unfortunately you have not given enough information to help answer your question.
We would need to see the source code that is causing the problem. You can either post the source code here or email a copy of the program to me. Hopefully once we can see the source code we can tell you what the solution to your problem is.
Med_Support
ModeratorGary Bamberger
The ANL-926 is not controlled in the same way as a regular output. There are special commands that are used in order to control the card. Here is an example program:
S.S.1, S1, 1": SET A = 1000; \ Frequency = 1000 Hz SET B = 100; \ Volume = 100 dB SET C = 10; \ Rise\Fall Time = 10 ms SET D = 1000; \ Duration = 1000 ms ---> S2 S2, #START: ~InitANL926;~; \ Reset ANL-926 ~SetFreq(MG, BOX, A);~; \ Initialize Frequency ~SetAmp(MG, BOX, B);~; \ Initialize Amplitude ~SetRF(MG, BOX, C);~; \ Initialize Rise\Fall Time ~SetDur(MG, BOX, D);~; \ Initialize Duration ~OnFreq(MG, BOX, A);~; \ Issue Starting Stimulus ---> S3 S3, #K1: SET A = A + 200; \ Increase Frequency ~OnFreq(MG, BOX, A);~ ---> S3 #K2: SET A = A - 200; \ Decrease Frequency ~OnFreq(MG, BOX, A);~ ---> S3 #K3: SET A = 0; \ Select White Noise ~OnFreq(MG, BOX, A);~ ---> S3 #K4: SET A = 1000; \ Reset Frequency to 1000 Hz ~OnFreq(MG, BOX, A);~ ---> S3 S.S.2, S1, 1": SHOW 1,FREQ,A, 2,AMP,B, 3,RF,C, 4,DUR,D ---> S1
There is a manual for the ANL-926 that explains all of the commands and how to use them. Please contact support@med-associates.com if you need a copy of the manual.
Med_Support
ModeratorGary Bamberger
This code will give you a good start on what you want to do:
\ Inputs ^Lever = 1 \ Outputs ^Pellet = 6 ^HouseLight = 7 \ Variables \ P = Total # Pellets Delivered \ W = Total # Responses During 4KHz Tone LIST E = 60" LIST F = 1, 2 S.S.1, S1, 0.01": ON ^HouseLight ---> S2 S2, #START: SET B = 80; \ Volume = 80 dB SET C = 10; \ Rise\Fall Time = 10 ms SET D = 1000; \ Duration = 1000 ms ~InitANL926;~; \ Reset ANL-926 ~SetAmp(MG, BOX, B);~; \ Initialize Amplitude ~SetRF(MG, BOX, C);~; \ Initialize Rise\Fall Time ~SetDur(MG, BOX, D);~; \ Initialize Duration RANDI N = F; ZN ---> S3 \ Start Procedure of randomly choosing atone S3, E(0)#T: Z3 ---> S4 \ Wait for Duration of Session then repeat random selection S4, 60": RANDI N = F; ZN ---> S3 \ Inter-Trial Interval S.S.2, S1, #Z1: ~OnFreq(MG, BOX, 2000);~ ---> S2 \ Emit 2KHz Tone S2, #R^Lever: ADD P; SHOW 1,Rewards,P; ON ^Pellet ---> S3 \ Show Lever Presses on Screen #Z3: ---> S1 S3, 0.15": OFF ^Pellet ---> S2 #Z3: OFF ^Pellet ---> S1 S.S.3, S1, #Z2: ~OnFreq(MG, BOX, 4000);~ ---> S2 \ Emit 4KHz tone S2, #R^Lever: ADD W; SHOW 2,4KHz Resp,W ---> S3 \ Show Lever Presses on Screen #Z3: ---> S1
-
AuthorPosts