04-08-2009 01:59 PM
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?
04-09-2009 01:09 AM
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
04-09-2009 02:24 AM
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.
04-09-2009 02:36 AM
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.
04-09-2009 03:29 AM - edited 04-09-2009 03:31 AM
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...
04-09-2009 05:30 AM
Hi BlueTwo,
Thanks alot.
Yes, Read Byte Array is working great.
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
05-18-2010 03:24 AM
05-18-2010 03:30 AM
05-18-2010 05:25 AM
06-17-2010 12:57 PM
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.