MATLAB >> matlab polhemus fastrak communication

by James » Sat, 06 Jun 2009 01:19:01 GMT

I am trying to collect data from the polhemus fastrak using three sensors via Matlab, and am having difficulty doing so. We have just purchases a brand new fastrak. Here is the code we are using so far. We think there is an issue with what we have so far, but we don't know how to fix it. Does anyone have any suggestions on this?

This is the first portion of the code where we try to address the issue:

s = serial('COM1','Baud Rate', 115200);
record = fscanf(s, '%d %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g' );
fastrak = 1;
disp('Warning: Cannot open Fastrack, data NOT being recorded!')
fastrak = 0;

and here is the second/last part of the code related to the fastrak:

if fastrak
record=fscanf(s, '%d %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g' );
loggedSensors(ctr,:) = record(:)';

Similar Threads

1. Problem with serial communication in MATLAB : Connection established but no communication


I am trying to communicate with EK3LV02DQ, an evaluation kit with a 3-axis accelerometer in it. I prefer to communicate in MATLAB. A USB A/B cable acts as a link between the device and my computer. I am using a Virtual COM driver to simulate the USB as a COM (COM3). I am able to send instructions perfectly using Hyperterminal, but I cannot do the same in matlab. In fact, I could observe using tmtool utility that MATLAB has established connection with the COM3 port but the instructions that I send are not received by the device. Here is the code that I have used,

am=serial('COM3','BaudRate',11500);  %Creating the serial port object
fopen(am);  %Opening the port
fprintf(am,'*Zoff');   %Sending command
clear am;  

The instruction *Zoff should just make two LEDs in the device to glow. It works if I send it in hyperterminal but no luck for me in MATLAB. I am new to serial communication in MATLAB. Any help please [:)]

2. I have problems with USB interface in Polhemus Patriot - MATLAB

3. Simulink(matlab)/FPGA serial port communication


I have developed a Decoder in verilog and successfully simulated it on
an FPGA. I am using Actel's ProASIC3E proto kit. Simulink has an
instrument control toolbox which allows one to read and write to the
fpga. I plan to have the encoder, modulation and demodulation blocks
in simulink and want to send the demodulated data to the fpga through
serial and recieve the output. How can I do this? My design is
synchronous takes 2 bits which get decoded into 1bit. Also, what's the
output voltage/current on the pc serial port? If the connect on the
pins directly into one of fpga's input pins on the board.. would I fry
it? (I don't have a serial port on the fpga proto board). Is this even

Thanks for the help,

4. Simulink(Matlab)/FPGA serial communication

5. Noise scaling in MATLAB communication system modelling

6. labview - matlab communication

7. Help needed for Contemporaray Communication Systems using Matlab

Has anybody got the solutions of the problems of Contemporary Communication Systems using Matlab by John G Proakis and Masoud Salehi. 
I urgently need help in some of the problems.

Please let me know if u can help me 


8. TCP communication of 2 computers running Matlab - MATLAB