E-Prime and VU-AMS

Last modified by Iris Spruit on 2023/02/09 15:44

Introduction

This document describes how to use E-Prime with the Vrije Universiteit Ambulatory Monitoring System (VU-AMS). For this the AmsSerial.dll is necessary. The official E-Prime example can be downloaded here. Note that the template available on the VU-AMS website does not work well on Windows 10 and does include the dll. The template has been updated by SOLO, and can be downloaded (including dll) here (download from Github starts immediately).

Short manual

Make sure that the AmsSerial.dll file is installed on your computer and located either in the Windows system directory, or in the same directory as where the E-Prime task is located. Copy the User Script from the template task to your task. Also, copy the Connecting Text object and AMSConnect InLine and AMSdisconnect InLine. These InLines do not need to be modified. Note that in the AMSConnect InLine a marker with value 1000 + subject number is sent to the VU-AMS.

Sending markers/events

The trial procedures in the VU-AMS-template-E3.es3 file include InLines with several examples of how to send markers. Note that although in the task it is referred to as ‘marker’, following the Markers and Events documentation, it would be categorized as events. That is, the pulses being sent have only one timestamp. However, following the sample E-Prime task, we will henceforth call them markers.

To send markers, you can choose one, or a combination of the following markers:

A ‘generic’ marker. This marker does not have a value. In the data file it is shown as a marker with value 0. Since one cannot distinguish between the markers when using this type of marker, it is not recommended to use this marker (for an example of its use, see the E-Prime template file).

A beeping marker. Same as the previous marker, but accompanied by a beeping sound of the VU-AMS (for an example of its use, see the E-Prime template file).

A coded marker. This marker is accompanied with a value, specified by the user and therefore the recommended method of sending a marker. The marker value is specified in the following part:

lResult = AMS_SendCodedMarker(<MarkerValue>)
'takes about 18 milliseconds for AMSi RS232 and 30ms for AMSi USB version
If lResult <> 0 Then
    
Debug.Print "ERROR SendCodedMarker(1)"
End If
c.SetAttrib "AMS_CodedMarkerResult", IIf(lResult=0, "OK", "ERROR")

The <MarkerValue> can be any integer. It is possible to refer to an attribute when sending the marker value, e.g.:

lResult = AMS_SendCodedMarker(CInt(C.GetAttrib("StimulusMarker"))

A beeping coded marker. This marker is the same as the previous marker, but is accompanied by a beeping sound of the VU-AMS (for an example of its use, see the E-Prime template file).

Steps when running an experiment with E-Prime and VU-AMS

  • Connect the VU-AMS to your computer (see the VU-DAMS manual, which can be downloaded here, for more information on how to do this). Note that the VU-AMS needs to stay connected to the computer for the whole task in order for it to receive any markers.
  • Open the Data Analysis and Management Software (VU-DAMS) program.
  • Go to Devices and Connect using Serial cable.
  • Here, you can choose different settings (see the VU-DAMS manual, which can be downloaded here, for more information).
  • When you are ready to start the physiological measurements, click Start.
  • IMPORTANT: Close the settings window (Close).
  • Start the E-prime task.
  • E-Prime will try to connect to the VU-AMS. When this is successful, you will see the following message: Sending subject marker: OK, press OK. When the connection fails, you will receive an error (see Error messages section below) and the task will continue, but no markers will be sent to the VU-AMS.
  • Then the task will start.
  • When the task is finished, go back to the VU-DAMS program and go to Devices and Connect using Serial cable. Then, press Stop to stop the recording.
  • The VU-AMS data is saved on the memory card in the VU-AMS.

Error messages

The following error messages can occur:

  • “ERROR: VU-AMS not connected or VU-DAMS settings window still open. Task will continue without VU-AMS.” – The COM port to which the VU-AMS is connected is not found. This is because the VU-AMS is not (properly) connected to the computer or because the VU-DAMS settings window is still open (see steps described above). The task will continue without sending markers to the VU-AMS.
  • “ERROR: Update AmsSerial.dll” – An old version of the AmsSerial.dll file is installed on the computer. The file needs to be updated. The task will stop.
  • “ERROR: AMS is not recording! Task will continue.” – The VU-AMS is connected to the computer, but not recording. This means that the VU-AMS recording was not started from the VU-DAMs program. The task will continue without the AMS recording.
  • “ERROR: MarkerMode Error” – Markers cannot be sent to the VU-AMS. This can be because the VU-AMS is not (properly) connected to the computer.
  • “Warning: Don’t use Marker” – Markers cannot be used.
  • “Warning: Don’t use CodedMarkers” – Coded markers cannot be used.