Frequent Crashes of E-prime 3.0 During the Use of StimTracker Quad for Sending Triggers in EEG Experiments
Hi All,
I am a complete novice, and I've encountered some problems that are hard to resolve when using the StimTracker Quad to send triggers. I need your help.
Background:
I use E-prime 3.0 to design EEG's ERP (event-related potential) experiments and send triggers through the StimTracker Quad. In the program design, a trigger is sent when a picture appears, a trigger is sent when a problem occurs, and a trigger is sent when the subject responds. There are three places where triggers need to be sent in total. Regarding the setting of trigger codes, I strictly follow the official tutorial https://cedrus.com/support/stimtracker/eprime3.htm.
Problem:
I found the program runs very unstable, every time there is a trigger picture, E-prime 3.0 will crash, and there is no any error prompt.
I have been trying to eliminate the bug for many days, although it was not effective, but I found the following things:
- The problem most likely lies in the trigger code used in E-prime 3.0. Because when I remove the trigger code, the E-prime program runs smoothly and stably.
- Even if the program runs successfully a few times, it still crashes after restarting the computer. The program is likely to crash before the second image with the trigger appears. But sometimes the program will also crash in other parts with triggers.
- The official tutorial https://cedrus.com/support/stimtracker/eprime3.htm seems to have some redundant code, because I have tried to delete all the code related to PulseStimTracker1, and only keep the code related to PulseStimTracker2 in the User Script (I also deleted all TrialInitInL and InLine1), StimTracker Quad can still send triggers successfully. And the whole program ran successfully once. However, after restarting the computer, the program crashed again.
- I also checked the computer memory and found that the memory is sufficient, so it may not be caused by insufficient memory.
If you need further information, please feel free to contact me🙏.
Thank you so much for your help🙏.
Best,
Noah
-
I am having similar problems with E-prime 3.0 (3.0.3.214) and StimTracker, but when used for fNIRS triggers on a Windows 10 64-bit OS/Machine (managed by our UW-Madison Waisman Brain Imaging IT staff). Like in your case, I am sending StimTracker code through a Cedrus StimTracker Quad, via m-pod, and also on Channel 2 of the StimTracker unit. When I run a version of the program without the StimTracker code, it is quite robust, and doesn't crash even when I press buttons like crazy (mouse and keyboard responses). With the StimTracker code, sometimes it will crash on the very first trial, and other times, it will run *most* of the way through the program, and even once or twice, all the way through. I tried checking the small edat txt files for any clue. Many of them were completely empty, but in the ones that had information, there doesn't seem to be a common factor about the stimuli, etc.
-
I think I may have found my problem, and perhaps something similar is the source of your problem. The communication cable (ribbon cable) between my StimTracker and the fNIRS amplifier had gotten knocked out of the amplifier over the weekend by another team that uses the space. As soon as we fixed that, it looks like the random crashes ended.
-
Hi Edward!
Thank you for your advice!
Yesterday, I attempted to replace the "task event" functionality(used for sending triggers in EEG experiments) in E-prime 3.0 (3.0.3.214) with E-basic .
The program ran successfully 12 times, so I believe the issue may have been resolved.
The following is the code I modified based on the original tutorial.
I hope these will be helpful. As I'm new to this, I may not have everything perfect just yet, but I warmly welcome any additional feedback :)
Dim integerVersionOfAttribute As Integer
Dim millisecondsDuration As Integer
Dim flagValueForDisablingPulse As Integer
millisecondsDuration = 30
'set an upper limit for the unique number to be sent out as marker (depends on receiving device)
flagValueForDisablingPulse = 260
' We use "Context.GetAttrib" to get the
' current value of "StimVal" from the StimList.
' (Refer to E-Basic help regarding "Context.GetAttrib")
Debug.Print "atrrib is: " & c.GetAttrib("StimVal")
integerVersionOfAttribute = CInt(c.GetAttrib("StimVal"))
'Just for fun, we will turn pulse OFF for the last few trials
If integerVersionOfAttribute >= flagValueForDisablingPulse Then
millisecondsDuration = 0
End If
'Support Comments: below subroutine call has been moved to StimDisp.OnsetTime
'We will set millsecondsDuration as an attribute to be referenced in the Custom field
'
'PulseStimTracker integerVersionOfAttribute, millisecondsDuration
'Support Comments: setting the first variable to be passed-in as attributes
c.SetAttrib "millisecondsDuration", millisecondsDuration
'Support Comments: we can reference the StimVal attribute directly and pass it into the Script Task Event as Data Type = IntegerDim bytesThatMakePulseConfigCommand(5) As Integer
'Here is where we construct the byte sequence
'that forms a StimTracker Event Marker command.
'(Refer to http://cedrus.com/support/stimtracker/tn1450_st_commands.htm)
bytesThatMakePulseConfigCommand(0) = 109 ' ascii m
bytesThatMakePulseConfigCommand(1) = 112 ' ascii p
bytesThatMakePulseConfigCommand(2) = millisecondsDuration
bytesThatMakePulseConfigCommand(3) = 0
bytesThatMakePulseConfigCommand(4) = 0
bytesThatMakePulseConfigCommand(5) = 0
'(E-Studio generates the following script when the serial device is
'added to the experiment: Dim Serial As SerialDevice).
'Send the command to StimTracker!
Serial.WriteBytes bytesThatMakePulseConfigCommandDim bytesToRaiseStimTrackerLines(3) As Integer
'Make the command to zero out (clear) all lines
bytesToRaiseStimTrackerLines(0) = 109 ' ascii m
bytesToRaiseStimTrackerLines(1) = 104 ' ascii h
bytesToRaiseStimTrackerLines(2) = c.GetAttrib("StimVal")
bytesToRaiseStimTrackerLines(3) = 0 ' this final byte is currently ignored by StimTracker
Serial.WriteBytes bytesToRaiseStimTrackerLinesExpFigure.Tasks.Reset
ExpFigure.Tasks.Add Serial.CreateTask("ExpFigure.OnsetTime",0,"WriteByte","(custom)",c.GetAttrib("StimVal"),"Byte",True)
ExpFigure.Tasks.Add Serial.CreateTask("ExpFigure.OffsetTime",0,"WriteByte","(custom)",ebDigit_0,"Byte",True)
Please sign in to leave a comment.
Comments
3 comments