plug-in OpenSesame Mac

Posts: 2
Joined: 25 May 2016, 19:54

plug-in OpenSesame Mac

Postby luz0788 » 26 May 2016, 18:11

I am busy at the moment designing a template in Opensesame for a study in which we are going to use the VU-AMS. I found in the website that you have a plug-in for opensesame but that at this moment it is only for Windows. This is kind of a problem as I am currently using a Mac (and also the mac version of the VU AMS). Is there a way around this for Mac users?

User avatar
Posts: 35
Joined: 06 Jan 2012, 12:41

Re: plug-in OpenSesame Mac

Postby JarikdenHartog » 27 May 2016, 09:05

Hi luz0788,

Thank you for your question :-)

The OpenSesame VU-AMS plug-in referred to here is indeed Windows only.

You could use the following workaround I tested on a Mid 2010 Macbook Pro running a freshly installed OS X El Capitan (10.11).

After installing opensesame_3.0.7-osx-1.dmg. You can download this example file that sends a beeping marker to the VU-AMS device.

Note you probably want to use non beeping markers in your experiment, but it is wise to start with a beeping marker so you know the marker is received by the VU-AMS without taking out the CF card.

The beeping marker in the example will mark the offset (and thus the keypress) of the HitAnyKey sketchpad.
If you would like to mark the onset of a sketchpad put the Send Marker inline script in before the sketchpad.

Screen Shot 2016-05-26 at 12.17.41.png
Screen Shot 2016-05-26 at 12.17.41.png (30.08 KiB) Viewed 4961 times

Here are some other strings to send for non beeping markers:

Marker 1:
Code: Select all
ser.write('\x38\x00\x0E\x00\x03\x00\x30\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x01\x00\x00\x00\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4E\x21\x9A\x5D ')

Marker 2:
Code: Select all
ser.write('\x38\x00\x0E\x00\x03\x00\x30\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x02\x00\x00\x00\x42\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0F\x52\x65\xF0 ')

Marker 3:
Code: Select all
ser.write('\x38\x00\x0E\x00\x03\x00\x30\x00\xFF\xFF\xFF\xFF\x00\x00\x00\x00\x03\x00\x00\x00\x43\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x83\xCF\x94 ')


Notes:
  • Leave the “self.sleep(500)” in the closeAMS item to make sure the last marker is send before the connection is closed.
  • Please take care to close the VU-DAMS configuration screen before starting your experiment!
  • You can make VU-AMS recordings without putting on electrode stickers or even without connecting the ECG/ICG electrode cable. You will only record noise but will be able to open the 5FS file in VU-DAMS to check if all event markers are stored. You could even disable the triple beeps you get because of the out of range physiological signals via the Warning button in the configuration window. But don't forget to turn them back on!
  • If this example opens as a text in your browser then please right click and choose Save target as... and choose filename VU-AMSonOSX.osexp

User avatar
Posts: 35
Joined: 06 Jan 2012, 12:41

Re: plug-in OpenSesame Mac

Postby JarikdenHartog » 02 Jun 2016, 12:26

Hi,

In addition I want to add that the workaround above does not use the OpenSesame VU-AMS plug-in (as it is Windows only) so it doesn't have to be installed.

The workaround uses pyserial which is packaged with OpenSesame for OSX by default so nothing extra has to be installed.

The inline script items in OpenSesame are used to:

initialise the serial connection:
Code: Select all
import serial
ser = serial.Serial('/dev/tty.usbserial-12345678')  # open serial port
ser.baudrate = 38400 # set baudrate


send a string which will be received by the VU-AMS device as a marker (the Code below sends Beeping Marker 4)
Code: Select all
ser.write('\x38\x00\x0E\x00\x03\x00\x30\x00\xFF\xFF\xFF\xFF\x01\x00\x00\x00\x04\x00\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8B\x20\xAE\xDF') # write a beeping marker


close the serial connection
Code: Select all
self.sleep(500) # sleep half a second to be sure last marker is send
ser.close() # close port


See the code above in action in this example also mentioned in the previous post.

Return to Software

Who is online

Users browsing this forum: No registered users and 1 guest