Support Question of the Week: How Do You Transfer I2C Data using an Aardvark I2C/SPI Host Adapter and LabVIEW?
Today's article is based on a new Knowledge Base article, Sending I2C Messages Between Two Aardvark adapters Using Aardvark LabVIEW
The Aardvark™ I2C/SPI Host Adapter is often used with LabVIEW to transfer I2C data. The Aardvark LabVIEW Driver supports the Windows operating system and includes examples. You can use the Aardvark LabVIEW Driver to control the Aardvark adapter, as well as write a custom program for specific requirements. For information about API Software, which is also used to write custom software, please refer to section 5 of the Aardvark Adapter Use Manual. Following are instructions to install the Aardvark LabVIEW driver and then run two examples that use Aardvark LabVIEW drivers (connect and i2c):
-
- connect example - Indicates if the I2C/SPI/GPIO functions are available, and displays the port number, Aardvark handle, Serial Number, Hardware version, and Firmware version for the connected Aardvark adapters.
- i2c example - Reads and writes I2C data between two Aardvark adapters. In this example, one Aardvark adapter is the I2C master and the other Aardvark adapter is the I2C slave.
Aardvark LabVIEW Driver Installation Guidelines:
- Download and run the latest version of the Total Phase USB Drivers Installer.
- Download and install the latest version of Aardvark LabVIEW Driver following the README file in the driver package.
- Be sure to place the aardvark.dll into a directory that is listed in the system search path. The Windows system32 directory (on 32-bit Windows) is a good location for the aardvark.dll.
- Connect the two Aardvark adapters to the computer via the USB connector.
- Connect the two Aardvark adapters to each other via the I2C/SPI connector.
- Install 32-bit LabVIEW for Windows from the LabVIEW website.
- Be sure to use 32-bit LabVIEW; currently the Aardvark LabVIEW Driver is only provided in a 32-bit package.
- Launch Aardvark LabVIEW Driver by clicking on the icon …/aardvark-labview-v5.03/aardvark/aardvark.llb.
- Run the original connect Aardvark LabVIEW Driver example as provided in the Aardvark LabVIEW Driver package. To do so:
- Go to the Aardvark Example Connect.vi window.
- Click Operate → Run.
- Verify that the computer detects the first Aardvark adapter, and that the Aardvark parameters are correct including: Aardvark Handle, Aardvark Port; Aardvark Serial Number String, Hardware Version String, and Firmware Version String. Refer to Figure 1 below.
Figure 1: Setting up Drivers for the Aardvark Host Adapter
Instructions to send I2C data between two Aardvark adapters with the Aardvark LabVIEW Driver I2C:
- Go to the Aardvark LabVIEW Driver Example I2C.vi window.
- Click Operate → Run.
- Verify that the Aardvark parameters are correct including: Aardvark Handle 1, Aardvark Handle 2, Message received by master, and Message received by slave. Refer to Figure 2 below.
-
Fig 2: Sending I2C Data between Aardvark Host Adapters
Note: similar steps can be used for transferring I2C data between Aardvark adapter and another I2C device.
For more information, please refer to the following documents:
Aardvark Adapter User Manual
Aardvark I2C/SPI Host Adapter Quick Start Guide
LabVIEW Drivers for Aardvark
Sending I2C Messages Between Two Aardvark adapters Using Aardvark LabVIEW
Total Phase Products
Product Selector Guide
We hope this answers your question. If you have other questions about our host adapters or other Total Phase products, feel free to email us at sales@totalphase.com or submit a request for technical support.