Send Trigger to EEG using E-Prime Professional 2.0

2,426 views
Skip to first unread message

Piercarlo Mauri

unread,
Oct 21, 2013, 6:43:36 AM10/21/13
to e-p...@googlegroups.com
Hi,
I need E-Prime to send triggers to my EEG signal recorded with BrainAmp. The trigger cable is connected from the parallel port to the BrainAmp (in windows the resource tab of the LPT1 port says: Interval I/O 0378-037F, Interval I/O 0778-077F). In E-Prime I added the parallel port on LPT1 to the devices used. I need that in a series of numbers (with attribute "Target") that will be shown for 100ms in the slide "Target1", when will appear the number 1, a trigger should be send to my EEG recording... I created an Inline script (the one called Trigger) with this command: 

----------------------
If c.GetAttrib("Target")=1 Then
   Target1.OnsetSignalEnabled=True
   Target1.OnsetSignalPort=&H378
   Target1.OnsetSignalData=128
  
   Target1.OffsetSignalEnabled=True
   Target1.OffsetSignalPort=&H378
   Target1.OffsetSignalData=0

End if
---------------------

But it doesn't work, anyone can help me? I attached a screen of the sequence of my exp. 
Thank you
PM
1.png

David McFarlane

unread,
Oct 21, 2013, 1:37:12 PM10/21/13
to e-p...@googlegroups.com
A few questions:

- What version of E-Prime do you use?
- What value of PreRelease do you use on Target1?
- What bit or pin does the BrainAmp need to see change?
- What do you use to verify whether or not your parallel port outputs
are responding to your E-Prime commands?
- What, exactly, does "it doesn't work" mean here?

Also, please look at the recent thread at
http://www.pstnet.com/forum/Topic7539-8-1.aspx , where some of these
same issues got discussed.

Regards,
-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
take any and all questions at https://support.pstnet.com , and they
strive to respond to all requests in 24-48 hours, so make full use of
it. 3) In addition, PST offers several instructional videos on their
YouTube channel (http://www.youtube.com/user/PSTNET ). 4) If you do
get an answer from PST staff, please extend the courtesy of posting
their reply back here for the sake of others.
\----

Paul Groot

unread,
Oct 21, 2013, 1:37:36 PM10/21/13
to e-p...@googlegroups.com
The script looks fine, but are you sure that c.GetAttrib("Target")=1 evaluates to true? Just add a debug line to check if the if-statements runs as expected:

Debug.print "Target"

Also notice that value 128 corresponds to the highest bit of the 8 datalines. Also, adding the ParallelPort device is not required when using this trigger mechanism because you directly send data to the data register of the printer port. I'm not sure, but this might even give problems when the the LPT mode is not correctly set.

cheers
Paul





--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+u...@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/5e5e05cd-3aaa-4b68-8420-c82e42266408%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Paul Groot

unread,
Oct 21, 2013, 1:43:49 PM10/21/13
to e-p...@googlegroups.com
PS. The screendump shows that you are using EP2 pro. This version allows you to specify triggers using Task Events on Trigger1 instead of the OnsetSignal-properties. In that case you SHOULD define a ParallelPort device first.

PS2: David also pinpoints an annoying issue with EP2: PreRelease is set to 'same as duration', which might result in zero-duration triggers...

Paul

David McFarlane

unread,
Oct 21, 2013, 2:01:04 PM10/21/13
to e-p...@googlegroups.com
Paul,

Good catch on the screenshot -- more importantly, it shows they use
EP2.0.10 Pro (as you know, Task Events got introduced with that
version). Yes, in that case they should use Task Events instead of
Onset/OffsetSignal, and the thread linked earlier goes into that a
bit. Moreover, if they want to reset the bit based on an offset from
the OnsetTime, then they should use an event of
<stimulus>.OffSetTime, and an appropriate value for Delay.

Good catch on the If..Then line, I completely overlooked that!

Finally, I find the new default of "(same as duration)" a great
improvement, once properly understood and managed. But there is room
for a difference of opinion on that :).

Best regards,
-- David McFarlane


At 10/21/2013 01:43 PM Monday, Paul Groot wrote:
>PS. The screendump shows that you are using EP2 pro. This version
>allows you to specify triggers using Task Events on Trigger1 instead
>of the OnsetSignal-properties. In that case you SHOULD define a
>ParallelPort device first.
>
>PS2: David also pinpoints an annoying issue with EP2: PreRelease is
>set to 'same as duration', which might result in zero-duration triggers...
>
>Paul
>
>
>On 21 October 2013 19:37, Paul Groot
><<mailto:pfc....@gmail.com>pfc....@gmail.com> wrote:
>The script looks fine, but are you sure that c.GetAttrib("Target")=1
>evaluates to true? Just add a debug line to check if the
>if-statements runs as expected:
>
>Debug.print "Target"
>
>Also notice that value 128 corresponds to the highest bit of the 8
>datalines. Also, adding the ParallelPort device is not required when
>using this trigger mechanism because you directly send data to the
>data register of the printer port. I'm not sure, but this might even
>give problems when the the LPT mode is not correctly set.
>
>cheers
>Paul
>
>
>
>
>
>On 21 October 2013 12:43, Piercarlo Mauri
Reply all
Reply to author
Forward
0 new messages