01-30-2023 01:28 AM - edited 01-30-2023 01:47 AM
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).
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.
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.
01-30-2023 01:43 AM
And what do you expect us to do with a fuzzy post stamp sized picture of your LabVIEW program?
01-30-2023 01:48 AM
01-30-2023 02:04 AM - edited 01-30-2023 02:07 AM
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.
01-30-2023 04:31 AM
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).
01-30-2023 04:59 AM
for me sometimes it worked, when the DTR and RTS lines are set right.
See attached image:
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.
01-30-2023 09:15 AM
You should watch this video: VIWeek 2020/Proper way to communicate over serial
01-30-2023 02:24 PM - edited 01-30-2023 02:27 PM
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.
01-31-2023 06:52 AM
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.
01-31-2023 08:16 PM
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?