How do I get a waveform in Matlab with the IVI-COM driver?


How do I get a waveform in Matlab with the IVI-COM driver?


Here is some sample Matlab code. Note the IVI-COM driver and Shared components must already be installed.:

%To establish communication with the oscilloscope, you create a MATLAB COM
%object that represents an instance of the driver.
h = actxserver('TekScope.TekScope.1');
%Next, you need to initialize the driver.
hscope = get(h,'IviScope');
%Read the identification information by first getting the Identity interface and thenreading the properties of this interfaces.
hid = get(hscope,'Identity');
ms = get(hscope,'Measurements');
ms1 = get(ms,'Item',get(ms,'Name',1));
A = get(hscope,'Acquisition');
recordLength = get(A,'RecordLength');
data = zeros(recordLength,1);
disp('Fetching waveform');
timeout = 1000; % In milliseconds
data = zeros(recordLength,1);
initX = 0;
Xinc = 0;
[status,data,initX,Xinc] = invoke(ms1,'ReadWaveform', timeout, data, initX, Xinc);
t = initX:Xinc:initX+(Xinc*(recordLength-1));

FAQ ID : 52576

View all FAQs »

Télécharger des manuels, des fiches techniques, des logiciels, etc. :

Go to top