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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 30
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 21
Using MATLAB's Interface for External Libraries
1MA171_5e Rohde & Schwarz How to use Rohde & Schwarz Instruments in MATLAB
®
22
% check VXIPNPPATH64 environment variable on your system
% for the correct path to the installation directory
p1= 'c:\Program Files\IVI Foundation\VISA\Win64\Include';
p2= 'c:\Program Files\IVI Foundation\VISA\Win64\Bin';
addpath(p1);
addpath(p2);
%% load library of R&S driver
vxipnpLib = 'rssmu_64';
vxinpnLibDll = 'rssmu_64.dll';
vxipnpHeader = 'workaround_rssmu.h';
if ~libisloaded (vxipnpLib)
[notfound,warnings]=loadlibrary(vxinpnLibDll, vxipnpHeader, ...
'includepath', p1, ...
'
includepath', p2, ...
'addheader', 'rssmu.h');
e
nd
%You can use these functions to get information on the functions available in a
l
ibrary that you have loaded:
%libfunctions(vxipnpLib, '-full');
%libfunctionsview(vxipnpLib);
%% open VISA session
instr_session = -1;
instr_resource = 'TCPIP::rssmu200a123123::INSTR';
instr_presource = libpointer( 'int8Ptr', [int8( instr_resource ) 0] );
instr_idQuery = 1;
instr_reset = 1;
[err, p8, instr_session] = calllib(vxipnpLib, 'rssmu_init', instr_presource,
instr_idQuery, instr_reset, instr_session );
if ( err )
error ('Connection to instrument failed')
end
while (true)
%% simple settings
% switch rf off
instr_rf = 0;
[err] = calllib(vxipnpLib, 'rssmu_SetAllRFOutputsState', instr_session,
instr_rf);
if ( err )
break
end
% switch 3GPP on
instr_path = 1;
instr_3gppState = 1;
[err] = calllib(vxipnpLib, 'rssmu_SetW3GPPFDDState', instr_session,
instr_path, instr_3gppState);
if ( err )
break
end
% set total power to 0dB
[err] = calllib(vxipnpLib, 'rssmu_W3GPPAdjustTotalPowerto0dB',
instr_session, instr_path);
if ( err )
break
end
% read power back
instr_power = -1;
[err, instr_power] = calllib(vxipnpLib, 'rssmu_GetW3GPPTotalPower',
instr_session, instr_path, instr_power);
if ( err )
break
end
Przeglądanie stron 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Komentarze do niniejszej Instrukcji

Brak uwag