Configure I2C Controller Board Communication
You must have either a Total Phase®
Aardvark™ or an NI™ USB-845x installed to use the aardvark
or
ni845x
interface.
Configure Total Phase Aardvark
To use the I2C interface with the Aardvark controller board in MATLAB®, you must download the Instrument Control Toolbox™ Support Package for Total Phase Aardvark I2C/SPI™ Interface to obtain the necessary files. You must also download the USB device drivers from the Total Phase website.
If you do not have the Aardvark driver or USB device drivers installed, see Install Instrument Control Toolbox Support Package for Total Phase Aardvark I2C/SPI Interface.
The aardvark.dll file that comes with the Total Phase Aardvark controller board must be in one of the following locations for use on Windows® platforms.
Location where MATLAB was started from (
bin
folder)Current MATLAB folder (
pwd
)Windows folder (
C:\Windows
)Folders listed in the
PATH
environment variable
Ensure that the Aardvark controller board is installed properly by scanning for boards physically connected to your computer.
list = aardvarklist
list = 1×2 table Model SerialNumber ______________________ ____________ 1 "Total Phase Aardvark" "2239143731"
Connect to the Aardvark controller board in
MATLAB by creating an aardvark
object using the aardvark
function.
controller = aardvark(list.SerialNumber(1))
controller = Aardvark with properties: Model: "Total Phase Aardvark" SerialNumber: "2239143731" AvailableDigitalPins: ["Pin1" "Pin3" "Pin5" "Pin7" "Pin8" "Pin9"] Show all properties, functions
You can see the model name and serial number of the Aardvark. For a full list of properties, click Show all
properties
in the object output display. For information about each of
these properties, see Properties.
Configure and communicate with the digital I/O pins on the controller board using the following functions.
To connect to an I2C peripheral device connected to the Aardvark, you must use the device
function.
Configure NI USB-845x
To use the I2C interface with the NI USB-845x controller board, you must download the Instrument Control Toolbox Support Package for National Instruments™ NI-845x I2C/SPI Interface to obtain the latest driver, if you do not already have the driver installed. If you already have the latest driver installed, you do not need to download this support package.
If you do not have the NI USB-845x driver installed, see Install Instrument Control Toolbox Support Package for National Instruments NI-845x I2C/SPI Interface.
Ensure that the NI USB-845x controller board is installed properly by scanning for boards physically connected to your computer.
list = ni845xlist
list = 1×2 table Model SerialNumber _____________ ____________ 1 "NI USB-8452" "01F26E0A"
Connect to the NI USB-845x controller board in MATLAB by creating an ni845x
object using the ni845x
function.
controller = ni845x(list.SerialNumber(1))
controller = NI845x with properties: Model: "NI USB-8452" SerialNumber: "01F26E0A" AvailableDigitalPins: ["P0.0" "P0.1" "P0.2" "P0.3" "P0.4" "P0.5" "P0.6" "P0.7"] Show all properties, functions
You can see the model name and serial number of the NI USB-845x. For a full list of properties, click Show all
properties
in the object output display. For information about each of
these properties, see Properties.
Configure and communicate with the digital I/O pins on the controller board using the following functions.
To connect to an I2C peripheral device connected to the NI USB-845x, you must use the device
function.