[NetStation] Problem with sending proper Time of Event to NetStation

Dear all, 

I'm writing codes using the NetStationPC.m, which is a customized version of NetStation.m, to send record EEG data with Event labels. My code is shown below:


DAC_IP = '10.10.10.42';

NetStationPC('Connect', DAC_IP);

NetStationPC('Synchronize');

NetStationPC('StartRecording');

    pause(1);

for J = 1:10

    s = GetSecs();

    NetStationPC('Event','stm+', s, 0.001, 'obs#', J);

    pause(1);

end;

NetStationPC('Synchronize');

NetStationPC('StopRecording');

NetStationPC('Disconnect', DAC_IP);


Here is my results: (0) the NetStation Acquisition software turned pink, meaning it started to record, which is good; but (1) while my code ran in the lines of NetStationPC('Event', ...), the data acquisition GUI was frozen. I found the EEG data was recorded, though, by checking the output .mff file; and (2) I noticed in NetStation Tool software that my events have "stm+" in their "Code" field and "obs# == 1, 2, ..., 10" in their "Key Code" field, which is good, but (3) those events cannot be used to generate segments, because their starttime are labeled large negative values, e.g., Starttime == -04:09:17.647, duration == 00:00:00.001.


My guess is that this failure was due to wrong specification of starttime, and as a side-effect the NetStation Acquisition froze during data event-labeling.


Does anyone have working sample code? Or, is there anything wrong in the code of "NetStationPC.m" that is known? Or, a raw guess of the potential causes of these is also appreciated. Thanks!!!


PS: I got all "Z"-responses for my "D"-(event)-commands, which means the commands were properly received and parsed by NetStation. This is another reason why I guess the problem is primarily the time.


I just tried your new code. The interface of NetStation is not frozen any more, but there are no events recorded. It printed the message of synchronization time larger than 2.5 ms, but my Matlab is busy forever after that.
What I do for the older code of psychtoolbox->hardware->NetStation is that when I use it in my program, I add a large constant to the GetSecs() as input to NetStation('Event', ...). Bang! This time the negative values are all positive and there is no frozen NetStation interface too.
I guess this is probably because EGI changed the way NetStation parses the sync time sent from PC running Psychtoolbox?
However, I don't think my way of getting positive timestamps is the answer to this problem.
Could you give more info:

Netstation version, OSX version for netstation computer, OS on stimulus computer, OS version on stimulus computer.
Also post the TCP/IP logs from the netstation.

Justin

On Thu, Oct 23, 2014 at 6:55 PM, andyroddick1989@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

I just tried your new code. The interface of NetStation is not frozen any more, but there are no events recorded. It printed the message of synchronization time larger than 2.5 ms, but my Matlab is busy forever after that.

What I do for the older code of psychtoolbox->hardware->NetStation is that when I use it in my program, I add a large constant to the GetSecs() as input to NetStation('Event', ...). Bang! This time the negative values are all positive and there is no frozen NetStation interface too.
I guess this is probably because EGI changed the way NetStation parses the sync time sent from PC running Psychtoolbox?
However, I don't think my way of getting positive timestamps is the answer to this problem.