11-30-2021 06:00 AM
Hello LabVIEW Experts,
I am learning Labview Community 2021.
I've found that if I want to connect to some 3rd party sensor devices, I would mostly need peripherals such as I2C, SPI and UART.
So how do I access this peripherals from within Labview Community 2021? 😊
11-30-2021 06:05 AM
First for all of them you need some hardware interface. For UARTs this is usually an RS-232 or RS-422/485 interface. As long as it is recognized by Windows as a serial port, you can use the NI VISA functions in LabVIEW to access it.
For I2C and SPI you always need some form of TTL logic interface. What library you can use to implement either of them depends mainly on what hardware interface you use.
11-30-2021 06:13 AM
I have this click board which is wildly used among PIC fans.
https://www.mikroe.com/usb-uart-click
Is there any Labview driver for this? The chip is FT232RL, a very popular USB to UART interface IC. 🤔
11-30-2021 06:19 AM - edited 11-30-2021 06:40 AM
What shows the device manager in Windows when you plugin this board in your computer?
Most likely you will need to install either the FTDI Virtual Com port driver or the FTDI D2XX Direct Driver.
With the Virtual Com Port driver you can access this board like a serial port in Windows and hence also in LabVIEW through the VISA functions.
With the FTDI D2XX driver you can access its DLL through this library. But the FT232RL does not seem to incorporate the FTDI MPSEE engine, so you can not use the according MPSEE DLLs on top of the D2XX driver that take care of most of the low level bitbang handling for I2C and SPI. Also note that the FTDI driver is in LabVIEW 7.0 format and only is compatible to the 32-bit version of the FTDI DLL. Don't try to use it with 64-bit LabVIEW!!!!!!!
Implementing I2C and SPI on top of the D2XX DLL interface directly would be a major investment in time and effort.
11-30-2021 09:34 AM
@HKPhysicist wrote:
Hello LabVIEW Experts,
I am learning Labview Community 2021.
I've found that if I want to connect to some 3rd party sensor devices, I would mostly need peripherals such as I2C, SPI and UART.
So how do I access this peripherals from within Labview Community 2021? 😊
Most common serial busses have a USB type adaptor that installs a virtual com port. Once you have that installed and the virtual com port is recognized by NI-Max as a VISA resource. Communicating with your peripherals is no different than communicating with any other device on a Com port.
BTW: This abstraction is part of the beauty of VISA.
Here's some USB adaptors for various serial busses
11-30-2021 09:44 AM
Yes, I have installed the NI-VISA package and my usb-uart board is shown as serial com port inside MAX!
Windows 10 has a built-in driver for Future Tech's chip. So everything is straight forward! Labview laptop can be used as data acquisition instrument very easily.😀
11-30-2021 10:00 AM
But please be aware that the FT232R(L) chip variant is a low cost version in comparison to other FT232 versions such as the FT232HM. As such it is pretty much a pure UART without real support for things like I2C or SPI. It could be simulated with bitbang mode but not for reliable high speed communication.
Your FT232RL based board can be used to interface to RS-232, 422 and 485 with according interface circuitry and 3.3V or 5V TTL logic UARTs. Not really more. The FT232HM cables that RTSLVU has provided links for contain the chip version with integrated MPSSE engine that provides integrated support for I2C, SPI and some other digital bus protocols. You do however need to use the FT2Dxx drivers in order to use those modes.
11-30-2021 01:50 PM
Accidentally, I did find something close to your description:
https://www.mikroe.com/click-usb-adapter
It carries a FT2232H dual high speed USB to multi purpose IC. There is also a Windows 10 driver for it! 😀
12-01-2021 01:50 AM
Hi,
I used the FT4232H module a lot. Mostly UART and IO. Also I2C without any problems.
Tried to use it for JTAG without succes. No sure why, have to search dig further into that one.
Recently also use the SPI interface. I found that this works for individual Write/Read actions.
With a SPI device that receives and sends data at the same clock tick it fails. Data send to the SPI device was completely wrong. So I used the same pins as I/O. Got that working but much, much slower.
Kees
12-01-2021 02:03 AM
Did you buy chips from unknown China sellers on Amazin or ebay?
They reuse parts from broken gears and also remark them. 🤔
Mikroe's parts are genuine. Their parts work many years.