Hi All,
I have been struggling with this problem for some days now, and cannot get my head round it unfortunately. I would appreciate your help.
I am trying to control an Agilent 33220A through Matlab. I installed the Keysight I/O library, all relevant drivers (version 1.3.5.0) and have connected the device to the computer. The Keysight connection expert detects it at this address:
*USB0::0x0957::0x0407::MY44003690::0::INSTR*
I am trying to adapt the code from this Agilent document to work with USB:
*http://cp.literature.agilent.com/litweb/pdf/5990-3465EN.pdf*
They use the following code to connect the 33220a to Matlab:
*device = icdevice(‘Agilent33220.mdd’,’GPIB0::10::INSTR’);*
*connect(device);*
However, I substituted it with the following code:
*vu = visa('agilent', 'USB0::0x0957::0x0407::MY44003690::0::INSTR')*
*device = icdevice('agilent_33220a.mdd',vu);*
*connect(device);*
This is the error I get when I run the program with the 33220a ON and connected via USB
*Error using icdevice/connect (line 112)*
*The specified configuration: USB0::0x0957::0x0407::MY44003690::0::INSTR is not available.*
*Use INSTRHWINFO for a list of available configurations. Use INSTRFIND to*
*determine if other instrument objects are connected to the requested instrument.*
*If this error is not an instrument error, use MIDEDIT to inspect the driver.*
*Error in signal_generator (line 36)*
*connect(device);*
Could someone shed some light on what I am doing wrong? Thank you in advance for your help,
Orielav
I have been struggling with this problem for some days now, and cannot get my head round it unfortunately. I would appreciate your help.
I am trying to control an Agilent 33220A through Matlab. I installed the Keysight I/O library, all relevant drivers (version 1.3.5.0) and have connected the device to the computer. The Keysight connection expert detects it at this address:
*USB0::0x0957::0x0407::MY44003690::0::INSTR*
I am trying to adapt the code from this Agilent document to work with USB:
*http://cp.literature.agilent.com/litweb/pdf/5990-3465EN.pdf*
They use the following code to connect the 33220a to Matlab:
*device = icdevice(‘Agilent33220.mdd’,’GPIB0::10::INSTR’);*
*connect(device);*
However, I substituted it with the following code:
*vu = visa('agilent', 'USB0::0x0957::0x0407::MY44003690::0::INSTR')*
*device = icdevice('agilent_33220a.mdd',vu);*
*connect(device);*
This is the error I get when I run the program with the 33220a ON and connected via USB
*Error using icdevice/connect (line 112)*
*The specified configuration: USB0::0x0957::0x0407::MY44003690::0::INSTR is not available.*
*Use INSTRHWINFO for a list of available configurations. Use INSTRFIND to*
*determine if other instrument objects are connected to the requested instrument.*
*If this error is not an instrument error, use MIDEDIT to inspect the driver.*
*Error in signal_generator (line 36)*
*connect(device);*
Could someone shed some light on what I am doing wrong? Thank you in advance for your help,
Orielav
% clears all variables, closes all open files
clear all; close all; clc;
%opens and creates a visa session for communication with function generator
fgen = visa('AGILENT','GPIB1::11::INSTR');
set (fgen,'OutputBufferSize',100000);
fopen(fgen);
%Query Idendity string and report
fprintf (fgen, '*IDN?');
idn = fscanf (fgen);
fprintf (idn)
fprintf ('\n\n')
%Clear and reset instrument
fprintf (fgen, '*RST');
fprintf (fgen, '*CLS');
%Set desired configuration.
fprintf(fgen,'FUNCTION SIN');
fprintf(fgen,'VOLT 2'); % set max waveform amplitude to 2 Vpp
fprintf(fgen,'VOLT:OFFSET 0'); % set offset to 0 V
fprintf(fgen,'OUTPUT:LOAD 50'); % set output load to 50 ohms
fprintf(fgen,'FREQ 2000'); %set frequency to 1KHz
%Enable Output
fprintf(fgen,'OUTPUT ON'); % turn on channel 1 output
% Read Error
fprintf(fgen, 'SYST:ERR?');
errorstr = fscanf (fgen);
% error checking
if strncmp (errorstr, '+0,"No error"',13)
errorcheck = 'Waveform generated without any error \n';
fprintf (errorcheck)
else
errorcheck = ['Error reported: ', errorstr];
fprintf (errorcheck)
end
%closes the visa session with the function generator
fclose(fgen);