Netstation function without simulink or Datafeed Toolbox

Hi All,
     I am trying to set up a system to record EEG data, where EEG signal acquisition will be done in Mac OSX system, while stimulus presentation would be done via Psychtoolbox in Ubuntu 16.04 LTS. Since the make of EEG is EGI system, psychtoolbox has a function 'Netstation' which essentially helps to send event pulse from stimulus presentation computer to EEG acquisition computer via ethernet.
   So when I connect the two systems (EEG acquisition and stimulus presentation) and run my experiment from stimulus presentation computer (Ubuntu), the connection is established, but soon freezes. The error I get:


To use 'status', at least one of the following products must be both licensed and installed:
  Datafeed Toolbox
  Simulink


I do not have simulink or Datafeed Toolbox. Is there any way that I can use Netstation without either of them?

Thanks

-Sonia
  


The code doesn't use either of those toolboxes. "status" is just a variable containing an integer number. So something's not right.

You need to provide an example code with what you're trying to do.

Justin Ales

On Wed, Dec 7, 2016 at 9:46 AM, 4426lbxlsr2ubmguyzchzmz2dxlcsdycqcf5jprn@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

Hi All,
I am trying to set up a system to record EEG data, where EEG signal acquisition will be done in Mac OSX system, while stimulus presentation would be done via Psychtoolbox in Ubuntu 16.04 LTS. Since the make of EEG is EGI system, psychtoolbox has a function 'Netstation' which essentially helps to send event pulse from stimulus presentation computer to EEG acquisition computer via ethernet.
So when I connect the two systems (EEG acquisition and stimulus presentation) and run my experiment from stimulus presentation computer (Ubuntu), the connection is established, but soon freezes. The error I get:


To use 'status', at least one of the following products must be both licensed and installed:
Datafeed Toolbox
Simulink


I do not have simulink or Datafeed Toolbox. Is there any way that I can use Netstation without either of them?

Thanks

-Sonia



Hi
Here is the snippet of the code I am trying to run:

%%% NetStation...
[status, error] = NetStation('Connect','172.16.224.177',55513)

% %%%% Synchronizing NetStation with the stimulus presentation computer.
NetStation('Synchronize');

%%% starts recording
NetStation('StartRecording');

Until this point there is no problem and a connection is established between the two computers as Netstation starts recording and status output = 0

But when I try to send events so that they can be tagged to Netstation with the following code, it somehow does not tag the events, although recording is still active:

  NetStation('Event','NewT');
   
  NetStation('Event','TrialNum',numTrials);

Best
Sonia
If the m startrecording commands work then at least you have a connection. However the synch command may not have worked. Did you get any worrying messages from matlab?

Your syntax for creating events is a bit off. Your second command puts numtrials where it should have the timestamp to place the event. Also you can only have 4 characters.

I don't know what you're going to use these events for. But be aware that accurate timing of event markers with respect to stimuli is very difficult for many reasons including the tcp/ip protocol has random latency (e.g. Many displays can introduce a lag greater than 30 ms). You should always verify timings using an external device that goes into the EEG.



The following is example code for various ways to send events. If these don't appear to work check the netstation log to see what is actually being received by the egi system.


thisTime=GetSecs(); %could use Screen('flip') times too
WaitSecs(.25);
NetStation('event','LAST')
NetStation('event','FIRS',thisTime); %This one should come 0.25 seconds BEFORE "LAST" in the event list even though it's called 2nd in the code
WaitSecs(.25)
NetStation('event','TEST',GetSecs(), .1) %with duration of 100 millisecond
WaitSecs(.25)
NetStation('event','TEST',GetSecs(), .2,'tria',1) %200 millisecond long event with key "tria" and value 1



On Tue, Dec 13, 2016 at 4:13 PM sbaloni@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


















































Hi
Here is the snippet of the code I am trying to run:

%%% NetStation...
[status, error] = NetStation('Connect','172.16.224.177',55513)

% %%%% Synchronizing NetStation with the stimulus presentation computer.
NetStation('Synchronize');

%%% starts recording
NetStation('StartRecording');

Until

this point there is no problem and a connection is established between

the two computers as Netstation starts recording and status output = 0

But

when I try to send events so that they can be tagged to Netstation with

the following code, it somehow does not tag the events, although

recording is still active:

NetStation('Event','NewT');

NetStation('Event','TrialNum',numTrials);

Best
Sonia









































Thanks a lot for your suggestion, and sorry for the reply, I did try your codes it does connect to NS but still I cannot tag events to NS as it gives the same error:

To use ‘status’, at least one of the following products must be both licensed and installed:
Datareef Toolbox
Simulink

Error in  NetStation (line 280)
error=nserr(status);


On 14-Dec-2016, at 03:36, Justin Ales jma23@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


If the m startrecording commands work then at least you have a connection. However the synch command may not have worked. Did you get any worrying messages from matlab?

Your syntax for creating events is a bit off. Your second command puts numtrials where it should have the timestamp to place the event. Also you can only have 4 characters. 

I don't know what you're going to use these events for. But be aware that accurate timing of event markers with respect to stimuli is very difficult for many reasons including the tcp/ip protocol has random latency (e.g. Many displays can introduce a lag greater than 30 ms). You should always verify timings using an external device that goes into the EEG. 



The following is example code for various ways to send events.  If these don't appear to work check the netstation log to see what is actually being received by the egi system. 


thisTime=GetSecs(); %could use Screen('flip') times too
WaitSecs(.25);
NetStation('event','LAST')
NetStation('event','FIRS',thisTime); %This one should come 0.25 seconds BEFORE "LAST" in the event list even though it's called 2nd in the code
WaitSecs(.25)
NetStation('event','TEST',GetSecs(), .1) %with duration of 100 millisecond 
WaitSecs(.25)
NetStation('event','TEST',GetSecs(), .2,'tria',1) %200 millisecond long event with key "tria" and value 1



On Tue, Dec 13, 2016 at 4:13 PM sbaloni@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:






























 



















Hi
Here is the snippet of the code I am trying to run:

%%% NetStation...
[status, error] = NetStation('Connect','172.16.224.177',55513)

% %%%% Synchronizing NetStation with the stimulus presentation computer.
NetStation('Synchronize');

%%% starts recording
NetStation('StartRecording');

Until

this point there is no problem and a connection is established between 

the two computers as Netstation starts recording and status output = 0

But

when I try to send events so that they can be tagged to Netstation with

the following code, it somehow does not tag the events, although 

recording is still active:

  NetStation('Event','NewT');
    
  NetStation('Event','TrialNum',numTrials);

Best
Sonia











































What version of psychtoolbox are you using? That snippet of a message implies an older version. NetStation.m has been updated to fix various bugs.

I would suggest updating psychtoolbox to the current version and trying again. Which may or may not fix the problem you're encountering.

If it doesn't work please post the exact code you're trying to run along with the full output you're getting.

Justin


On Wed, Dec 21, 2016 at 8:02 AM, 'Dr. Sonia Baloni' sbaloni@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

Thanks a lot for your suggestion, and sorry for the reply, I did try your codes it does connect to NS but still I cannot tag events to NS as it gives the same error:


To use ‘status’, at least one of the following products must be both licensed and installed:
Datareef Toolbox
Simulink

Error in NetStation (line 280)
error=nserr(status);


On 14-Dec-2016, at 03:36, Justin Ales jma23@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


If the m startrecording commands work then at least you have a connection. However the synch command may not have worked. Did you get any worrying messages from matlab?

Your syntax for creating events is a bit off. Your second command puts numtrials where it should have the timestamp to place the event. Also you can only have 4 characters.

I don't know what you're going to use these events for. But be aware that accurate timing of event markers with respect to stimuli is very difficult for many reasons including the tcp/ip protocol has random latency (e.g. Many displays can introduce a lag greater than 30 ms). You should always verify timings using an external device that goes into the EEG.



The following is example code for various ways to send events. If these don't appear to work check the netstation log to see what is actually being received by the egi system.


thisTime=GetSecs(); %could use Screen('flip') times too
WaitSecs(.25);
NetStation('event','LAST')
NetStation('event','FIRS', thisTime); %This one should come 0.25 seconds BEFORE "LAST" in the event list even though it's called 2nd in the code
WaitSecs(.25)
NetStation('event','TEST', GetSecs(), .1) %with duration of 100 millisecond
WaitSecs(.25)
NetStation('event','TEST', GetSecs(), .2,'tria',1) %200 millisecond long event with key "tria" and value 1



On Tue, Dec 13, 2016 at 4:13 PM sbaloni@... [ PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


















































Hi
Here is the snippet of the code I am trying to run:

%%% NetStation...
[status, error] = NetStation('Connect','172.16. 224.177',55513)

% %%%% Synchronizing NetStation with the stimulus presentation computer.
NetStation('Synchronize');

%%% starts recording
NetStation('StartRecording');

Until

this point there is no problem and a connection is established between

the two computers as Netstation starts recording and status output = 0

But

when I try to send events so that they can be tagged to Netstation with

the following code, it somehow does not tag the events, although

recording is still active:

NetStation('Event','NewT');

NetStation('Event','TrialNum', numTrials);

Best
Sonia












































Oh Ok. Thanks a lot for the update.

Best
Sonia
On 25-Dec-2016, at 10:05, mario.kleiner@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:

Unfortunately the PTB in NeuroDebian is currently outdated, 3 releases and 8 months behind. The standard DownloadPsychtoolbox() function would get the current release.

Alternatively, get the current NetStation.m from here and retry:

https://raw.githubusercontent.com/Psychtoolbox-3/Psychtoolbox-3/beta/Psychtoolbox/PsychHardware/NetStation.m

best,
-mario