05-25-2023 04:12 AM
i need USB to RS232 communication LabView VI USB to RS232 communication please Help me for this in my board have one USB HUB this hub had upstreem and 4 downstrem in 2 downstreem converted to RS232( FT232R) I need vi like i should send the data from usb host(upstreem) and am reciving data from one usb and 2 usb to RS232 Converted data i need vi like this please help me for this
05-25-2023 08:29 AM
You need a RS-232 USB converter, once you plug it on USB, the computer will see that as a COM Port. You use that to send/receive commands. With NI-Visa Interactive control you should be able to setup Serial settings and send/receive commands to verify the operation. On labview you will use Visa functions for that.
05-25-2023 08:54 AM
You just need the proper driver for the USB-RS232 adapter and it will show up as a COM port in Windows. From there, just use VISA to write and read. From there, it really just depends on the message protocol of whatever you are trying to talk to.
05-25-2023 09:16 AM - edited 05-25-2023 09:18 AM
A USB to RS232 adaptor that is Windows compatible should either install a virtual Com port for each device as it is detected by Windows or come with its own virtual Com port drivers.
Once the Virtual Com port is installed using a USB to RS232 adaptor with VISA is no different than using an on-board Com port.
No special USB knowledge or raw USB programming considerations are necessary.
05-29-2023 12:53 AM
but this need vi right because i need write data from USB and i need recive data from com
05-29-2023 03:08 AM - edited 05-29-2023 03:11 AM
You’re misunderstanding completely what has been told to you. When you connect an FTDI USB to RS-232 adapter to your USB port Windows will automatically install a Virtual COM port driver that makes the serial port on the other end of the FTDI chip look like a serial port in Windows. You simply use serial COMM functions (Windows API) or NI-VISA (in LabVIEW) to communicate with that port as if it was a built in RS-232 ort in your computer. There is no USB programming involved or needed from your side.
You really do not want to communicate directly on USB level if at all possible. That is tedious, painful and advanced programming.