LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize data reception of a USB device (FTDI L2XX based)

Hello,

I'm using a USB datacable with a FDTI chipset.
This datacable can be use for datalogging a turbojet for
radio-controlled models (WrenTurbines).
A program made using Visual Basic is provide (without source code, just binary).
http://www.espiell.com/soft.htm
Before using this program I need to install the FTDI D2XX drivers.
It's the D2XX driver (Direct USB device access through a DLL)...
 not the VCP (Virtual COM Port) driver.
I would like to make a simular program using Labview.
So I went to http://www.ftdichip.com/Projects/CodeExamples.htm to
get sample code.
I also have the communication protocol from the turbojet to computer.
http://www.espiell.com/fadprot.pdf
I have made some Labview VI that can get RPM, LCD String and other
things if I get the 50 bytes of data (as a string for example, and
transforming it as a bytes array...).
I'm using the Write-Read String Demo.vi file (assuming that I just
need to Read a string).
I just set baud rate to 2400 as given in the Xicoy ECU FADEC protocol.
I get the good index for my USB cable, the good device description.
But I have a problem. My data doesn't seems to be synchronised.
I say this because when I have a look at the "Read Buffer Out"
display, the string is scrolling. Moreover the string length is not
always egal to 50 (it's sometimes less than 50).

According to the engineer who developped the Engine Control Unit
(who unfortunatelly doesn't know Labview enough), the problem is
that I shouldn't try to get the whole string (with its 50 bytes) because
it sends data byte after byte (not the whole string).

I guess that I should use the FTDI Sample Code called
Write-Read Byte Array Demo.vi and modify it to get only one byte
(byte after byte).

I see in the protocol http://www.espiell.com/fadprot.pdf
that 2 bytes can be used to synchronized the data.

but I haven't the finest idea how I could solve this problem
and how I could use this 2 bytes to synchronize data
.
I haven't the finest idea of who could help me.

Best Regards

Sebastien CELLES
0 Kudos
Message 1 of 3
(3,516 Views)
Hi,

Sorry for responding that late, do you still have this problem? If you do could you please send your VI so that we could help you.

Regards

Richard Keromen

0 Kudos
Message 2 of 3
(3,492 Views)
Thanks

In fact, I found a way to solve my problem.
I use VCP instead of L2XX and
I read 50 bytes using serial visa.
I test if the 2 bytes are what I'm looking for (252 253)
If that's wonder I read 1 byte in order to shift the string.
I don't know if it's the best way... but it works.
It's sometimes a little bit long (5-10 seconds) to synchronize
but I guess that it 's because of the very low baudrate (2400)

Best regards


Message Edité par scls19fr le 04-04-2008 03:28 PM

Message Edité par scls19fr le 04-04-2008 03:29 PM
0 Kudos
Message 3 of 3
(3,464 Views)