Timing a procedure + TaskEvent (triggers)

253 views
Skip to first unread message

Rafał Jończyk

unread,
Apr 6, 2018, 4:13:08 PM4/6/18
to E-Prime

Dear all,


I am currently programming an experiment that involves solutions that are new to me, and hence I'd really appreciate your feedback/support. Below I attach (1) the basic procedure in E-prime with an explanation of my problem, and (2) a print screen of task events, also with an explanation of the problem. First, let me briefly explain the experiment, though:


Participants first see a word for a few seconds, following which they are presented with "?" which marks the "idea generation/ideation" stage. When they come up with a new idea related to the word, they are asked to press a button, vocalise the idea (the "IDEA 1" stage), and press a button again, which brings them back to the ideation stage during which they come up with a second new idea for the same word, press a button, vocalise it, press a button again, etc. This ideation is supposed to last for 3 mins per stimulus and then terminate and move on to the next word in the list.

1) PROBLEM:

I don't know if it is possible to set a time limit for a procedure in E-prime so that when 3 mins of ideation have passed, E-prime will go to the second stimulus in the list and repeat the procedure for other 3 minutes, and so on until the list is finished? I assume it will involve setting some kind of a clock at the onset of the stimulus presentation saying that when the clock has counted 3 minutes, E-prime will move on to the next item in the list and repeat the procedure for this item, etc. I tried looking for similar problems in the group, but the only I found was about terminating a whole experiment using a timer, which is not what I want.

2) PROBLEM:

I am using task events to send triggers for my EEG experiment for the first time - before I used scripting. I ran into a problem, though. At the stage of "ideation" I want E-prime to send 2 triggers: one at the onset of ideation and the second when participants press a button (which also terminates the stage and takes them to the "IDEA 1" slide). While the trigger for the onset of ideation stage is presented, when I press a button I get no trigger. However, I get the trigger for the second button press that happens on the "IDEA" stages, so it's weird. Is it the case that E-prime cannot send 2 triggers for one object?


I would really appreciate your feedback,

Thank you,

Rafal



David McFarlane

unread,
Apr 9, 2018, 2:23:25 PM4/9/18
to e-p...@googlegroups.com
Rafal,

What Device do you use for your triggers -- ParallelPort, Serial, etc.?

-- David McFarlane


On 2018-04-06 4:13 PM, Rafał Jończyk wrote:
> Dear all,
>
> I am currently programming an experiment that involves solutions that are
> new to me, and hence I'd really appreciate your feedback/support. Below I
> attach (1) the basic procedure in E-prime with an explanation of my
> problem, and (2) a print screen of task events, also with an explanation of
> the problem. First, let me briefly explain the experiment, though:
>
> Participants first see a word for a few seconds, following which they are
> presented with "?" which marks the "idea generation/ideation" stage. When
> they come up with a new idea related to the word, they are asked to press a
> button, vocalise the idea (the "IDEA 1" stage), and press a button again,
> which brings them back to the ideation stage during which they come up with
> a second new idea for the same word, press a button, vocalise it, press a
> button again, etc. This ideation is supposed to last for 3 mins per
> stimulus and then terminate and move on to the next word in the list.
>
> 1) *PROBLEM*:
>
> I don't know if it is possible to set a time limit for a procedure in
> E-prime so that when 3 mins of ideation have passed, E-prime will go to the
> second stimulus in the list and repeat the procedure for other 3 minutes,
> and so on until the list is finished? I assume it will involve setting some
> kind of a clock at the onset of the stimulus presentation saying that when
> the clock has counted 3 minutes, E-prime will move on to the next item in
> the list and repeat the procedure for this item, etc. I tried looking for
> similar problems in the group, but the only I found was about terminating a
> whole experiment using a timer, which is not what I want.
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__lh3.googleusercontent.com_-2DThEYvi0ZmaU_WsfP8EeE82I_AAAAAAAADeg_YCpXe8MlTH8Y-5Ffre6VLcRWR0H9tXQaOfQCLcBGAs_s1600_Presentation.png&d=DwIBaQ&c=nE__W8dFE-shTxStwXtp0A&r=rVCe0bDlnqQHHAg2cizkHg&m=OlOsT9dBWXgVvzJvX0-nQRq8Nbvvt6GoOOCKXNmsblY&s=q4YE2GmjABGJw9U2Lvl4E4Y7C2A5ZqKECbhUl9Zf2h4&e=>
>
> *2) PROBLEM:*
>
> I am using task events to send triggers for my EEG experiment for the first
> time - before I used scripting. I ran into a problem, though. At the stage
> of "ideation" I want E-prime to send 2 triggers: one at the onset of
> ideation and the second when participants press a button (which also
> terminates the stage and takes them to the "IDEA 1" slide). While the
> trigger for the onset of ideation stage is presented, when I press a button
> I get no trigger. However, I get the trigger for the second button press
> that happens on the "IDEA" stages, so it's weird. Is it the case that
> E-prime cannot send 2 triggers for one object?
>
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__lh3.googleusercontent.com_-2DHJYxdcMTM5A_WsfTCcvyirI_AAAAAAAADes_kFv3aQoJLHMHhO0opdQu8tM6zT1UYYZIwCLcBGAs_s1600_Task-252BEvents.png&d=DwIBaQ&c=nE__W8dFE-shTxStwXtp0A&r=rVCe0bDlnqQHHAg2cizkHg&m=OlOsT9dBWXgVvzJvX0-nQRq8Nbvvt6GoOOCKXNmsblY&s=33e0QsCc-7gDDIU2IkSwMmseLqpau7e862CCQU8u4jY&e=>

Rafał Jończyk

unread,
Apr 10, 2018, 1:17:52 PM4/10/18
to e-p...@googlegroups.com
Hi David,

I am using a parallel port. In actual fact, I managed to solve both problems over the weekend, but I did all with scripts (not task events), so I would still like to know - for future reference - what I did wrong with the task events that it did not work.

For problem #1 I used a simple script using Clock.Read:

#Beginning of the procedure:
Dim TimeCounter As Long
TimeCounter = 0

#After stimulus onset:
TimeCounter = Clock.Read

#Check time after each idea generation:

'If 3 secs have passed, jump to Label 1
If Clock.Read > (TimeCounter + 180000) Then
GoTo Label1
End If

It's not ideal, but it seems to be working. However, if you know a more efficient way to script that I'd be happy to find out :).

Thank you!
Rafal


--
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+unsubscribe@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/5ACBAF97.60200%40msu.edu.

For more options, visit https://groups.google.com/d/optout.



--
Rafał Jończyk
Postdoctoral fellow, Department of Psychology, Penn State University, USA
Assistant Professor, Faculty of English, Adam Mickiewicz University, Poland

David McFarlane

unread,
Apr 10, 2018, 1:57:46 PM4/10/18
to e-p...@googlegroups.com
Rafal,

Simply addressing the issue of using Task Events for triggers (markers,
signals) ... When outputting a signal via the ParallelPort or any other
simple digital output, you must first have E-Prime reset any previous
output. (This does not apply to Serial output, where all signals are
temporary by design.) E-Prime does not do this for you automatically --
any signal output on ParallelPort remains on the port until replaced by
another signal. If an existing signal remains on the port, then a new
signal may not be recognized. Also, you must leave any signal on the
port for long enough for the external equipment to recognize it.
Indeed, if you look carefully at the program you have that works without
Task Events, you should see that it enforces these rules in some way,
though perhaps implicitly and not explicitly.

So to use Task Events properly to output a trigger or signal (or
marker), you should add *two* Task Events in tandem. Add one Task Event
to output your trigger, using a Delay of 0. Then add a second Task
Event to output 0 with a delay of, say, 20. That should work to output
your signal for 20 ms then reset the output to 0, ready for the next
Task Event output. This works very neatly, and I use it myself all the
time now.

-- David McFarlane

Rafał Jończyk

unread,
Apr 10, 2018, 6:09:48 PM4/10/18
to e-p...@googlegroups.com
Hi David,

thank you so much! I actually played with it a bit at the beginning but I did not set the delay of the second event to 20ms but to 10 ms which may have not been enough. I will play with it more and try and make it work.

Thank you once again for a prompt feedback!
Best,
Rafal

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages