How do I interface with Oscilloscopes using IVI in MATLAB R2022b?

7 views (last 30 days)
I'm trying to connect MATLAB to a Rigol DS1054Z oscilloscope using the Instrument Control Toolbox, but I can't figure out how to get MATLAB to recognize the device. I've downloaded the IVI-C driver from Rigol, but I still can't get it to work.
 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 26 Oct 2022
How to find your installed IVI-C drivers in MATLAB
Whether you received your IVI-C drivers from the manufacturer or through one of the search methods mentioned on the "IVI Instrument Drivers and MATLAB" page, you can find installed drivers and instrument resources on your computer by calling the "instrsupport" command at the MATLAB Command Window.
In the "VISA" section, you should see your connected devices in the following format:
Connecting using the constructor: visa('ni', 'USB0::0x1AB1::0x04CE::<SERIALNUMBER>::INSTR');
VISA-USB Object Using NI Adaptor : VISA-USB-0-0x1AB1-0x04CE-<SERIALNUMBER>-0
Communication Address
ManufacturerID: 0x1AB1
ModelCode: 0x04CE
SerialNumber: <SERIALNUMBER>
Take note of the resource name from the second argument in the listed "visa" function. In this case, it is:
USB0::0x1AB1::0x04CE::<SERIALNUMBER>::INSTR
In the "MODULES" section, you should see a cell array of all the installed drivers. The driver for this would be named:
rgds1kz
Note: Make sure that you have the most up-to-date NI-VISA software installed on your computer. This can be done by uninstalling any current NI-VISA software and downloading the "Instrument Control Toolbox Support Package for National Instruments VISA and ICP Interfaces" using the MATLAB Add-On Explorer. Restarting your computer may be necessary.
 
Connecting to your device
The simplest interface to use would be the “Quick-Control Oscilloscope” object which would use the vendor-provided “rgdg1kz” IVI-C driver:
Note that in order to use the installed “rgdg1kz” IVI-C driver, you need to set the "Resource" and “Driver” properties of the object accordingly before calling the “connect” function:
myScope = oscilloscope;
myScope.Resource = 'USB0::0x1AB1::0x04CE::<SERIALNUMBER>::INSTR';
myScope.Driver = 'rgdg1kz';
Please refer to the following documentation page for a usage example that uses the "Oscilloscope" object:
Below is an example application that uses the "Oscilloscope" object that you may be interested in:
 
Another approach would be to use the “ividev” function using the “IVIScope” object class, which would provide more functionality and also uses the “rgdg1kz” IVI-C driver. Please refer to the following documentation page for more information:
 

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!