The IIO System Object is based on the MATLAB System Objects™ specification. It is designed to exchange data over Ethernet with an ADI hardware system connected to a FPGA/SoC platform running the ADI Linux distribution.
The IIO System Object is available in both MATLAB and Simulink:
The IIO System Object is built upon the libiio library and enables a MATLAB or Simulink model to:
Below is presented a top level diagram showing the architecture of a system.
For more information about System objects, please refer to the MathWorks documentation on how to do Stream Processing in MATLAB.
The configuration file for a device has the .cfg extension and the name must match the device name set in the block's configuration dialog. It is a text file containing a set of fields that define the Linux drivers for the target device and the configuration channels that will be exposed by the Simulink block or MATLAB script. Entries in the configuration file can be commented by placing # at the begining of a line. The following entries can be found in a configuration file:
Below is presented a configuration file example for the AD9361.
data_in_device = cf-ad9361-dds-core-lpc data_out_device = cf-ad9361-lpc ctrl_device = ad9361-phy channel = RX_LO_FREQ,IN,out_altvoltage0_RX_LO_frequency, channel = RX_SAMPLING_FREQ,IN,in_voltage_sampling_frequency, channel = RX_RF_BANDWIDTH,IN,in_voltage_rf_bandwidth, channel = RX1_GAIN_MODE,IN,in_voltage0_gain_control_mode, channel = RX1_GAIN,IN,in_voltage0_hardwaregain, channel = RX1_RSSI,OUT,in_voltage0_rssi, channel = RX2_GAIN_MODE,IN,in_voltage1_gain_control_mode, channel = RX2_GAIN,IN,in_voltage1_hardwaregain, channel = RX2_RSSI,OUT,in_voltage1_rssi, channel = TX_LO_FREQ,IN,out_altvoltage1_TX_LO_frequency, channel = TX_SAMPLING_FREQ,IN,out_voltage_sampling_frequency, channel = TX_RF_BANDWIDTH,IN,out_voltage_rf_bandwidth,
The input and output ports of the Simulink block corresponding to an IIO System Object are defined through the properties dialog of the object's block as well as through a configuration file that is specific to the targeted ADI device. The input and output ports are categorized as data and control ports. The data ports are used to receive/transmit buffers of continuous data from/to the target system in a frame based processing mode, while the control ports are used to configure and monitor different target system parameters. The number and size of the data ports are configured from the block's configuration dialog while the control ports are defined in the configuration file.
Below is presented an example of how an IIO System Object Simulink block looks like for the AD9361 device and what options can be configured from the block's properties dialog.
The block's properties dialog contains the following parameters:
In order to use the IIO System Object, your MATLAB license needs to include the following component:
If you would like to use it in Simulink, your MATLAB license needs to include the following component:
Besides, you need to have two things ready on your PC:
Before using the IIO System Object, the libiio library must be installed in the system. The installer for Windows can be found here:
Windows libiio installer:
Libiio source code:
The IIO System object source code and example models can be found here:
The example models need to have either the source code of the IIO system object copied to the folder where the model resides or to have the path to the IIO System Object source code added to the MATLAB path.
In order to establish the connection between the host PC and the target, there are several steps you need to follow on both sides.
Starting with MATLAB R2018b, ADI is transitioning to a new system object infrastructure based on collaboration with MathWorks Inc. When installing the latest board support package, it also induces documentation.