Welcome Guest, you are in: Login

EventIDE Wiki

RSSRSS

Navigation




Search the wiki


PoweredBy

Page History: Cedrus XID Element

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2015/01/27 03:08


Element Icon Cedrus XID
Info
Category: Input Registration AddIn: Base Elements
Creator: OkazoLab Team Scope: Parent Event
Owns Snippets: no Usage: Code snippets



Actions aligned with epochs of the parent event

EpochActions
After OnsetThe element starts monitoring button presses/releases and line states. The reaction time timer of Cedrus device is reset to zero.
Control Loop stepTriggered snippet is invoked, if the button or line state changes according to the selected triggering mode.
Before OffsetThe element stops monitoring button presses/releases and line states

Properties

Generic Properties

NameDescriptionConstraintsValue TypeUpon Change
Control
Cedrus PortDefines a name of the Cedrus serial port. The typical names are COM1, COM2 and so forth. You may either type it in or select it from the drop down list. String
Baud RateDefines the data rate in bits per second (bauds) for the Cedrus ports. The Cedrus devices usually use 9600,19200 and 115200 baud rates, depending on the position of the DIP switches on a device.Int32
Triggering ModeDefines the triggering mode for button or line. The First Press Only mode is recommended for response time measurements. A button presses corresponds to the ON state, when a line is monitored.enum
Monitored ButtonDefines a button or line monitored by the element. If 'Any' is selected, the element monitors all buttons and lines on the selected Cedrus device. In this case, a name of the pressed button or activated line is returned by the Triggering Button property. The property editor provides a press detector that can be used to find a name of the target button.String
Runtime status
Triggering TimeReturns the Cedrus reaction time that corresponds to a cause of the element trigger,e.g. a button press. When Holding Down' mode is used, the property returns a local event time while the button is down. The value can be used an accurate measure of the response time.clTime
Is TriggeredIndicates whether a button or line has been triggered at least once since the onset of the parent event. The property resets on every event onset. This property can be naturally used to gate switching between events.Boolean
Triggered ButtonReturns a name of the triggered button or line (pressed or released depending on the Triggering Mode). Buttons are named with a number, as "Bitton n", whereas the input line are names as "Line n".String
Is DownIndicates whether the monitored button/line is currently in the down/ON state respectively. Boolean

+=== Properties inherited from clElement === Inherited properties of clElement
NameDescriptionConstraintsValue TypeUpon Change
Control
Is EnabledIf set to false the element is completely omitted when the experiment is run.Boolean
TitleTitle of the element.String



Cedrus XID element monitors button and line states on the Cedrus input devices that support the XID (eXperimental Interface Device) protocol. The supported XID devices include the RB Series and Lumina response pads, StimTracker marker and SV-1 voice key.


Description

The Cedrus XID element monitors a state of input device and collects accurate timing statistics of button presses, button releases and changes in the device's auxiliary input lines. The element uses an internal timer of Cedrus hardware (when available), which allows to record more accurate response times than when a standard keyboard is used. Multiple Cedrus XID element elements can be used to record from one or several input devices in parallel. The Cedrus XID element monitors button presses only within a scope of its parent event and return timing statistics relatively the onset of the parent event.

Supported Cedrus devices (with links)

RB Series response pads

RB Series response pads


MRI compatible Lumina response unit

MRI compatible Lumina response unit


StimTracker marker unit

StimTracker marker unit


SV-1 voice key unit

SV-1 voice key unit


Selection of the monitored button or line

Cedrus XID element can monitor either one specific button or line, or all buttons and lines in the same time (when 'Any' Button is selected in the Monitored Button property). In many experimental tasks, e.g.2AFC, there are two response buttons for a participant. Due to flexibility of the Cedrus XID element, for the 2ADC tasks you can use different design patterns:

  1. Create two Cedrus XID elements, each monitoring one of the predefined response buttons or lines
  2. Create one Cedrus XID element monitoring Any button and write code that checks what button is pressed. The name of the pressed button is returned by the Triggered Button property

Both patterns are eligible. The first pattern allows to automatically ignore presses of irrelevant buttons. The second pattern is more convenient for collecting a reaction time in trial, because you can get from a single proxy variable link to the
Triggering Time property of Cedrus XID element.

Triggering modes

The Cedrus XID element can detect any button state, not only presses. There are 5 'triggering' modes, in which the element can operate. You need to select the triggering mode in advance, according to your requirements:

  • First Press Only
  • First Release Only
  • Multiple Presses
  • Multiple Releases
  • Holding Down

Depending on the working mode, the element becomes 'triggered' when a specific input pattern is detected. The
First Press Only mode is the default choice for registering the fastest reaction time, because in this mode the element picks up the first button press ignoring the rest. Other modes are self-explanatory, save for the holding down mode, which detects continuous presses, commonly used in the game-like activities.

Button Names

The Cedrus XID uses a simple button naming, based on the button index: "Button 1", "Button 2" and so on. The input lines are named similarly: "Line 1","Line 2" and so on. Be aware that you need to maintain capital letter in the names, while operating on them in C# code. You can easily find out the actual button name, using the design-time press detector on the Cedrus XID element. Open an editor for the
Monitored Button''' property and move the mouse cursor over the picture with a web. Then, press the desired button and check its name in the top row:

Using the press detector  to set the monitored button  or find out the button name

Using the press detector
to set the monitored button
or find out the button name


Triggered Snippet

The button element can invoke custom user code each time, when it becomes triggered (e.g. on a button press). To engage the triggering snippet, open it via the snippet panel and write your code there. Note that the triggered snippet is invoked only once, on the first press, when the 'First Press Only' triggering mode is selected. The triggered snippet can be used for checking a name of the pressed button:


if (TriggeringButton=="LeftArrow")
    Positon.X=PositionX-1;
if (TriggeringButton=="Right")
    Positon.X=PositionX+1;



Practical Use

Technique 1

  1. Step 1
  2. Step 2

Technique 2

  1. Step 1
  2. Step 2

 // Check the trial outcome. Result and RT just other user variables
// insert code snippet here..

Notes

  • Insert Notes here..
  • Insert Notes here..

ScrewTurn Wiki version 5.2.0.8. Some of the icons created by FamFamFam.