> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/study-setup-and-design/other-tools/how-to-use-e-prime-with-imotions.md).

# How to use E-Prime with iMotions

Run E-Prime and iMotions Lab on two computers, capture the E-Prime screen with a frame grabber and send stimulus markers over a UDP socket.

This article describes how to collect data with iMotions Lab and E-Prime (2.0 Professional) at the same time.

E-Prime measures reaction times with high accuracy, but its timing is sensitive to other programs running on the same computer. iMotions Lab records several data streams and video at the same time, so run E-Prime and iMotions Lab on separate computers: one for E-Prime and one for iMotions Lab.

You will need the following hardware and software:

1. Two computers, one for iMotions and one for E-Prime, are connected via network cable or through the same wired or wireless network.
2. An Epiphan DVI2USB Framegrabber, to bring the E-Prime display into iMotions as an external scene camera. Please refer to this article for the Frame grabber setup.
3. API module is required to send markers from E-Prime to iMotions to mark the beginning/end of stimuli presented in E-Prime. If you do not have the API module, please contact your Customer Success Manager.
4. If you are interested in using additional sensors like eye tracking, please refer to the Help Center article on how to use iMotions with [Presentation software,](https://help.imotions.com/lab/study-setup-and-design/other-tools/how-to-combine-imotions-with-presentation-neurobehavioral-systems.md) as that setup is very similar to the E-Prime setup.

![e-prime.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-913b0c8e2866466a17bf48f933ce434a71cbc8a3%2F4e65fa0694_e-prime.webp?alt=media)

When creating your iMotions Study to use with E-Prime, select "Scene Recording" as the stimulus.

## Setting up communication between E-Prime and iMotions

### E-Prime setup

1. In E-Prime, make sure your study is set up as a professional study. Double-click the Experiment to see the Structure menu.

   ![blobid0.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-262b8eb5d5f4ea767e25324345e7cef9bdac4994%2F333f1d6424_blobid0-3-.webp?alt=media)
2. Navigate to the devices tab, click "add" and select socket on the next screen

   ![blobid1.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-94064bad4afc3e9a29a584be523ba18bd13ee322%2F0a7bb3d11d_blobid1-2-.webp?alt=media)
3. Now a socket device should appear in the list of devices. Double-click the socket device and the following screen will appear.

   ![blobid2.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-96f1caf9c6f475383ca543deb17027718fcedad0%2Fe322fce86a_blobid2-1-.webp?alt=media)
4. Change the Server to the IP address of the iMotions PC. This address can be found using the "ipconfig" command in cmd or the "network settings" in the control panel in Windows.
5. Connection Type should be "UDP" and byte ordering "Native".

### iMotions setup

1. In iMotions, click Preferences > Global Settings, tab "API".
2. Select "Enable event reception" and make sure the "Port" specified in E-Prime matches the "Port" in the API settings.

   ![The API tab of Global Settings with Enable event reception selected and its port](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-22b774c63facbb2059b600b4e832977622e78d41%2Flab_global-settings_api_event-reception.png?alt=media)

## Sending events from E-Prime

1. In E-Prime, you can now send marker events via the socket whenever a stimulus is presented. To do this you need to edit the "properties" of each of your E-Prime object(s).

   ![blobid4.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-eac93ff0bd80e4599d2755c568eb6edb0c67fd6a%2F0948ec9aff_blobid4.webp?alt=media)
2. In the Properties menu, navigate to the "Task Events" tab. You should have the option to "add" a new event.

   ![blobid5.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-b0ab94c320aa3f33ed18c7ffa49f65b8e280b761%2F1f4e70c9b3_blobid5.webp?alt=media)
3. There are several options available, however, in this example, we want to send a marker when the stimulus starts (StartTime) and when the stimulus finishes (FinishTime).

   ![blobid6.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-f2691cdd40f4d033b60783617b1c5f9d8f5cd3be%2F00dbc957a6_blobid6.webp?alt=media)
4. Start by clicking the ... button. You will be prompted to select the socket you created previously. Once this is selected you should see the above screen. Please use the settings used here. The custom string should be edited to suit the purpose of your study. Please see below.
5. Please be aware that if you use the "pre-release" option in E-Prime, the timing of the start/finish events will be similar and you should add a delay to the FinishTime event, corresponding to the duration of the stimulus. If you are not using the "pre-release" option in E-Prime, the Delay should be = 0.

**Defining the custom string:**

In this particular example, we want all the data belonging to the E-Prime stimulus (**Text1**) to be marked in iMotions. To start marking we use the custom string

**M;2;;;Text1;;S;\r\n**

for the "StartTime" event.

You can change the **Text1** part of the string to the desired marker name you wish to have in iMotions. All other parts of the string should be left "as is". For example, if you would like to send information from the stimulus table in E-Prime, simply use bracketed variables, e.g. \[ID], \[Text] or \[StimNum], etc.

To stop the marker we use the custom string

**M;2;;;Text1;;E;\r\n**

for the "FinishTime" event.

***Please note that the name of the custom string (in this case: Text1) should be identical for the StartTime and FinishTime events.***

For more information on what the custom strings mean, please refer to the iMotions API Programmer's Guide.

## Marker display in iMotions

Please do a test run of your setup before you start collecting real data.

![A recording thumbnail on the Recorded Data tab of a respondent](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-9bba3c6a63a9fbf08d2f430a94b086e8f0bc8d7a%2Flab_respondents_recorded-data_recording-thumbnail.png?alt=media) In iMotions (scene editor) , your events should be visible as seen in the image below. On the right side of the scene editor, you can open a detailed view of the Events to check that your events are streaming incorrectly.

![The Events window of the Recording editor in Detailed view, with Events API markers such as Text1](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-6497286c0e158b708526674f8c687a68a30b12ff%2Flab_analysis_recording-editor_events-detailed.png?alt=media)

When you do a raw sensor export in iMotions you now can sort your data in Excel based on the postMarker column; in this example you will find the marker "Text1"

![blobid9.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-08e1afe2555bb4ef58dbb402362744dde9f67d01%2Fb2c93be156_blobid9.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/study-setup-and-design/other-tools/how-to-use-e-prime-with-imotions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
