FT_POLL_BUFFER

Note that this reference documentation is identical to the help that is displayed in Matlab when you type “help ft_poll_buffer”.

  FT_POLL_BUFFER polls the FieldTrip buffer described by 'filename' for
  the number of events and samples. You can also use this function to
  wait up to a given amount of milliseconds until the number of samples
  OR the number of events present in the buffer is bigger than a specified
  threshold. The output of this function is a struct with elements
  'nsamples' and 'nevents', that always contain the current quantities.
  (So in case of timeouts, these might be smaller than the thresholds).
 
  Examples
  --------
  The following will immediately return the two quantities:
  >> numbers = ft_poll_buffer('buffer://localhost:1972');
 
  The following will wait up to 50 milliseconds for more than 100 samples in the buffer.
    thr = []; thr.nsamples = 100; timeout = 50;
    numbers = ft_poll_buffer('buffer://localhost:1972', thr, timeout);
 
  The following will wait up to 80 milliseconds for more than 30 events in the buffer.
    thr = []; thr.nevents = 30; timeout = 80;
    numbers = ft_poll_buffer('buffer://localhost:1972', thr, timeout);
 
  Repeatedly wait for new data (either samples or events):
 
    lastNum = []; 
    lastNum.nevents = 0; 
    lastNum.nsamples = 0; 
    timeout = 100;
    while someCriterion
       newNum = ft_poll_buffer('buffer://localhost:1972', lastNum, timeout);
       if newNum.nsamples > lastNum.nsamples
          ... read and process samples ...
       if newNum.nevents > lastNum.nevents
          ... read and process events ...
       lastNum = newNum;
    end

reference/ft_poll_buffer.txt · Last modified: 2012/05/23 23:02 (external edit)

You are here: startreferenceft_poll_buffer
This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0