From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview with FTDI D2XX drivers?

Hi Ritesh,

 

If the 'Bytes Read' is saying 1600, i would suspect it has read 1600 bytes, and that the anomoly is with the way you are looking at it?

 

Have you tried your VI with smaller quantities of data? a few bytes?

 

Can you configure your device to return known data to you? That way you can determine if it is the first or last byte you are seeing. 

 

Have you used the 'Array Size' VI to determine the size of the returned array? (connected to the  'read data terminal?)

 

Does that match the figure given by the 'read bytes' terminal? 

0 Kudos
Message 11 of 84
(8,231 Views)

Hi BlueTwo,

I tried with lower values too and got the same result. i.e the Bytes Read would be exactly equal to Bytes to Read, but the size of O/P string is always = 1.

I am attaching the pic of my program with the probe values  of "Bytes Read" and the array size of the O/P String. Bytes Read = 1600 and Array size = 1.

 

The value of 1st byte that my H/W sends is always "128" and the string O/P of 1 array size value is also "128". So, its always reading the 1st Byte and not the Last byte.

 

 

Ritesh 

0 Kudos
Message 12 of 84
(8,219 Views)

Hi Ritesh,

 

First thought is: Can you use 'FT Read Byte Data' VI instead of 'FT read String Data' VI. Strings often require more post processing to get the data out... The  'FT Read Byte Data' VI will give you an array of data you can start working with directly.

 

I have not used the  'FT read String Data' VI much, but your problem may an incompatibility between required formats of the 'FT read String Data' VI  and the 'String to Byte Array' function. Try connecting a 'String Indicator' Function to the 'FT read String Data' VI output directly. What appears in the string indicator? 

 

If the string appears correctly in the string indicator then your problem is how to process the string to get the data you need out. 

Message 13 of 84
(8,206 Views)

Hi BlueTwo,

there is no "ReadByteData" function in ft2dxx.dll. From where can i get that VI??

 

and the string O/P also shows only 1 character. and its length = 1. so, the O/P string itself doesn't contain the proper data. and its not the issue with converting the O/P string to byte data. 

0 Kudos
Message 14 of 84
(8,203 Views)

Hi Ritesh,

 

That is strange, the 'FT Read Byte Data' VI is part of the code used in Example 1 on the website below:

 

http://www.ftdichip.com/Projects/CodeExamples/LabVIEW.htm

 

It is also part of the D2XX function archive download on the same page.

 

I would try that instead of the 'FT Read String Data' VI.

 

Good luck!

 

Blue 

 

 

 

edited to correct typo... 

Message Edited by BlueTwo on 04-09-2009 03:31 AM
Message 15 of 84
(8,196 Views)

Hi BlueTwo,

Thanks alot.

Yes, Read Byte Array is working great.  :smileyhappy:

 

I just ran through the PDF for the description of the DLL functions and found FT Win 32 API Functions really interesting. I feel they would make things simpler for me in my project. But have no idea of how to use them.

Just curious to know if you have ever played around with those functions anytime .

 

 

Thanks alot again!

 

Ritesh 

0 Kudos
Message 16 of 84
(8,186 Views)
Hello I'm using FT245R to send data from an FPGA to PC. I'm using labview to read data.Particularly I'm using the function Write-Read Byte Array Demo.vi (with a modification to read large amount of data). From PC i send a command with the number of data I want to read (this data are all 0, it is an example just to try)I have this problem: If I want read data bytes < 63488 i have no problem (i can read the buffer with only one reading cycle). If I need to read data > 63488 (more then one reading cycle) I have some data lost.I attach the labview function I use.
From PC I send 16 bytes of comand in wich I indicate the number of 0x00 i want to read (for example I indicate I want to read 65536 bytes 0x00). Then I wait for read: in the case of 65536 byte , in the first reading cycle I read 63488 bytes (max buffer size), in the second i should read 65536-63488, instead some data are lost (the amount of data lost is variable).
I Hope you can hel me.
0 Kudos
Message 17 of 84
(7,394 Views)
If you know the amount of data that you will be getting, Then initialize an array in the shift register. Fill the array with the data you get from each call (use a while loop).
0 Kudos
Message 18 of 84
(7,389 Views)
Nice that you started a new thread here. But stick to one thread
0 Kudos
Message 19 of 84
(7,355 Views)

Does anyone have an example where you can open the serial port by passing the COM port number?  All i have seen is FT_GET_DEVICE_DESCRIPTION_By_INDEX where you pass an index. In my setup, my FTDI cable enumerated on COM7.  But i have to pass 0 as the device index and get TTL232R-3V3 as the output.

 

 

I would like to be able to specify a COM port, because i will have multiple FTDI cables.

0 Kudos
Message 20 of 84
(7,178 Views)