Frequent Crashes of E-prime 3.0 During the Use of StimTracker Quad for Sending Triggers in EEG Experiments



  • Avatar
    Edward Hubbard

    I am having similar problems with E-prime 3.0 ( 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.  

    Comment actions Permalink
  • Avatar
    Edward Hubbard

    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. 

    Comment actions Permalink
  • Avatar
    Noah CUI (Edited )

    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 ( 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 = Integer

    Dim bytesThatMakePulseConfigCommand(5) As Integer
    'Here is where we construct the byte sequence
    'that forms a StimTracker Event Marker command.
    '(Refer to
    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 bytesThatMakePulseConfigCommand

    Dim 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 bytesToRaiseStimTrackerLines

    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)

    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk