Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Polhemmus Fastrak with RS232 (by VISA serial port), LabVIEW8.5

Hi everyone,

I was trying to use LabVEW8.5 to connect with Polhemus Fastrak with 4 sensors,and encountered a problem with "buffer"..

I have tried to use NI-VISA to read buffer from the machine and it's been done. But the string was really terribly stuck up with each other and encounterd  data loss.

 fastrak.JPG

 I had read about the related discussions here and another form about labview discussion, buyt I still didn't know how to fix it..Could somebody help or give me a hint?..Many Thanks..

 

Here is my vi

fastrak_visa.JPG

0 Kudos
Message 1 of 4
(5,867 Views)

Sorry I'd attached the wrong VI,

here is the VI..

 

Could somebody please tell the problem is resourced from data processing or rs232-VISA serial ?

fastrak2.PNG

0 Kudos
Message 2 of 4
(5,858 Views)

You may have a problem because of the way that you have written the code. There is absolutley no reason to initialize the serial port with each iteration of the while loop. Move that and VISA Close to outside the loop.

 

You have set the VISA Configure Serial Port to terminate the read on a termination character. You are then using VISA Bytes at Serial Port to determine how many bytes to read. You do NOT need to read how many bytes are available or a fixed wait if the instrument is sending a termination character and a single line of data. If however, the instrument sends multiple lines with each response, you want to disable the term character and use thenumber of bytes and keep reading until the number of available bytes is 0.

 

p.s. The use of the local 'Sig Acquire' is just silly.

0 Kudos
Message 3 of 4
(5,853 Views)

Hi Dennis, thank you for your opinions. I'll re-write the vi again based on you advice.

 

Why I used 'signal aquire' is because there're several event structure and in this one I tried to use it to trigger 2 different resouce VIs (one from NI-DAQ device, another from rs232). I thought about it for several days and that's the simple one so far that came into my mind . so...

 

Btw the problem with 'string' had been solved by other friends, they found the string length of each  data is 7.

After reconsidering of this idea, we had the string subset and solved.

 

Thank you again Dennis.

 

0 Kudos
Message 4 of 4
(5,841 Views)