Main Content

Transition Your Code to ividev Interface

Discover Installed IVI-C Drivers

FunctionalityUse This Instead
driversInfo = ivinstrhwinfo('ivi');
driversInfo.Modules
list = ividriverlist
list = ividevlist

Use ividriverlist to view a list of installed IVI-C and VXIplug&play drivers installed on your computer and their corresponding MATLAB® drivers. Use ividevlist to view a list of physically connected hardware and their drivers.

Create MATLAB Instrument Driver

FunctionalityUse This Instead
makemid('AgInfiniiVision','AgInfiniiVision.mdd')
You do not need to create the MATLAB instrument driver. These drivers are included with the Instrument Control Toolbox™ Support Package for IVI® and VXIplug&play Drivers.

Connect to Instrument

FunctionalityUse This Instead
dev = icdevice('AgInfiniiVision.mdd','USB0::0x2A8D::0x0386::CN59216227::0::INSTR');
connect(dev);
dev = ividev("AgInfiniiVision","USB0::0x2A8D::0x0386::CN59216227::0::INSTR");
You do not need to call the connect function.
disconnect(dev)
clear dev
clear dev
You do not need to call the disconnect function.

Connect to IVI-C Class-Compliant Instrument

FunctionalityUse This Instead
% myScope is the logical name in the iviconfigurationstore object
dev = instrument.ivic.IviScope();
dev.init('myScope',true,true);
% myScope is the logical name in the iviconfigurationstore object
dev = ividev("IviScope","myScope","IDQuery",true,"ResetDevice",true);

Get Instrument Properties

FunctionalityUse This Instead
get(dev,'Inherentiviattributesdriveridentification')
dev.InherentIVIAttributes.DriverIdentification

You can explore your instrument's properties by using dot notation and tab-complete in the MATLAB Command Window. You can also click on the links from the ividev object output display.

Invoke Instrument Methods

FunctionalityUse This Instead
configuration = dev.Configuration;
invoke(configuration, 'autosetup')
autosetup(dev);

Use Repeated Capabilities

FunctionalityUse This Instead
dev.RepCapIdentifier = 'Channel1';
dev.Channel.Input_Impedance = 50;

dev.RepCapIdentifier = 'Channel2';
dev.Channel.Input_Impedance = 50;
dev.Channel("Channel1").InputImpedance = 50;
dev.Channel("Channel2").InputImpedance = 50;

Read Waveform from Oscilloscope

FunctionalityUse This Instead
recordLength = dev.Acquisition.Horizontal_Record_Length;
waveformArray = zeros(1, recordLength);
[waveformArray,actualPoints,initialX,xIncrement] = dev.WaveformAcquisition.
     ReadWaveform('Channel1', recordLength, 1000, waveformArray);
recordLength = actualRecordLength(dev)
[waveformArray,actualPoints,initialX,xIncrement] = readWaveform(dev,"Channel1",recordLength,1000);

You do not need to pre-allocate an array for the waveform.

See Also

| |