MATLAB INSTRUMENT CONTROL TOOLBOX - RELEASE NOTES Instrukcja Użytkownika Strona 27

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 30
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 26
Using MATLAB's Interface for External Libraries
1MA171_5e Rohde & Schwarz How to use Rohde & Schwarz Instruments in MATLAB
®
27
if ( err )
error ('Connection to instrument failed')
end
while (true)
%% simple settings
% set instrument to single sweep
instr_window = 1;
instr_sweepModeCont = 0;
instr_numOfSweeps = 1;
[err] = calllib(vxipnpLib, 'rsspecan_ConfigureAcquisition', instr_session,
instr_window, instr_sweepModeCont, instr_numOfSweeps);
if ( err )
b
reak
end
%
configure sweep points
instr_window = 1;
i
nstr_sweepPoints = 501;
[err] = calllib(vxipnpLib, 'rsspecan_ConfigureSweepPoints', instr_session,
instr_window, instr_sweepPoints);
i
f ( err )
break
end
% configure RF parameters
instr_freqCenter = 1.1e9;
instr_freqSpan = 1e6;
[err] = calllib(vxipnpLib, 'rsspecan_ConfigureFrequencyCenterSpan',
instr_session, instr_window, instr_freqCenter, instr_freqSpan);
if ( err )
break
end
%% read trace
instr_trace = 1;
instr_timeoutMs = 15000;
instr_arrayLen = instr_sweepPoints;
instr_arrayActualLen = -1;
instr_amplitude = zeros(instr_arrayLen,1);
[err, instr_arrayActualLen, instr_amplitude] = calllib(vxipnpLib,
'rsspecan_ReadYTrace', instr_session, instr_window, instr_trace,
instr_timeoutMs, instr_arrayLen, instr_arrayActualLen, instr_amplitude);
if ( err )
break
end
%do something
plot(instr_amplitude)
%% cleanup
[err] = calllib(vxipnpLib, 'rsspecan_close', instr_session);
if ( err )
break
end
%exit loop
break
end
%% evaluate error
if ( err )
errCode = err;
errLen = 1024;
errMsg = zeros(errLen,1);
disp( '*** Error occured' );
Przeglądanie stron 26
1 2 ... 22 23 24 25 26 27 28 29 30

Komentarze do niniejszej Instrukcji

Brak uwag