Med_Support
Forum Replies Created
-
AuthorPosts
-
Med_Support
ModeratorFilip van den Bergh
Re: MEDPC2XL
August 08, 2006, 03:08:29 amSorry for my late reply. I wouldn’t use MEDPC without MEDPC2XL. It works great.
Med_Support
ModeratorGary Bamberger
Hi Greg,
See my response to your other question in the coding help section:
S1, #R1: ADD R; SET T = 0 ---> SX #R2: IF (T >= 30) AND (R >= 1) [@Chained, @Unchained] @Chained: ADD C; SHOW 3,Chained,C; SET R = 0, T = 0 ---> S1 @Unchained: ADD U; SHOW 4,Unchained,U; SET R = 0, T = 0 ---> S1 1": ADD T ---> SXI think that it will answer your question.
Med_Support
ModeratorGary Bamberger
i Greg,
Your code is close except I think that you need to add a counter for input 1. Also you will want to move the time input statement to be last:
S1, #R1: ADD R; SET T = 0 ---> SX #R2: IF (T >= 30) AND (R >= 1) [@Chained, @Unchained] @Chained: ADD C; SHOW 3,Chained,C; SET R = 0, T = 0 ---> S1 @Unchained: ADD U; SHOW 4,Unchained,U; SET R = 0, T = 0 ---> S1 1": ADD T ---> SX
The R counter is needed because what if a response happens on input 2 and T >= 0, but a response never happened on input 1. The time statement needs to be last because if a response on input 2 happens at exactly the same time as the 1″ timer, then the input 2 response would be missed.
Med_Support
Moderatorgdillon
Filip,
Thanks for the suggestions.
In my current program I am trying to count the magazine responses in my If/Then statement, so that every nose poke into the food hooper is measured as either a chain or unchained response, but it doesn’t seem to be working.S.S.4, \Chained vs unchained responses S1, #Z1: SET T=0-->S2 S2, #R^Receptacle: ADD T; ADD X-->S2 #Z1: SET T=0-->S2 1": ADD T; IF T<=30 THEN {@Chained; @Unchained} @Chain: ADD C; SHOW 3, Chain, C-->S1 @Unchained: ADD U; SHOW 4, Unchained, U-->S1Med_Support
ModeratorFilip*
1. Why not modify S.S.1/S2 like this:
S2, #R^LeftLever: ON ^Reward; ON^RewardLight; Z1 ---> S2 (NOTE: YOUR REDIRECTION WAS MISSING A '-') #R^Magazine: Z2 ---> S2
Of course, you need another stateset to count these magazine responses. It will be very similar to your S.S.4.
2. Also, I’d move all the reward and signal code into a separat states that listens for Z1 only. This way, you keep switching the reward and signal on and off close to each other.
3. Third, I’d move all user messages to a separate stateset for clarity.
Med_Support
Moderatorgdillon
\Inputs ^LeftLever=1 ^Receptacle=2 \Outputs ^House = 1 ^Reward=2 \ In this code, this is a Pellet Dispenser ^RewardLight=3 \Defined Variables \A=# of total lever presses \B=# of rewards received \C=# Chained responses \U=# Unchained responses \T=temporary counter for time window after response \X=number of receptacle visits during window S.S.1, S1, #START: ON ^House --> S2 S2, #R^LeftLever: ON ^Reward; ON^RewardLight; Z1 --> S3 S3, 2": -->S1 S.S.2, \This is state set that contains the response count and display. This will now put label the \"Responses" and its value "A" on screen until the START command is issued S1, #START: SHOW 1, Responses, A-->S2 S2, #R^LeftLever: ADD A; SHOW 1, Responses, A --> SX S.S.3, \Reward Counter and Timer S1, #Z1: ADD B; SHOW 2, Rewards, B --> S2 S2, 0.05": OFF ^Reward--> S1 S.S.4, \Chained vs unchained responses S1, #Z1: SET T=0-->S2 S2, #R^Receptacle: ADD T; ADD X-->S2 #Z1: SET T=0-->S2 1": ADD T; IF T<=30 THEN {@Chained; @Unchained} @Chain: ADD C; SHOW 3, Chain, C-->S1 @Unchained: ADD U; SHOW 4, Unchained, U-->S1 S.S.5, \Session Timer S1, #START:-->S2 S2, 60':-->STOPABORTMed_Support
ModeratorFilip*
So what do you have so far?
Med_Support
ModeratorGary Bamberger
The VM_IFace.hed was not added to your User.pas so it does not know what those commands are.
Edit your User.pas and look for the line: {Place $I Filename.HED files here.}
Add the following line just below it: {$I VM_IFace.hed}
It should look like this when done:
{Place $I Filename.HED files here.}
{$I VM_IFace.hed}Make sure that you can find a copy of the following two files in your C:\MED-PC IV folder:
VM_IFace.hed
MED_VM_Interface.dllIf you cannot find these two files then you should be able to find a copy on your Video Monitor CD. Just copy them to your C:\MED-PC IV folder and everything should start working correctly.
-
AuthorPosts