LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using VISA to read data from a FTDI device (FT2232) via its VCP

Hi,

 

I'm trying to access my FTDI device FT2232's virtual COM port (COM3 in my PC) via VISA method. However, I can read nothing from it (Bytes at Port always 0).

Get 0 from FTDI.png

 

Cross verified with other serial terminal such as PUTTY or HTerm, same baud rate and data/stop/parity setting, they can get the FTDI serial COM data correctly.

Normally get data from other serial terimal.png

 

I also tried to access other serial device using my VI program, data can be normally gathered, which device use CH340T as USB-to-serial solution. Looks like this problem is bonded to FTDI chip.

Any idea I should look into? Thanks in advance.

 

 

Regards,

Tyler

0 Kudos
Message 1 of 17
(1,728 Views)

And what do you expect us to do with a fuzzy post stamp sized picture of your LabVIEW program?

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 17
(1,719 Views)

Updated.

0 Kudos
Message 3 of 17
(1,712 Views)

What sort of device is this? Most devices don't spew out data just like that but require something first that tells them what to do. So usually you send a command and then the device responds. Alternatingly there are some devices that love to chat without being triggered to do so, but even those usually need at least one of the handshake signals to be asserted to indicate to them that there is actually someone listening.

 

What I suppose is happening is that you either send a command in hterm and simply forgot to do that in your LabVIEW program or you serial port configuration in your terminal program has been set to do some handshake signaling and you don't do that in your LabVIEW program. The Serial Port Init has default parameters to set the serial port to use no flow control. Since you don't wire the according terminal, this is how the port is configured.

 

If your device is a chatty device, you may have to try RTS/CTS or DTR/DSR handshaking, but the default may not be enough, depending how crazy the device firmware developer was.

 

And the VISA Open is not needed. The VISA session is opened implicitly at the first VISA Node that operates on a VISA Resource name and after that the session stays open until you close your LabVIEW program or explicitly close the session with VISA Close.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 17
(1,701 Views)

Hi Rolf,

 

Thanks for your quick response.

The serial device is developed by myself, an FPGA in charge of sending out decoded data to FT2232 (just like an endless streaming), no flow control mechanical has been added, only TXD/RXD connected to it. I can get the streaming data from any serial terminal with only baud rate setting (no extra operation required).

 

FPGA mapping.png

 

 

0 Kudos
Message 5 of 17
(1,658 Views)

Hello,

 

for me sometimes it worked, when the DTR and RTS lines are set right.

See attached image:

 

VISA Settings DTR & RTS.png

 

Normally for a first test the "Simple Serial.vi" from the "Find Examples" dialog (in Help menu) should show some results. If not, insert a property node after VISA init and alter the lines states.

 

 

Greets, Dave
0 Kudos
Message 6 of 17
(1,649 Views)

You should watch this video: VIWeek 2020/Proper way to communicate over serial

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 17
(1,634 Views)

Why is your baud rate such a crazy number?  Looks like you need to set up other parameters to correctly receive the serial data in LV.  If HTerm is working correctly, then the parameters are incorrect in LV.

0 Kudos
Message 8 of 17
(1,604 Views)

Get rid of the VISA Open inside of your loop.  First of all, you should not be constantly trying to open something every iteration of a loop.  Secondly, that could be clearing out your settings that you put in before the loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 17
(1,567 Views)

I simplified my program and make it stop when error occurred. Now we can see first batch of data has been received but "VISA Read" popped an overrun error immediately after that. Any idea about this issue?

Overrun Error.png

0 Kudos
Message 10 of 17
(1,551 Views)