Another Head Digitizer Port Problem

Hi Everyone,

I am new to the Brainstorm community. I recently acquired a fasttrack for EEG digitizing. It is connected via the serial port and the included PiMgr does find the tracker. I changed the Brainstorm tracker settings to COM2 (the correct COM for my computer) and I do not get any error messages. Also, when I execute s = instrfind(), everything seems to look correct. However, nothing seems to happen when i come to digitize using BrainStorm. Brainstorm does not record any coordinates when i click collect point or press the button on the tracker.

I am using 64-bit Matlab R2015a and Brainstorm 20-Jul-2015.

Thanks for any advice.

Best,
Jason

Hi Jason,
It is hard to tell from your description what could be causing the problem. Can you please do the following:
Start Brainstorm
Start Digitize
in the Matlab command window, create the global variable
>>global Digitize
then print the SerialConnection info
>> Digitize.SerialConnection
you should have something like this:
Serial Port Object : Serial-COM6

Communication Settings
Port: COM6
BaudRate: 9600
Terminator: β€˜LF’

Communication State
Status: open
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 1

then write to the serial port to collect a point
>>fprintf(Digitize.SerialConnection,’%s’,β€˜P’); (you should have one point listed in the Coordinates list)

then review the SerialConnnection info again:
>> Digitize.SerialConnection
and you should have something like this:
Serial Port Object : Serial-COM6

Communication Settings
Port: COM6
BaudRate: 9600
Terminator: β€˜LF’

Communication State
Status: open
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 94
ValuesSent: 2

Please post these two output of Digitize.SerialConnection, like I have here. It may give me a better idea about what is going on.
Beth

Hi Beth,

Thanks for the reply. Here is the request information:

>> global Digitize
>> Digitize.SerialConnection

Serial Port Object : Serial-COM2

Communication Settings
Port: COM2
BaudRate: 9600
Terminator: β€˜LF’

Communication State
Status: open
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 1

>> fprintf(Digitize.SerialConnection,’%s’,β€˜P’)
>> Digitize.SerialConnection

Serial Port Object : Serial-COM2

Communication Settings
Port: COM2
BaudRate: 9600
Terminator: β€˜LF’

Communication State
Status: open
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 2

Thanks again for the help

Best,
Jason

[QUOTE=ebock;9035]Hi Jason,
It is hard to tell from your description what could be causing the problem. Can you please do the following:
Start Brainstorm
Start Digitize
in the Matlab command window, create the global variable
>>global Digitize
then print the SerialConnection info
>> Digitize.SerialConnection
you should have something like this:
Serial Port Object : Serial-COM6

Communication Settings
Port: COM6
BaudRate: 9600
Terminator: β€˜LF’

Communication State
Status: open
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 1

then write to the serial port to collect a point
>>fprintf(Digitize.SerialConnection,’%s’,β€˜P’); (you should have one point listed in the Coordinates list)

then review the SerialConnnection info again:
>> Digitize.SerialConnection
and you should have something like this:
Serial Port Object : Serial-COM6

Communication Settings
Port: COM6
BaudRate: 9600
Terminator: β€˜LF’

Communication State
Status: open
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 94
ValuesSent: 2

Please post these two output of Digitize.SerialConnection, like I have here. It may give me a better idea about what is going on.
Beth[/QUOTE]

Hi Jason,
It looks like your device is not receiving values. According to the info you attached, the request is being sent (ValuesSent = 2), but the ValuesReceived =0, indicating that the device is not sending values back. Do you have a serial-to-serial setup or serial-to-USB? Be sure your device is setup correctly for serial communication, either way.
Another thing to try is to open serial communication outside Matlab using Putty. You can download it freely and run it. See attached for setup


Be sure to change your COM port and speed to match your settings. You can then interact with the terminal to send a request and see what you are getting for a response outside of Matlab.

Beth

1 Like

Hi Beth,

Thanks again for the advice. I am using a direct serial-to-serial connection, with the supplied cable. I have also tried another cable with the same results.

I tried using putty and I get:
2 EERROR ERROR EC -99PS 0FL 0ST 0

The strange thing is that it works completely fine with the supplied Polhemus software, using the serial connection.

Best,
Jason

Hi Jason,
I would contact the company for help with this. It seems the serial connection is not working, or is not setup correctly. It could be that the Polhemus software sets some parameters at startup that are not being setup when using putty or matlab - it may be a matter of modifying the default setup. I think a technician from there could help you decipher the error and guide you a bit to interact with the device using putty, to start.

Beth

Hi Beth,
Could you find any solution to this issue? We are experiencing identical issue here. I have apprised Polhemus of the issue and tech there has asked for version no. of Fastrak, that should be 1.1.8 and can be obtained by typing β€œS” on the command prompt of Putty.
Manvendra

I have version 2.0.3, but I don’t know how much the version matters. When you type β€œP” into the terminal of Putty, what do you see? Can you please try this and post what is in the terminal? You should see two rows, one starting with 01 then six numbers, then one starting with 02 then six numbers.

Version 2.0.3? By version I meant Fastrak firmware version, that should be 1.1.8(this is the latest) and can be obtained by typing β€œS” on the command prompt of Putty. The line β€œ2 EERROR ERROR EC -99PS 0FL 0ST 0” as per tech support at Polhemus is the error you get if you use a lower case p. The command should be an upper case P.
Also, you write that β€œone starting with 01 then six numbers”. Do you have only only 1 Fastrak receiver(sensor/stylus) connected, while testing? There should be as many lines with six nos. as there are sensors, 1 line for each sensor.
I do not have immediate access to Fastrak. It is at a Lab about 1500 km away.
Are you having same problem with your Fatsrak in Matlab and Putty as Jason below?

When I type β€œS” I have version 2.0.3.
When I type capital P, I get two lines (one for each receiver).
If you do not have two receivers, then you cannot use the Brainstorm program to collect points. You need to setup your Fastrak exactly as is explained in the tutorial: http://neuroimage.usc.edu/brainstorm/Tutorials/TutDigitize
Are you having problems collecting points with Brainstorm?

We are thinking of Brainstorm but we have tried Matlab tool PolGui https://www.nitrc.org/projects/polgui/ and Putty and there are the problems. It has to be used in Neuroscan software 3DSpacsDX 4.5.1 for now. That too has been tried, unsuccessfully. After that, we thought of Brainstorm.
So, you get 3 lines on typing β€œP” in Putty, 2 lines for each sensors readings and third line β€œ2 EERROR ERROR EC -99PS 0FL 0ST 0”. Correct? Or your Fastrak is working fine and it is Jason’s Fastrak that is giving third line β€œ2 EERROR ERROR EC -99PS 0FL 0ST 0”? If that is the case, Jason could report back with screenshots on what happens when he types β€œS” and also β€œP” in Putty.

The Brainstorm app is working great at our site and many other sites. Jason is having an error that seems to be specific to his site and I have not heard back from him since that last exchange. Are you having a specific issue? Can I help you with a specific problem?

Yes, issue is exactly the same as faced by Jason below. Fastrak is working fine in it’s GUI program, PI Manager, that comes with it, but not in Matlab. In Putty, error message returned is β€œ2 EERROR ERROR EC -99PS 0FL 0ST 0” And you are right that "It could be that the Polhemus software sets some parameters at startup that are not being setup when using putty or matlab - it may be a matter of modifying the default setup."
I am interacting with Polhemus technical support for resolution.
In fact I am aware about 3 Labs that have Fastrak for Electrode position digitization and 2 Labs are facing the same issue. Both these labs have one thing on common that they have 7-8 year old PCs. one Lab still has Windows Xp Sp3 while other has upgraded to Windows 7 from Windows Xp Sp3. Fastrak works fine in PI Manger in both but not in Matlab or Putty.
At third Lab, Fastrak is working perfectly in Matlab, Brainstorm, Putty, 3DSpaceDx 4.5.1 software of Neuroscan and PI Manager.
One point that comes to mind is that 2 Labs where Fastrak is not working properly in Matlab and Putty, and therefore other softwares, but in PI Manger it works, is that these old PCs do not have updated serial chip drivers/firmware that these softwares use and perhaps PI Manger uses low levels serial communication, and therefore is able to work. For example, may be, Matlab, Putty or new versions of softwares like Brainstorm, 3DSpaceDX use VISA instrument drivers and latest VISA.NET Shared Components, that are not available on old PCs.
If Jason, who is facing the similar issue, also has an old PC where he has installed Brainstorm, that may confirm the above hypothesis further. Then may be, by upgrading to a newer PC would solve the problem.

I have similar issue, but in my case, the matlab shows different message to me.

Do you have any suggestion for this problem?
(I used Patriot with serial port connection)

global Digitize
Digitize.SerialConnection

Serial Port Object : Serial-COM2

Communication Settings
Port: COM2
BaudRate: 115200
Terminator: 'CR'

Communication State
Status: open
RecordStatus: off

Read/Write State
TransferStatus: idle
BytesAvailable: 0
ValuesReceived: 0
ValuesSent: 8

fprintf(Digitize.SerialConnection,'%s','P')

fprintf(Digitize.SerialConnection,'%s','P')
Warning: A timeout occurred before the Terminator was
reached.
Error reading data point. Try again.
If the problem persits, reset the serial connnection.
PAP
Warning: A timeout occurred before the Terminator was
reached.
In instrcb at 48

Hi,
One thing I notice is that the error is about the Terminator and your terminator is CR instead of LF like the other posts above. Not sure if it's relevant, but maybe see if this can be changed in settings somewhere.
Cheers,
Marc

Hi Marc. Thank you for your answer.
I will try to change the terminator to LF, then check if it works.

Thank you again!!

Jaejin

        SerialConnection.terminator = 'CR'; is for patriot system, and LF for fastrak