<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>CheckPort</title><revhistory><revision><revnumber>2</revnumber><date>2015-10-06 10:49:31</date><authorinitials>OlafHauk</authorinitials><revremark>Renamed from 'EyeTrackingCheckPort'.</revremark></revision><revision><revnumber>1</revnumber><date>2015-10-06 10:48:30</date><authorinitials>OlafHauk</authorinitials></revision></revhistory></articleinfo><para>You can include this bit of code in your <ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/meg/CheckPort/meg/PsychToolbox#">PsychToolbox</ulink> script to make sure you have selected the right port of the stimulus PC: </para><screen><![CDATA[function memento(MEG)
% Very simple script to check whether the correct port is selected
%
% memento must pre preceded by the MEGSynchClass constructor
% e.g.
% MEG  =  MEGSynchClass;
% memento(MEG)
%
%alessandro.tomassini@mrc-cbu.cam.ac.uk
]]><![CDATA[
]]><![CDATA[
try   
 MEG.WaitForButtonPress(0.0001)
 strcmp(MEG.LastButtonPress',MEG.LastButtonPress);
catch
    h=warndlg('Check if NI CARD is selected!');
    uiwait(h);
end
end]]></screen></article>