Re: Sending trigger to EEG recorder when an object appear

374 views
Skip to first unread message
Message has been deleted

David McFarlane

unread,
Dec 14, 2016, 2:44:40 PM12/14/16
to e-p...@googlegroups.com
TJ,

What exactly do you mean by, "The port address and value were used
before and worked"?

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


On 2016-12-14 9:14 AM, Mini Dragon wrote:
> May I ask how to send a trigger to BrainVision Recorder when a TextDisplay
> object appears. I guess it would be a simple inline script but I do not
> know how. I tried to write a inline script *WritePort &H378, 15 *right
> before the TextDisplay object but it did not work. The port address and
> value were used before and worked. Thank you in advance!
>
> Best
> TJ

Mini Dragon

unread,
Dec 15, 2016, 6:46:40 AM12/15/16
to E-Prime
Hi David,

Thank you for the reply! I mean there are no problems with port address and value (378, 15) because in my last experiment I wrote them in the inline script and the e-prime successfully sent trigger to computer, but in different use.

Best
Tingji

David McFarlane

unread,
Dec 15, 2016, 10:52:21 AM12/15/16
to e-p...@googlegroups.com
Tingji,

So does that older experiment program still work? Or did that one stop
working too? Is this all on the same computer, or did you change
computers? How do you connect the computer to BrainVision Recorder?
What sort of signal does BrainVision Recorder expect? What version of
E-Prime do you use for the new program? What version of E-Prime did you
use for the older experiment program? And again, does that older
program still work?

-- David McFarlane


On 2016-12-15 6:46 AM, Mini Dragon wrote:
> Hi David,
>
> Thank you for the reply! I mean there are no problems with port address and
> value (*378, 15*) because in my last experiment I wrote them in the inline

Mini Dragon

unread,
Dec 16, 2016, 2:28:39 AM12/16/16
to E-Prime
Hi,

Yes, the older experiment program still works. But the older one used "if..then..elseif" to send different triggers for different stimuli. This sort of inline script is also included in the present experiment. After that, I would like to send a trigger to BrainVision Recorder when a TextDisplay object appears.

I am not sure if it is clear with above description. Here is my design: a picture is presented for 10s (from different categories, I use "if..then..elseif" to send triggers), and then a blank appears for 10s, and then another blank appears (experimenter will control the timing of this one). I would like that when the second blank comes, e-prime sends the trigger to recorder (then experimenter will know the 10s blank was gone).

Everything (e-prime, connection, recorder) is the same for both experiments. We use e-prime 2.0 (2.0.10.353), connect BrainVision Recorder through BrainVision QuickAmp. I am not sure about the signal you asked.

Best,
Tingji

David McFarlane

unread,
Dec 16, 2016, 9:47:54 AM12/16/16
to e-p...@googlegroups.com
Tingji,

So let me see if I understand ...

1) You have not changed computers; both the old, still working
experiment program, and the new, not-working experiment program are run
on the same computer.

2) You took the old, still working experiment program, and just added
some inline code intended to output another signal through the parallel
port to some external equipment at the start of another stimulus.

3) The new program still successfully outputs the old signals, but fails
to output the added signal.

Based on that, I would say that you forgot to first set the LPT output
back to 0 at some reasonable time before outputting your new signal.
You should look at your old, still working code to see how that works,
and then implement that in your new code (I go over this in detail in my
online course).


Now, because you use EP2.0.10, I would much, much rather that you
abandon your use of WritePort and replace that with the much superior
Task Events facility. That, however, would involve some substantial
revision to your program, so I do not really expect that you will do
that. But Task Events has the great advantage that you no longer have
to know about port addresses. It also does everything without inline
code, and you may easily package together both the signal you want to
output and the subsequent reset to 0 to get ready for the next signal
output. Please see http://www.pstnet.com/support/kb.asp?TopicID=4803 ,
and the New Features Guide that came with E-Prime.

You should also know that, using WritePort, the actual onset of your
stimulus will occur with some delay after the signal to your external
equipment; i.e., the trigger values in your BrainVision data will all be
a bit early. This may or may not matter to you. You could have used
OnsetSignal... to avoid that (see the various OnsetSignal & OffsetSignal
topics in the E-Basic Help facility), and now Task Events provides an
even better mechanism. WritePort remains a useful low-level
communications mechanism for some special cases, but it is not the best
choice for your use here.

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


On 2016-12-16 2:28 AM, Mini Dragon wrote:
> Hi,
>
> Yes, the older experiment program still works. But the older one used
> "if..then..elseif" to send different triggers for different stimuli. This
> sort of inline script is also included in the present experiment. *After*

Mini Dragon

unread,
Dec 17, 2016, 8:49:30 AM12/17/16
to E-Prime
Hi David,

Thank you so much for your detailed replies!! It looks that Task Events feature is much more handy! I will try both ways as you suggested!

Again, many thanks for your replies, have a nice weekend and Merry Christmas in advance!

Best,
Tingji 
Reply all
Reply to author
Forward
0 new messages