Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
qzhou

Junior Member
Registered:
Posts: 4
Reply with quote  #1 
Hi all,

I'm having a problem with the timing. I'm hooking up a ML computer with a Plexon Single-Unit Recording terminal through a single-line BNC cable. Link topology as follows:

ML --> TTL --> DIO_0_0 -> USER_1(BNC) -> DB26 terminal -> DB26 Socket -> OmniPlex Thingy

I have toggled TTL signal in the timing script as follows:


TTL=2;
toggleobject(TTL);toggleobject(TTL); // On-Off
toggleobject(TTL);toggleobject(TTL);
toggleobject(TTL);toggleobject(TTL);
toggleobject(TTL);toggleobject(TTL);


On the Plexon side, due to the nature of ttl signals, I should have observed 4 markers in less than 1ms. On the contrary, I found 4 markers, spread randomly in around 20ms, sometimes the first one wouldn't even be there. 

Did I missed something? Any advice would be appreciated.


Quan
0
Wael.Asaad

Administrator
Registered:
Posts: 51
Reply with quote  #2 
The toggleobject function has a fair amount of overhead (though I would have thought it should nevertheless take significantly less than 20 ms - perhaps more around 8-10 ms based upon earlier testing).  For that reason, you might consider assigning the TTL to a digital output and using the "eventmarker" command to toggle that output.  That function has been tested to require ~0.5 ms on our systems from a couple of years ago, whereas toggleobject can take ~2 ms just to enter the function, not including the time needed to clean up and exit that function.

Also make sure when you run MATLAB / MonkeyLogic the computer is streamlined to disable as many background processes as possible.  What kind of cycle rates do you typically see on your system during a real task?  If you're not seeing > 1000 cycles / sec, then the hardware / OS may need optimization.
0
qzhou

Junior Member
Registered:
Posts: 4
Reply with quote  #3 
Thank you!
0
Edward

Administrator
Registered:
Posts: 245
Reply with quote  #4 
When you say spread around randomly, do you mean that those markers did not appear one after the other on the plexon side? 

I know that plexon requires a handshaking signal to be sent before the marker is sent. Are you doing this?
0
qzhou

Junior Member
Registered:
Posts: 4
Reply with quote  #5 
Quote:
Originally Posted by ryklin
When you say spread around randomly, do you mean that those markers did not appear one after the other on the plexon side? 

I know that plexon requires a handshaking signal to be sent before the marker is sent. Are you doing this?


Highly Likely! I'll check on that. Thank you!
0
Edward

Administrator
Registered:
Posts: 245
Reply with quote  #6 
in the plexon documentation it's referred to as a strobe pulse and it immediately precedes any event markers or other signals to be sent. 
0
Andy Mitz

Junior Member
Registered:
Posts: 8
Reply with quote  #7 
I don't see how eventmarker() can work.   Does the eventmarker bit pattern remain on the digital lines until the event codes changes?  Thus:
eventmarker(0);   % all bits off
....
eventmarker(4);    % bit 2 on
   tic and toc here
eventmarker(0);    % bit 2 off
.....


This is a bit annoying if you are also using eventmarker() for saving/sending event codes, but given enough digital lines, it should not really matter.








0
Edward

Administrator
Registered:
Posts: 245
Reply with quote  #8 
How would you prefer to do this?

Something like this perhaps:

eventSignal = 1001 0000 0001 0101
eventmarker(eventSignal);
tic/toc
eventmarker(0);
eventSignal = 0000 0111 1111 1101
eventmarker(eventSignal);
tic/toc
eventmarker(0);

Note: there is a minimum tic/toc that must transpire for Plexon (et al) to detect the two unique signals.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.