Creating an arbitrary waveform in MATLAB and downloading to arbitrary function generator (agilent AG33220A)

StackOverflow https://stackoverflow.com/questions/9856810

  •  26-05-2021
  •  | 
  •  

Question

I am getting the following error: ??? Error using ==> icdevice.connect at 117 GPIB: AGILENT: The specified board is not installed or configured properly. If this error is not an instrument error, use MIDEDIT to inspect the driver.

Please let me know how to make it work. I am following instructions from :

http://cp.literature.agilent.com/litweb/pdf/5990-3465EN.pdf

Thanks.

Code :

clear all; close all;clc
time = 0:0.001:1; % Defi ne time vector to contain whole
%number of cycles of waveform
Amp1 = 0.2; % Amplitude for each component of waveform
Amp2 = 0.8;
Amp3 = 0.6;
frequency1 = 10; % Frequency for each component of waveform
frequency2 = 14;
frequency3 = 18;
wave1 = Amp1*sin(2*pi*frequency1*time); % Waveform component 1
wave2 = Amp2*sin(2*pi*frequency2*time); % Waveform component 2
wave3 = Amp3*sin(2*pi*frequency3*time); % Waveform component 3
wave = wave1 + wave2 + wave3; % Some combination of individual waveforms
wave = wave + 0.3*rand(1,size(wave,2)); % Now add random noise into the signal
wave = (wave./max(wave))'; % Normalize so values are between -1 to + 1
% Visualize the signals
% plot(time,wave1,'m',time,wave2,'k',time,wave3,'r');
% hold on; hw = plot(time,wave,'b'); set(hw,'Linewidth',2.5)
% xlabel('Time (s)'); ylabel('Voltage (V)'); axis tight;
% legend('Component 1','Component 2','Component 3', ...
%     'Combination of components \newline with random noise')

v = gpib('agilent',0,10);

device = icdevice('agilent_33220a.mdd',v);
connect(device)

invoke(device.Arbitrarywaveform,'SetData',wave);
invoke(device.Arbitrarywaveform,'CopyData','MATLABWFM1');
set(device.Arbitrarywaveform,'User','MATLABWFM1');
set(device.Output, 'Function','Agilent33220OutputFunctionUser');
set(device.Output, 'Frequency', 1);
set(device.OutputVoltage, 'Amplitude', 10);
set(device.Output,'State','on')
Was it helpful?

Solution

I was getting a similar error message:

GPIB: AGILENT: The specified board is not installed or configured properly.

My solution was to use the tmtool command.

On the screen which comes up, there is a tree menu on the left-hand side.

I clicked Hardware->GPIB and the middle part of the screen showed an empty list with the headers "Vendor" and "Board Index".

I then clicked the "Scan" button in the bottom-right of the middle part below this empty list.

Matlab thought about life for a long time and then the list was suddenly populated by a number of entries.

The top entry said "Agilent Technologies (agilent)" with a Board Index of 8.

I switched the board index in my code to match this and everything worked.

I think Matlab's discovery of the boards and then having the right index were both necessary.

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top