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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 30
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 22
Using MATLAB's Interface for External Libraries
1MA171_5e Rohde & Schwarz How to use Rohde & Schwarz Instruments in MATLAB
®
23
% switch rf on
instr_rf = 1;
[err] = calllib(vxipnpLib, 'rssmu_SetOutputState', instr_session,
instr_path, instr_rf);
if ( err )
break
end
% cleanup
[err] = calllib(vxipnpLib, 'rssmu_close', instr_session);
if ( err )
break
end
b
reak
e
nd
%% evaluate error
i
f ( err )
errCode = err;
e
rrLen = 1024;
errMsg = zeros(errLen,1);
disp( '*** Error occured' );
% In the case that a session got created we evaluate the error further
if ( instr_session ~= 0 )
[errCode, errMsg] = calllib( vxipnpLib, 'rssmu_error_message',
instr_session, errCode, errMsg );
errString = sprintf('%s', char(errMsg));
disp( errString );
errMsg = '';
[DummyErr, errCode, errMsg] = calllib( vxipnpLib, 'rssmu_error_query',
instr_session, errCode, errMsg );
errString = sprintf('%s', char(errMsg));
disp( errString );
% ... and we must make sure to disconnect from the device !
calllib( vxipnpLib, 'rssmu_close', instr_session );
end
end
%% clean up
unloadlibrary(vxipnpLib);
clear all
3.8 Application Example using the 32-bit rsspecan
Instrument Driver
%% Rohde & Schwarz GmbH & Co. KG
% MATLAB calllib example for R&S Specturm Analyzer Instrument Driver
% (RsSpecAn)
% Purpose: Test of loadlibrary/calllib for rsspecan VXIplug&play instrument
% driver doing simple read trace measurement.
% Author: Juergen Engelbrecht, customersupport@rohde-schwarz.com
%% add library path
% check VXIPNPPATH environment variable on your system
addpath 'c:\Program Files\IVI Foundation\VISA\WinNT\Include';
addpath 'c:\Program Files\IVI Foundation\VISA\WinNT\Bin';
Przeglądanie stron 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 29 30

Komentarze do niniejszej Instrukcji

Brak uwag