visade, not able to use instrument driver

5 views (last 30 days)
Maurizio
Maurizio on 24 Nov 2022
Answered: Pravarthana P on 30 Nov 2022
moving to visadev, and old code no longer working and can't find anything useful on line to sovle this.
my simple code:
VisaObj = visadev("TCPIP0::VEN-L000015::inst0::INSTR");
if isempty(VisaObj)
interfaceObj = tcpclient('127.0.0.1', 1861);
else
clear VisaObj;
interfaceObj = VisaObj(1);
end
deviceObj = icdevice('lecroy_basic_12bit_driver.mdd', VisaObj);
% Connect device object to hardware.
connect(deviceObj);
% Execute device object function(s).
groupObj = get(deviceObj, 'Util');
invoke(groupObj, 'sendcommand', "*IDN?");
val = invoke(groupObj, 'readresponse',"%s");
disp(val);
the bold line gives the error:
Error using icdevice
HWOBJ must be an interface object.
previous code still working but is deprecated:
interfaceObj = instrfind('Type', 'tcpip', 'RemoteHost', '127.0.0.1', 'RemotePort', 1861, 'Tag', '');
if isempty(interfaceObj)
interfaceObj = tcpip('127.0.0.1', 1861);
else
fclose(interfaceObj);
interfaceObj = interfaceObj(1);
end
deviceObj = icdevice('lecroy_basic_driver.mdd', interfaceObj);
any suggestion is wellcome

Answers (1)

Pravarthana P
Pravarthana P on 30 Nov 2022
Hi Maurizio Mastrofini,
The ‘visadev object with icdevice is not currently supported in MATLAB R2022a.
There are two possible workarounds to resolve this:
  1. Can continue using ‘visaobjects with icdevice in R2022a. Support for icdevice with ‘visadevis planned for a future release.
  2. If your instrument model has an IVI-C driver, you can use the new ividev interface instead of icdevice.
a. If a supported ividev MATLAB driver exists for the instrument’s IVI-C driver you can use ividev.
Refer to the following documentation page to check whether a supported MATLAB driver exists and for usage examples: https://www.mathworks.com/help/instrument/supported-ivi-drivers.html
b. If supported ividev MATLAB driver does not exist for the instrument’s IVI-C driver, you can use ividev with the class compliant driver (IviScope, IviFgen etc) and the instrument’s IVI-C driver.
To use option b, the following setup has to be followed:
1. Install NI-VISAand IVI Complicance Package (IVI CP), this can be done simply by installing the "Instrument Control Toolbox Support Package for National Instruments VISA and ICP Interfaces" support package from Add-On Explorer.
2. Install Instrument Control Toolbox Support Package for IVI and VXIplug&play Drivers to get the class compliant “IviDCPwr” MATLAB Driver.
3. Install “hp66xxa” IVI-C driver for the DC Power supply 'HP 6654A'. The “hp66xxa” driver is authored by NI and you can download it from their weblink below -- use the LabWindows/CVI version link inside.
4. Reboot computer
If your instrument model has an IVI-C driver and if you use ividev, follow the below steps:
% Check if IVI-C driver for DC Power Supply is installed
>>ividriverlist
Follow the documentation link for ‘iviconfigurationstore’ steps
Kindly refer to the following links to get more information on "ividev":
Hope this information helps you!

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!