LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Communication using FT2232HL in LabView : Read Error

Solved!
Go to solution

Hi,

 

I am using FT2232HL to communicate with an I2C device.

 

I am using the MPSSE I2C API calls.

 

I am able to successfully Write to the device. Both my GPIO Read and Device Read does not work.

 

I am able to observe the scope timing, and the Read Data is correct. it is just that when I call the function in LabView, it always shows up as FF. Same for GPIO Read as well.

 

I am using LabView 2013.

 

Thanks for the helps.

 

0 Kudos
Message 1 of 11
(4,141 Views)

Can you provide more information about the issue you are having, like the configurarion on VISA.

 There ir a forum that explains a simular issue and it can be related with the VIS configuration:

 

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Reading-IMU-via-RS-485-Output-Missing-Packet...

 

 

0 Kudos
Message 2 of 11
(4,093 Views)

Thank you for the response.

 

I was able to investigate a bit further.

Now, I do not see the "FF" read error. But something more strange.

 

I have a successful Write to slave and a Read from Slave if the register does not contain "0x00__".

 

Included the screenshots of 2 different scenarios:

1. Register read when the data is not 0x00_ _ .

2. Register read when the data is 0x00_ _.

The third screen shot is the Read_Device driver API VI. everything seems to be working except reading the default data of "0x000098"

 

Thanks for the help.

0 Kudos
Message 3 of 11
(4,080 Views)

can someone please comment on the above issue reported?

 

Thanks

0 Kudos
Message 4 of 11
(4,030 Views)

Your Call Library Node needs to pass the data as Pointer to an Array of U8. When you configure it as a C String Pointer, LabVIEW will on return terminate the string on the first 0 byte it encounters in the string. This is because C strings are by definition terminated by a 0 byte. If you want to pass a binary buffer to a DLL that can return NULL bytes in it, you need to pass that buffer as Byte Array!

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 5 of 11
(4,019 Views)

Hi Rolf,

Thanks for the response.

 

Is this a change required in the DLL file itself. 

Because I am not able to connect anything other than String to that node.

It shows a source and sink mismatch error. The input to the Buffer node is String.

 

Is there anything I can do to alleviate this problem?

 

Thanks

Ashwin

 

0 Kudos
Message 6 of 11
(4,009 Views)
Solution
Accepted by topic author Ash.Bad

You need to change the data type inside the Call Library Node configuration for the uint8 *buffer parameter. It is now configured as C String Pointer but you need to configure it as Array of Unsigned 8 Bit Integer, passed as Array Data Pointer.

 

Then you can also throw away the Byte Array to String and String to Byte Array nodes.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 7 of 11
(4,003 Views)

Hi Rolf,

 

Thank you for your inputs. I was not aware that I could configure the datatype on the call library node.

 

I works great now. I appreciate your help on this.

 

Regards

Ashwin

0 Kudos
Message 8 of 11
(3,992 Views)

Hi,

PLS send me your code to ilanmazuz4@gmail.com

thank you.

Ilan Mazuz

0 Kudos
Message 9 of 11
(3,116 Views)

@Ash.Bad wrote:

Thank you for the response.

 

I was able to investigate a bit further.

Now, I do not see the "FF" read error. But something more strange.

 


Hello,

 

Can you please explain how did you get rid of the "FF" while reading from slave? I am facing a similar issue with FT232H device and the MPSSE I2C library.

 

Thank you in advance.

0 Kudos
Message 10 of 11
(83 Views)