Labeling EEG Triggers

635 vues
Accéder directement au premier message non lu

mvinski

non lue,
6 févr. 2013, 20:23:0306/02/2013
à e-p...@googlegroups.com
Hi All, 

I am using inline code (WritePort) in Eprime2 to send triggers from the test computer to an EEG computer. 

I would like to add a label to each trigger that specifies what type of trial that specific trigger is associated with (there are several levels to several variables). Does anyone have any insight for how I might go about doing this?

Thank you in advance!
M

Peter Quain

non lue,
6 févr. 2013, 20:40:4506/02/2013
à e-p...@googlegroups.com


An example using native parallel port (Decimal address = 88, therefore Hex address 378) to send bytes to a NeuroScan system using Hex notation (&H...), which would appear in NeuroScan .cnt file as trigger codes 1 to 10:

' assess item level and send appropriate trigger code to NuAmps
If c.GetAttrib ("numobs") = 1 then
                 WritePort &H378, &H1

        elseif c.GetAttrib ("numobs") = 2 then
                 WritePort &H378, &H2

        elseif c.GetAttrib ("numobs") = 3 then
                 WritePort &H378, &H3

        elseif c.GetAttrib ("numobs") = 4 then
                 WritePort &H378, &H4

        elseif c.GetAttrib ("numobs") = 5 then
                 WritePort &H378, &H5

        elseif c.GetAttrib ("numobs") = 6 then
                 WritePort &H378, &H6

        elseif c.GetAttrib ("numobs") = 7 then
                 WritePort &H378, &H7

        elseif c.GetAttrib ("numobs") = 8 then
                 WritePort &H378, &H8

        elseif c.GetAttrib ("numobs") = 9 then
                 WritePort &H378, &H9

        elseif c.GetAttrib ("numobs") = 10 then
                 WritePort &H378, &HA
End If

... here is a conversion tool:

http://easycalculation.com/hex-converter.php

--
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/msg/e-prime/-/BEjt5C5n6n8J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alphonse Stickle

non lue,
6 févr. 2013, 20:42:0306/02/2013
à e-p...@googlegroups.com

.. for clarity sake, sorry, typo - Decimal address = 888, not 88

Melaina Vinski

non lue,
7 févr. 2013, 09:11:4307/02/2013
à e-p...@googlegroups.com
Thank you for your quick reply! We are using a serial port - do these instructions follow for serial ports as well? 

Also, if I want to include more than 1 condition to label the trigger (so not just "numbos", but also "type" for example), would I be okay with using:

elseif c.GetAttrib ("numobs") = 10 
          and c.GetAttrib ("type") = 3 then
                 WritePort &H378, &HA

Thank you kindly in advance - I appreciate the help!

M


--
Melaina T. Vinski
MSc Candidate
Psychology, Neuroscience & Behavior
Cognitive Sciences Lab
McMaster University
905-525-9140 ext. 22853

Peter Quain

non lue,
7 févr. 2013, 16:50:4307/02/2013
à e-p...@googlegroups.com

I've never used serial device. Sure, you can write to it, but I think what you write will depend on how your EEG system is designed to receive event information (detailed in its manual?). Others who know these things will have to help.

Maybe look in e-basic help, for "SerialDevice Object (topic)"

Or search this group for serial port ... here is a post by David McFarlane, for example, who obviously knows of these things:

https://www.pstnet.com/forum/Topic4793-8-1.aspx#bm4801

A couple of examples from google search of e-prime code to interface with different external systems through serial port:

http://www.mindmedia.nl/CMS/en/support/knowledge-base/item/272-how-to-run-an-e-prime-project-by-using-the-nti.html

http://www.cedrus.com/support/stimtracker/tn1411_eprime.htm

good luck
--
For more options, visit https://groups.google.com/groups/opt_out.
 
 




--
Melaina T. Vinski
MSc Candidate
Psychology, Neuroscience & Behavior
Cognitive Sciences Lab
McMaster University
905-525-9140 ext. 22853

Melaina Vinski

non lue,
7 févr. 2013, 22:40:5807/02/2013
à e-p...@googlegroups.com
Thank you for your insights Peter!

David McFarlane

non lue,
8 févr. 2013, 16:07:0908/02/2013
à e-p...@googlegroups.com
PMJI, but for the record, I think you could replace that particular
block of If-Then-ElseIf with just

WritePort &h378, c.GetAttrib("numobs")

Of course, that works because of the regularities in this particular
example, for more arbitrary mappings you might still need the
If-Then-ElseIf, or put the mapping into an array and do something like

WritePort &h378, MapArray( CInt(c.GetAttrib("numobs")) )

-- David McFarlane

David McFarlane

non lue,
8 févr. 2013, 16:11:4508/02/2013
à e-p...@googlegroups.com
If you use the latest version of EP2, then I highly recommend looking
into the new Task Events feature, see
http://www.pstnet.com/support/kb.asp?TopicID=4803 or the New Features Guide.

-----
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
http://support.pstnet.com/e%2Dprime/support/login.asp , 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.
\----
>>><http://easycalculation.com/hex-converter.php>http://easycalculation.com/hex-converter.php
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message