Hi all,
I am Radhika and I need a little bit help in terms of inline script for recording responses at the simultaneously from two buttons on Chronos and also from the dual foot pedals attached to Chronos for a multi-limb choice reaction task. I tried writing the In-Line script for the first time but for some reason the moment i press the foot pedals along with Chronos buttons for some reason (in conditions which requires responses at the same time from my left hand and left feet for example) it just stops the Run (of stimulus) I am pretty sure there is something wrong in the code. I am pasting my code below for the same (Initially I have tried designing the same experiment or different buttons on Keyboard and it has worked) there surely are some attributes i am getting wrong. If some one could correct and modify this code and point out the mistakes made it would be really helpful. I need to get this experiment set up urgently.
THE CODE:
Dim theResponseObject As RteRunnableInputObject
Set the ResponseObject = CRteRunnableInputObject (Rte.GetObject ("STIMULUS"))
'Check if the response object Exists
If theResponseObject Is Nothing Then
MsgBox "Object Not Found"
Exit Sub
End If
'Counter variable for the number of responses made
Dim nPressCount As Long
nPressCount = 0
'Count variable
Dim nIndex As Integer
'Enumerate through the response collection
For nIndex = 1 To theResponseObject.InputMasks.Responses.Count
'Set the Chronos response data for the current response
Dim theChronosResponseData As ChronosResponseData
Set theChronosResponseData = CChronosResponseData (theResponseObject.InputMasks.Response (Index))
If Not theChronosResponseData Is Nothing Then
'Increment the press count
nPressCount =nPressCount+ 1
'Log the response time and response for each key press
Select Case theChronosResponseData.RESP
Case 1 ' Button 1
Debug.Print '"Button 1 pressed"
c.SetAttrib "ULL1.RT" & "RT" , theChronosResponseData.RT
Case 5 ' Button 5
Debug.Print '"Button 5 pressed"
c.SetAttrib "ULL5.RT" & "RT" , theChronosResponseData.RT
Case 70 ' Assuming 'F' key
Debug.Print " Foot Pedal F pressed"
c.SetAttrib "LLLF.RT" & "RT" , theChronosResponseData.RT
Case 71 ' Assuming 'G' key
Debug.Print " Foot Pedal g pressed"
c.SetAttrib "LLRG.RT" & "RT" , theChronosResponseData.RT
'Add more Cases If needed for Other keys
Debug.Print "Unexpected responseCode: " & "theChronosResponseData"
Exit Sub
End Select
End If
Next nIndex
Kindly please help me correct and modify the code.
Regards
Radhika Dharap