Scanner related questions

How do I get the trigger and button box responses?

We updated the trigger on August 25, 2020. Instead of coming from a separate device, the trigger and button box responses will now both come from the Current Design controller box.

Device name: 932
Trigger: will be either 5 or t, depending on whether you choose numbers or letters on the Current Design box (instructions coming soon!).

In Matlab, you can get this by using: KbName(‘5%’)

*Note: Previously, the button box responses came through on a separate device (932) from the trigger (Xkeys). That is no longer the case. This might effect the way you are getting responses. You can no longer assume anything that comes in from the 932 device will be participant responses. So you need to somehow filter the triggers out when looking for responses, and filter out responses when looking for the trigger. In Matlab this can be done by using the keylist in KbQueueCreate.

How to put condition markers into the Biopac trace.

The Biopac has a trace that includes the trigger, but if you would like to include additional condition markers this can be done by having your stimulus presentation computer send them to the Biopac. This is done via a USB to ttl converter made by the blackbox company. To communicate with it, you send it hexadecimal codes via a serial write command. You get 8 channels to use for condition markers.

Hex codes for channels 1-8 – though they show up as channels 28-35 on the Biopac.
So channel 7/34 will be active if you send the code ’40’.

The channel will remain on (measure 5 volts) until you turn it off:

If you want to turn them all on: ‘FF’
To resent the device: ‘RR’

They provided the following example code in the user manual:
black box's suggestions for how to interact with the equipment from Psychopy, Eprime, and Matlab
*They left of the command for opening the port off the Psychopy and Matlab examples.

In general, it might be easier to analyze if you send discrete markers for your conditions, so turn the channel on the off right after each other, as opposed to how they suggest, which is leaving the channel on the whole time the stimulus is up.

Required Drivers and figuring out the port name

The first time you use this with a new computer you will need to install drivers.
For windows instructions, see USBTTLv1r16>their manual page 7. It also tells you how to get the COM name.
For Mac, see their special Application Note on installing the drivers. Under the section Checking Operation of the new VCP, part a tells you how to find the name of the port. You do not have to do any other steps in this section. On my computer, the name would change from time to time, so best to always check. For example: port=serial(‘/dev/tty.usbserial-00004414’).

Timing config and testing

Both manuals go into setting the latency. For PC, it is on page 9 of the manual, for the Mac it is in the Application Note under the section: How to set FTDI Driver Latency to be as low as Possible.

If timing is very critical to you, you should use this with a PC, which has a GUI interface for verifying timing. On the Mac, there is no simple way. Given the Biopac receives the trigger directly from the scanner, we can use it to bench mark the timing in the Mac. I compared the timing of the triggers from the scanner to a condition marker I sent from Matlab after it detected a trigger. This loop involves going from the scanner, to the button box controller, to the stimulus computer, Matlab reading in the trigger, and then sending out a write signal, so the timing would be expected to be off by a bit regardless of the converter timing. After some initial timing, I found the average offset to be around 4.4. histogram of Biopac timing. Average offset of 4.4, standard deviation of 1.6, mode 4.

Importantly, the first call to longer (30ms) to put a condition marker in the trace. Therefore, I would suggest turning on all the pins (FF), and turning them off (00) once before you get the first trigger in your experiment.

How to use the video grabber to see if the eye is open.

The video grabber should be run off of it’s own computer. If you do not use the biopac, that Mac is setup to use the video grabber.

  1. Log into your own computer or the Mac in the control room. If using the Mac, login with your BU credentials. If this is your first time logging into that machine, make sure the ethernet is plugged in at the back. Often the biopac ethernet is plugged in instead.
  2. Connect the device to the computer you are using via the USB cable. There is an extender behind the Mac if needed.
  3. If you are using your own computer, you will have to download the grabber software the first time from their website: While it says Mac is no longer supported, it has still worked on all the Macs so far.
  4. Open the application, VGA2USB.
  5. Set some preferences. On the Mac this is done by going to the top menu bar, VGA2USB->preferences.
    • Under General: Usually you can select grayscale and enable hardware cropping. These will both cut down on the size of your files which can get large quickly.
      • To grab just the small box with the eye, set this to: Left: 0, Top: 650, width: 100, height: 768.
      • To grab the whole bottom rectangle, which you might want to do if you are sending eyetracker codes for conditions: Left: 0, Top: 650, width: 1024, height: 768.
    • Under Recording: Set the files to save where you want them to. The default is the desktop. They will save out with the generic name It will not overwrite, so the next one would be and so on. You can change the name afterwards to something more meaningful.
  6. Hit the circular button at the top middle of the recording window to stop and start the recordings. If you don’t have the eyetracker sending codes you should as closely time this to the first trigger as possible. This can be done by watching the Current Design box
  7. Make sure to change the name afterwards to something more meaningful. If you are using the shared Mac, make sure you remove your files promptly. I suggest right after the scan, and then when you come for your next one, delete the last session – by this time you should have been able to get them to your local storage space and verified everything was ok.