The 'Task Events' feature improves upon E-Prime 2.0 Professional's ability to communicate with external devices by offering a variety of trigger signals to be sent when specific time-critical events occur during an experiment. Previous versions of E-Prime provided some limited support for this type of communication, but only by way of complex design and/or advanced E-Basic scripting techniques. These capabilities can now be achieved using the E-Studio graphical user interface, with greater precision and without the need to write InLine script.
It is easiest to think of Task Events in terms of 'cause' and 'effect', where the Event is the cause and the Task is the effect. For example, your experimental setup may require that a signal is sent to the serial port of the experimental PC (the task of writing a value to the port occurs, or effect), when a stimulus is displayed (the experimental event, or cause). A number of experimental events, including those related to stimulus preparation, stimulus presentation, and collection of participant responses, are supported Events. Multiple communication devices are supported Task devices. Therefore, Task Events, by their design, can support a wide range of communication needs.
Overviews of how to add a Task Event to an experiment can be found in the E-Prime 2.0 New Features Guide and in the following YouTube video: http://www.youtube.com/watch?v=0oxtfdZb0Fo. A more detailed description of how to add Task Events to an experiment is provided in this Knowledge Base article.
- Step 1: Determine the appropriate Communication Device
The first step in adding a Task Event to an experiment is to choose the communication channel through which you will send signals to the external device. Task Events support communication though the computer's Parallel Port, Serial Port or Socket. The type of communication device you choose is dependent on both the setup of your computer and the external device. A given computer may not have access to one or more of these devices and the external device may only be compatible with a subset of the supported communication devices. Each type of device has its benefits and drawbacks, but ultimately this decision is restricted by the hardware.
Note that Task Events do not support bi-directional communication; you cannot process a signal sent from an external device to E-Prime with Task Events. This type of communication is supported in E-Prime, but it requires user-written E-Basic script to send and receive data from a communication device. For further information, see KB 1317 - INFO: How do I Receive a Signal from an External Device?
Once you have determined which communication device you are using to send signals, you need to add the device to the experiment. This is accomplished by double clicking on the Experiment Object at the top of E-Studio's 'Structure' window. This opens up the 'Experiment Properties' page. Along the top of this page are several tabs which represent different sections of upper-level properties that can be altered in the experiment. Click on the 'Devices' tab...
The 'Devices' tab contains a full listing of all of the hardware components that can be activated during the experiment. This is where you add a communication device. To do this, click on the 'Add...' button in the bottom left-hand side of the page. This brings up a full list of hardware devices that can be added to the experiment. Select the communication device that you have chosen (Parallel, Serial, or Socket) and click 'OK'. You should now see the device you just selected appear as the last Device listed on this page. At this point, you have only activated the device for use in the experiment. Later, in Step 4, you will refer to this communication device when defining the Task details.
You may need to alter one or more of the default properties for the device. For example, if you are communicating through the Parallel port, then you will need to set the LPT value of this device so E-Prime knows though which port to send its signals. Open up the communication device's 'Properties' page by double clicking on it. In the 'Properties' Page, make sure that all of the property values are correct. You may need to contact your IT department for this information. Once you have verified that this information is correct, click 'OK' to save the changes and exit both the communication device's 'Properties' page and the 'Experiment Object's Properties' page.
- Step 2: Identify the Object that contains the Task Event
One of the most important parts of sending signals from E-Prime to an external device is deciding exactly when in the experiment the signal should be sent. In order to do this, you must identify the object that "owns" the pivotal event. In other words, which E-Studio object includes the event that causes the Task to occur? For example, if the Event is related to the presentation of a prime, the display object that presents the prime should be selected; if the event is related to the participant's response, then the object that enables the Input Mask should be selected. The location of the is object of interest is specific to your paradigm; identifying the correct object requires you to have a firm understanding of how the external device will utilize the signals that are sent when the Event occurs. This goes along with a firm understanding of the events listed below in Step 3.
Once you have determined when you would like to send a signal in an experiment, find the corresponding E-Object in E-Prime's 'Structure' window. Double-click on the object; this displays the object and its features in E-Studio's Workspace.
- Step 3: Adding the Event (the cause)
To add a Task Event to the selected object, click on the 'Properties Pages' icon which is located in the object's top left-hand corner. This brings up the object's Properties pages. Select the 'Task Events' tab, which is located just to the right of the 'Duration/Input' tab on each supported object. An example is shown below for a TextDisplay object:
To add an Event, click on the 'Add...' button located about one third of the way down the tab. A window appears that asks you to select which Event to use as the 'cause' of the signal that will be sent. These Events, or 'causes', range anywhere from the OnsetTime of the object to a response from a keyboard, mouse, SRBox, Port, and ParallelPort device.
A full listing of these Events is shown here:
|Object Type/Parent Object||Event Name||Description|
|RTEObject (parent of all objects, including the Slide, TextDisplay, ImageDisplay, and SoundOut objects)|
|ActionTime||occurs when the object finishes its critical action (displaying text, image, etc...)|
|FinishTime||occurs when the RteObject finishes execution of its Run method|
|OffsetTime||occurs when the object ends its critical action (displaying text,displays an image, playing a sound file, etc)|
|OnsetTime||occurs when the object begins its critical action (displaying text,displays an image, playing a sound file, etc)|
|StartTime||occurs when the RteObject begins execution of its Run method)|
|MaxCountReached||occurs once the MaxCount property for an Input Mask has been reached|
|TimeLimitReached||occurs once the TimeLimit property of an Input Mask has been reached|
|TerminationResponse||occurs once E-Prime registers that the Input Mask's Termination Response has been pressed|
|RESPChanged||occurs once E-Prime registers that a unique response has been made. This does not apply to the very first response to an object, but to every response after that.|
|Release||occurs once E-Prime registers that an Input Mask response has been released|
|Press||occurs once E-Prime registers that an Input Mask response has been pressed|
|InputDevices (Joystick, Keyboard, Mouse, ParallelPort, Port, SRBox)|
|Release||occurs when E-Prime registers a release from the specified input device. Note that the release event is unrelated to an Input Mask and is specific to the InputDevice|
|Press||occurs when E-Prime registers a press from the specified input device. Note that the press event is unrelated to an Input Mask and is specific to the InputDevice.|
Select the event of interest, and then click 'OK'. For this example, the TextDisplay object’s OnsetTime is the event.
Next, choose the Task Device which will generate a response (e.g., which device will carry out the 'effect'). Currently supported objects are ParallelPortDevice, SocketDevice, and SerialDevice.
Note: these devices will only appear in the 'Name' field if they have already been enabled as Experiment Object devices.
Once the Device for the Task has been selected, consider if a value should be specified in the 'Delay' field. The Delay value represents the minimum number of milliseconds to delay in scheduling the Task to occur. For example, a typical scenario would be to trigger the ParallelPort to set a bit high at the onset of an object and then bring the ParallelPort bit low 50 ms later. To achieve this, configure one ParallelPort task for a zero Delay and then another with a 50 ms Delay.
After choosing the Device for the Task, select an item from 'Action' drop-down box to specify the action that will transpire (the 'effect') from the list of available actions. For example, the ParallelPortDevice supports the ResetBit, ToggleBit, SetBit, and WriteByte actions.
Once an Event and Task has been chosen, the final configuration option is specifying the data to be sent to the Task in the 'Source' field. The 'Source' field can be set to one of the pieces of data that each event offers, or to a custom piece of data that you choose. Click on the 'Source' drop-down box to view a list of supported data for the event. For example, the 'OnsetTime' event offers the timestamp of the event.
Each Source parameter, either one that the event supports or a custom value, can have a data type associated with it. Click on the 'Data Type' drop-down box to view the available data types for the specified parameter.
This topic applies to:
E-Prime 2.0 Professional
This topic introduced in E-Prime 22.214.171.124.
J Scott Saults
If an Input Maskâ€™s Time Limit property is greater than an objectâ€™s Duration property, then all Task Events associated with that particular Input Mask cease to work properly once the Duration of that object has been reached, even if the Time Limit of the Input Mask has not.
J Scott Saults
'ACC' does not work consistently as a 'Source' for InputMask Task Events. Supposedly, selecting 'ACC' as the 'Source' for a Task Event allows you to send the accuracy of the current trial to an exteranal device. If you select 'ACC' as the 'Source' for Stimulus.Keyboard(1).Press, the program will compile and run, but will then cause a Runtime Error: ParameterSource not found: 'ACC'. However, 'ACC' will work as the 'Source' for Stimulus.Keyboard(1).MaxCountReached and Stimulus.Keyboard(1).RESPchanged without this runtime error, but will send a '1' only if a correct response occurs before the duration of the Stimulus object has been reached, even if the InputMask exceeds that time. On the other hand, 'ACC' does not even appear as a 'Source' option for Stimulus.Keyboard(1).Release.
J Scott Saults
The pulldown selection button for the "Enabled" property does not work as expected. Clicking on the "Enabled" pulldown button either does nothing or displays only an empty option. However, the current Task Event can be enabled by typing "Yes" in the Enabled property box and disabled by typing anything other than "Yes" in the Enabled property box.