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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 30
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 25
Using MATLAB's Interface for External Libraries
1MA171_5e Rohde & Schwarz How to use Rohde & Schwarz Instruments in MATLAB
®
26
3.9 Application Example using the 64-bit rsspecan
Instrument Driver
Please refer to section 1.2 for software prerequisites before executing the following
M
ATLAB source code.
Due to a not supported calling convention of MATLAB, the following workaround has to
be installed to successfully load the 64-bit VXIplug&play instrument driver library.
Please create a file workaround_rsspecan.h for the rsspecan 64-bit application
example with the following content:
#undef _LDSUPPORT
#define __fastcall
#include "rsspecan.h"
The file has to be copied to the VXIplug&play include directory. This is typically stored
in following environment variable: VXIPNPPATH64 (e.g. c:\Program Files\IVI
Foundation\VISA\Win64\Include).
%% 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 VXIPNPPATH64 environment variable on your system
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 64-bit R&S instrument driver
vxipnpLib = 'rsspecan_64';
vxinpnLibDll = 'rsspecan_64.dll';
vxipnpHeader = 'workaround_rsspecan.h';
if ~libisloaded (vxipnpLib)
[notfound,warnings]=loadlibrary(vxinpnLibDll, vxipnpHeader, ...
'includepath', p1, ...
'includepath', p2, ...
'addheader', 'rsspecan.h');
end
%You can use these functions to get information on the functions available in a
library that you have loaded:
%libfunctions(vxipnpLib, '-full');
%libfunctionsview(vxipnpLib);
%% open VISA session
instr_session = -1;
instr_resource = 'TCPIP::FSV-123123::INSTR';
instr_presource = libpointer( 'int8Ptr', [int8( instr_resource ) 0] );
instr_idQuery = 1;
instr_reset = 1;
%% set up connection
err = 0;
[err, p8, instr_session] = calllib(vxipnpLib, 'rsspecan_init', instr_presource,
instr_idQuery, instr_reset, instr_session );
Przeglądanie stron 25
1 2 ... 21 22 23 24 25 26 27 28 29 30

Komentarze do niniejszej Instrukcji

Brak uwag