[FieldTrip] realtime buffer does not exit

Boris Reuderink b.reuderink at donders.ru.nl
Fri Sep 14 12:21:52 CEST 2012


Dear Elizabeth,

It is indeed possible (perhaps preferable) to run the FieldTrip buffer outside of the MATLAB environment. Basically, the 'demo_buffer.exe' functions as a stand-alone server that holds the neuro data. Then, you would need a client, that reads from your acquisition hardware and writes new samples and events to the server. FieldTrip has programs for many different acquisition systems, see [1]. Your MATLAB program can then act as another client and read form the buffer.

The advantage of this setup is that you can restart your MATLAB session without disrupting the FieldTrip real-time buffer. You can even run the serving buffer and your MATLAB code on different computers in you lab.

Without additional details I can only guess why you got the error message you described. Perhaps the ft_host and ft_port are not set correctly? For ft_host you could try 'localhost' or '127.0.0.1', and for ft_port the default is 1972. These settings tell FieldTrip to connect to a buffer (=server) on the same computer.

If you can't get it to work, please don't hesitate to ask. BTW, some background information on real-time signal processing with FieldTrip can be found on [2] — perhaps that is useful.

Best regards,

Boris Reuderink

[1] http://fieldtrip.fcdonders.nl/development/realtime/implementation
[2] http://fieldtrip.fcdonders.nl/development/realtime/buffer_overview
--
twitter.com/#!/breuderink | github.com/breuderink | borisreuderink.nl

On 13 sep. 2012, at 14:51, "Elizabeth Anne Bock, Ms" <elizabeth.bock at mcgill.ca> wrote:

> Thanks for the feedback.  However, I would like to read the header and the data from the buffer into Matlab (I am doing realtime processing of the data).  Is this possible to run  the buffer in the windows environment and then read from it in Matlab?
> 
> hdr = buffer('get_hdr', [], ft_host, ft_port)
> ??? Error using ==> buffer
> ERROR: failed to create socket (1)
> 
> Thanks,
> Beth
> 
> ------------------------------------------------------------------------------------------
> 
> Elizabeth Bock / MEG System Engineer
> 
> McConnell Brain Imaging Centre / Montreal Neurological Institute
> 
> McGill University / 3801 University St. / Montreal, QC H3A 2B4
> 
> 
> 
> MEG Lab: 514.398.6056
> 
> Mobile: 514.718.6342
> 
> ________________________________________
> From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Stolk, A. [a.stolk at fcdonders.ru.nl]
> Sent: Thursday, September 13, 2012 5:05 AM
> To: FieldTrip discussion list
> Subject: Re: [FieldTrip] realtime buffer does not exit
> 
> Hi Elizabeth,
> 
> Could you try and start the buffer from outside matlab using 'demo_buffer.exe' (to be found in the 'realtime/bin/win32' directory)? This application may operate smoother than when starting the buffer from a single matlab thread.
> 
> Best,
> Arjen
> 
> ----- Oorspronkelijk bericht -----
>> Van: "Elizabeth Anne Bock, Ms" <elizabeth.bock at mcgill.ca>
>> Aan: fieldtrip at science.ru.nl
>> Verzonden: Woensdag 12 september 2012 20:32:39
>> Onderwerp: [FieldTrip] realtime buffer does not exit
>> I am using the realtime buffer and I have found I cannot exit the
>> buffer within the Matlab command window. I am forced to exit Matlab
>> or, more often, must kill the process manually from the windows task
>> manager. I am using Windows XP to host the buffer and Linux to run
>> acqftx. Here is what I am seeing:
>> 
>>>> buffer('tcpserver', 'exit', ft_host, ft_port)
>> In main: requesting cancelation of tcpserver thread
>> 
>>>> buffer('tcpserver', 'init', ft_host, ft_port)
>> ??? Error using ==> buffer
>> thread is already running
>> 
>> Any suggestions?
>> Thanks,
>> Elizabeth
>> 
>> 
>> ------------------------------------------------------------------------------------------
>> 
>> Elizabeth Bock / MEG System Engineer
>> 
>> McConnell Brain Imaging Centre / Montreal Neurological Institute
>> 
>> McGill University / 3801 University St. / Montreal, QC H3A 2B4
>> 
>> 
>> 
>> MEG Lab: 514.398.6056
>> 
>> Mobile: 514.718.6342
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip





More information about the fieldtrip mailing list