tne-lab / crossing-detector

Plugin to detect when signals rise or fall across thresholds, for the Open Ephys GUI.
GNU General Public License v3.0
2 stars 15 forks source link

Reading output in matlab? #5

Closed pplenck closed 3 years ago

pplenck commented 3 years ago

HI can you give us a link to some matlab (even python) code that reads the broadcasted events? I am stuck between jeromq, tcp ip sockets etc... thx if you can

ethanbb commented 3 years ago

Hi @pplenck,

Sorry, I've never done what you're trying to do and I don't think there's a super easy way, but here's what I can say:

pplenck commented 3 years ago

Mark Shatza helped me on this, this is in python (yeah, I gave up on matlab, I couldn't compile the jar file)

let me add the part of the code that's important, first eventbroadcaster is in the SUB-PUB protocol so socket = context.socket(zmq.SUB) socket.connect("tcp://127.0.0.1:5558")

here is the key:

socket.setsockopt(zmq.SUBSCRIBE, b'ttl')
socket.setsockopt(zmq.SUBSCRIBE, b'spike')

voilà! thanks Mark