[FieldTrip] Linking fieldtrip to simulink

Farzaneh Ahmadi Farzaneh.Ahmadi at westernsydney.edu.au
Wed Nov 11 21:24:26 CET 2015


Dear Fieldtrippers

Greetings from Sydney!

I am new to field trip so please pardon my question if being basic.

I have been trying to hook up field trip buffer directly to Simulink but
so far I 
had no luck. 

So question 1. Has anyone successfully used the buffer with Simulink (TCP
send/receive blocks)? I mean to run the buffer as a standalone executable
and use Simulink TCP (Send/receive) blocks to directly connect to the
buffer.

If the answer to Q1 is no, then here is the details of the problem I have
and wish to have your input.

I have MATLAB 2014b and have Instrument control Toolbox-2 on Simulink
(with the usual TCP/Send/Receive blocks). When the buffer is running as an
standalone executable, Simulink can detect the connection but can not
receive any streamed data. I suspect it is either a data format problem or
a header problem.

In my test bench I have used the standalone implementations of the buffer
located here
/fieldtrip-20151020/realtime/bin/ARCH (my ARCH is maci)
Then I used a sine wave generator (sin2ft) from the same folder.

I fed the sine wave from sin2ft to TCP port 1972 on the buffer. Then I use
Simulink to read
the data from the same port on the buffer. The output from the sin2ft is a
float32 so I set the data type of my TCP receive block in simulink (The
block is called Query instrument) to float32. The sample rate and block
size match, but I get no data streams.

I have worked around this by using the python implementations of
fieldtrip.
fieldtrip-20151020/realtime/src/buffer/python

I use the field trip read python command to read the data from the buffer,
discard the header and push the data myself as a float32 using sockets in
python to a second TPC port. This way Simulink can receive the data I
recive from the buffer and resend myslef in python to the second tcp port.
I use the same block set above).

Any ideas?

Cheers
Fary Ahmadi
Researcher from MARCS institute
Western Sydney uni




>





More information about the fieldtrip mailing list