[FieldTrip] Need Help with Fieldtrip Buffer Interaction with AcqKnowledge

Nathan Yang npyang at uci.edu
Mon May 5 09:11:51 CEST 2025


To whom it may concern:

Hello, I am a college student and I am trying to collect live EMG data
from a BIOPAC MP160 using the FieldTrip buffer so I can run the
signals through a machine learning model. I went through the tutorials
but am still having trouble (I am pretty lost haha). I will give a
rundown on the background of my setup. Also if anyone has better ideas
of how I can approach this please let me know.
I am running AcqKnowledge NDT on TCP port 1972 and I am running
buffer.exe on port 1972 as well. Also in my path
"fieldtrip/realtime/bin/win64", I did not see "sine2ft" or "viewer" so
was unable to further test.

This is my matlab code (process1.m):
addpath(“fieldtrip-20250106\”);
ft_defaults;
while true
   hdr = ft_read_header('buffer://localhost:1972');
   disp(hdr);
   pause(1);
end

However, when I run it this is what returns.
>> process1
Error using buffer
ERROR: the buffer returned an error (517)
Error in ft_read_header (line 1328)
      orig = buffer('get_hdr', [], host, port);
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in process1 (line 4)
    hdr = ft_read_header('buffer://localhost:1972');

I will also provide my ports and the IDs so you can see what is happening:
netstat -an | Select-String "1972"
  TCP    0.0.0.0:1972           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1972           0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1972         127.0.0.1:62529        ESTABLISHED
  TCP    127.0.0.1:62529        127.0.0.1:1972         ESTABLISHED

netstat -a -n -o | findstr :1972
TCP 0.0.0.0:1972 0.0.0.0:0 LISTENING 26652
TCP 0.0.0.0:1972 0.0.0.0:0 LISTENING 10956
TCP 127.0.0.1:1972 127.0.0.1:62529 ESTABLISHED 10956
TCP 127.0.0.1:62529 127.0.0.1:1972 ESTABLISHED 6180

tasklist /FI "PID eq 26652"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ ===========
============
AcqKnowledge.exe 26652 Console 1 213,836 K

tasklist /FI "PID eq 10956"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ ===========
============
buffer.exe 10956 Console 1 4,768 K

tasklist /FI "PID eq 6180"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ ===========
============
MATLAB.exe 6180 Console 1 2,978,264 KPS
C:\Windows\System32>

Any help would be appreciated thank you!



More information about the fieldtrip mailing list