Home

MATLAB Toolkit for R&S® Signal Generators

image

Contents

1. lt object gt Parameters lt object gt lt command gt lt command gt The instrument object returned by rs_connect SCPI command e g FRI EQ 1 2GHz Return value lt status gt 1 if successful Example code gt gt err instrObj gt gt err rs_connect gpib nii Ca Send command instrObj RST 1 13 rs_send_query m The function rs_send_query works similar to rs_send_command with the exception that an answer from the instrument is expected after the command has been sent lt status gt lt answer gt rs_send_query lt object gt lt command gt Parameters 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 13 R amp S Toolkit Functions lt object gt lt command gt Return values lt status gt lt answer gt Example code gt gt err instrObj The instrument object returned by rs_connect SCPI command e g IDN 1 if successful Contains the answer from the instrument rs _connect gpib ni 0 28 gt gt err answer Ca Send query instrObj IDN 1 14 rs_batch_interpret m This function processes a series of SCPI commands or queries from a text file lt status gt lt answer gt Parameters lt object gt lt batch file gt Return values lt status gt lt answer gt Example batch file scpi txt o S Comment line IDN FREQ 1 2 GHz POW 10 0
2. dBm OUTP STAT ON SYST ERR Example code gt gt err answer rs batch interpret lt object gt lt batch file gt The instrument object returned by rs_connect Path and name of the batch file 1 if successful Contains the queries results in a structure answer x text where x is a consecutive number of the queries starting with the index one The highest number is the total number of queries rs_batch_interpret instrObj scpi txt answer 1 text contains the return information from IDN answer 2 text contains the return information from SYST ERR 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 14 R amp S Toolkit Functions 1 15 rs_generate_wave m This function builds a waveform file from an UO vector It also sends the generated file to the instrument s mass memory system and optionally starts the ARB in path A or B lt status gt rs_generate wave lt object gt lt struct gt lt playback gt lt save_local gt Parameters lt object gt The instrument object returned by rs_connect If this number is set to 0 the waveform is only stored locally and not sent to the instrument lt struct gt UO data and waveform parameters lt playback gt 0 ARB is not started after transfer 1 waveform is activated in path A 2 waveform is activated in path B lt save_local gt 0 waveform is not stored on local PC 1 waveform is stored on loc
3. H environment variable is set to the bin win32 sub directory of the MATLAB installation PATH lt matlabroot gt bin win32 PATHS Additionally it must be ensured that all toolkit scripts can be found from MATLAB 1 18 Usage The first step is to place a Matlab_M object into your schematic This object directly runs a MATLAB m script during a simulation Numeric Matlab DI Matlab_M Next a BusMerge5d object is required to combine the input parameters for the R amp S Matlab_M object Numeric Control D BusMerge5 D 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 18 ADS Support Connect the two objects as shown below and edit the Matlab_M properties according to the list below Matlab NM BusMergeS rr Mi e BB MatlabFunction output 1 rs_ Script Directory MatlabSetUp MatlabFunction output l rs ADS IQSink input 1 input 2 input 3 input 4 input 5 GPIBO 28 INSTR D test wv comment copyright Mat labWrapUp The property MatlabFunction defines the call to MATLAB as well as all input and return parameters The placeholder input is used for one of the parameters passed to the BusMerged object In the example above the VISA resource string is set to a device connected to the primary GPIB board and set to address 28 The MATLAB routine creates a waveform file locally and copies it to the specified location under the given name D tes
4. MATLAB Toolkit for R amp S Signal Generators Application Note Products R amp S SMW200A R amp S SMBV100A R amp S SMU200A R amp S AFQ100A R amp S SMJ100A R amp S AFQ100B R amp S SMATE200A R amp S SMA100A R amp S AMU200A R amp S SMB100A R amp S SMC100A This R amp S MATLAB Toolkit provides routines for remote controlling Rohde amp Schwarz Signal Generators from MATLAB scripts Additionally UO data can be turned into Rohde amp Schwarz waveform files for use with the instrument s ARB option This application note describes the installation and use of this R amp S MATLAB Toolkit on Microsoft Widows and Linux based systems Application Note 24 4 2013 T R der C Troster Notices Table of Contents 1 leit A 2 UE A 3 el 4 4 System Requirements cccccccccccccceececeeeeeceeeeeeeeeeeeeeeeeeeeeeees 5 1 2 TT CT 5 1 3 Software siiicar a aa Aa ANENE SEA SA AEE eaa aaia 5 5 Windows XP Installation cccccceeceeeeeeeeeeeeeeeeeeeeeeesneeeeeees 6 1 4 Unpacking The Files 0 cccccceseseeseseeeeeeseeeneeeeeenseeeseeeseeeeseaeeeeseeeeseeseenseeeees 6 1 5 Setting The Path In MATLAB ccccessecceesseeeeeeeeeneeeseeneeeenseeeeeeeneeeeeneseneeeess 6 6 LINUX Installatton ue eeeeeeeeeeeeeeeeeeeeeeeeeeeeseneeeeneeeeees 8 1 6 e UE 8 1 7 Unpacking The Fires 2cccccceccceccesceeccsceceecsentacececeucennecenueequseecetesentecetecsecetneeeete 8 1 8 VISA Inst
5. Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 9 VISA Resource Strings 7 VISA Resource Strings The general format of the USB VISA resource string is USB lt vendor id gt lt product id gt lt serial number gt INSTR The vendor ID for all Rohde amp Schwarz devices is OxOAAD The product ID depends on the instrument and can be taken from the list below The list represents all R amp S Signal Generators that support USB remote control at the time of writing 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 10 R amp S Toolkit Functions 8 R amp S Toolkit Functions The toolkit provides various scripts for basic instrument access The following list summarizes these functions Each function is located ina MATLAB script using the name of the function rs_connect m Create GPIB or VISA object for an instrument or open TCP IP socket connection and verify the link rs_check_instrument_errors m Query the instrument s error queue by repeatedly sending SYST ERR rs_send_query m Send a SCPI command to the instrument and query the result rs_batch_interpret m Process a file containing SCPI commands rs_generate_wave m Generate waveform file from complex vector and transfer to instrument rs_visualize m Visualizes UO data by generating a time domain FFT and UO plane plot The next paragraph explains the syntax and use of these functions 1 10 rs_connect m The functio
6. al PC current directory Return value lt status gt 1 if successful The lt struct gt format _data 1D array of values mandatory O data 1D array of Q values mandatory markerlist one 2D array marker list optional e g Position Value 0 0 10 1 50 0 gt UO 0 10 1 50 0 markerlist two 2D array marker list optional markerlist three 2D array marker list optional markerlist four 2D array marker list optional clock desired clock rate in Hz mandatory path storage path in the remote device mandatory including drive letter e g D Files filename waveform name in the remote device mandatory file extension wv is mandatory comment Comment optional Markers are digital output signals that are generated synchronous to the signal output These signals can be used for synchronization of other devices For more information please see the instrument s user manual 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 15 R amp S Toolkit Functions 1 16 rs_visualize m This function plots the UO values Amplitude Level dB Frequency Hz 10 lt status gt rs_visualize FSample I data Q data_ Parameters lt FSample gt The sample rate in Hz zl data 1D array with values lt Q_data gt 1D array with Q values Return value lt status gt 1 if successful Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 16 Example Scripts 9 Exa
7. al sustainability e ISO 14001 certified environmental management system iSO 9001 Regional contact Europe Africa Middle East 49 89 4129 137 74 customersupport rohde schwarz com North America 1 888 TEST RSA 1 888 837 8772 customer support rsa rohde schwarz com Latin America 1 410 910 7988 customersupport la rohde schwarz com Asia Pacific 65 65 13 04 88 customersupport asia rohde schwarz com This application note and the supplied programs may only be used subject to the conditions of use set forth in the download area of the Rohde amp Schwarz website R amp S is a registered trademark of Rohde A Schwarz GmbH amp Co KG Trade names are trademarks of the owners
8. allatio ME 8 1 9 USB SUP POrt EE 9 T VISA Resource StringS cceeeeeeeeeeseeeeeeeeeeeeeeeeeeeeeeeeeees 10 8 R amp S Toolkit FUNCtions cccccececeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees 11 1 10 KEE IM ETT E 11 1 11 re check Imstrument errore men 13 1 12 CET WR EI BT 13 1 13 Fe send QUCKY Daa REESEN raa aaae eade danara radna aaan Aaa aain 13 1 14 rs batch_interpret M iisipin nana napaan miaa anaa Aaaa 14 1 15 rs generate Waye E 15 1 16 FS vis alizZ E 16 9 Example Scripts E 17 10 ADS SUP POM iais aiana aaga a aetu aa aiaa aaa 18 1 17 l st llatio M i 2 vgeretegu iinan ninda isunenanndetennndaseninsdanlenehssenennacoedevaganuentndceetenneds 18 1 18 SAG e E E E E E E E va E 18 11 Additional Information see EEEEEE EEN e 22 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 2 Notices 1 Notices The following abbreviations are used throughout this application note The R amp S MATLAB Toolkit for R amp S Signal Generators is referred to as MATLAB Toolkit or toolkit The R amp S SMW200A Vector Signal Generator is referred to as SMW The R amp S SMU200A Vector Signal Generator is referred to as SMU The R amp S SMJ100A Vector Signal Generator is referred to as SMJ The R amp S SMATE200A Vector Signal Generator is referred to as SMATE The R amp S SMBV100A Vector Signal Generator is referred to as SMBV The R amp S AFQ100A UO Modulation Generator is referred to as AFQ The R am
9. ectory e g C Program Files MATLAB R2007a toolbox RsMatlabToolkit The contents of the archive should now be unpacked into this directory 1 5 Setting The Path In MATLAB For a convenient use of the toolkit functions it is required to add the installation path of the toolkit scripts to the MATLAB environment This can be done by selecting File Set Path from the menu bar This brings up the Set Path dialog where the new path is added using the Add Folder button Set Path All changes take effect immediately MATLAB search path OADATEN MATLAB Sa C Programme MATLA toolbox RsMatlabT oolkit fan C Programme MATLABIR oolhox JatlabToolkit ADS DB C Programme MATLABiR2007 aitoolbox matlab general Move ta Top D C Programme MATLAB R2007 a toolbox matlab ops B C Programme MATLAB R2007 aitoolbox matlab lang Move Up D C Programme MATLAB R2007 altoolbox matlablelmat B C Programme MATLAB R2007 aitoolbox matlab elfun D C Programme MATLAB R2007 aitoolbox matlab specfun Move to Bottom B C Programme MATLAB R2007 aitoolbox matlab matfun D C Programme MATLAB R2007 au oolbox matlab datafun B CA Programme MATLABiR2007 aitoolbox matlab polyfun Move Down Remove Save Close Figure 1 MATLAB Set Path dialog 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 6 Windows XP Installation Note When using MATLAB 7 0 R14 it is required to remove unused instrument drivers This is a confirm
10. ed problem in MATLAB 7 0 R14 in the way that MATLAB interfaces with GPIB cards To remove the drivers please open the directory toolbox instrument instrumentadaptors win32 in the MATLAB directory create a new directory called backup and move every dll except mwnigpib dll and mwnivisa dll to the backup directory 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 7 Linux Installation 6 Linux Installation Starting with version R2009a MATLAB provides the Instrument Control Toolbox on Linux installation Using these toolbox scripts is recommended for all instrument communication because it allows writing platform independent code and simplifies instrument access greatly 1 6 Prerequisites e Linux distribution with kernel sources and symbols installed e VISA installation package e g from National Instruments 1 7 Unpacking The Files The toolkit comes as a set of files bundled in a ZIP archive Extract all files into a path in your MATLAB toolbox directory md opt matlab2009 toolbox RsMatlabToolkit unzip lt archive zip gt d opt matlab2006 toolbox RsMatlabToolkit After the files are unpacked follow the Step Set the path to the toolkit in MATLAB from the Windows installation procedure 1 8 VISA Installation This brief guide was developed for an Open SuSE 10 2 installation and the National Instruments VISA package Please see the VISA web site www ni com visa for download and d
11. etails about license and installation First prepare your kernel sources as root user cd usr src linux make cloneconfig make prepare Next mount the National Instruments ISO image into a folder mkdir media visa mount t iso9660 o loop ro lt imagefile gt media visa cd media visa Run the National Instruments installer and make sure to add the development option INSTALL 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 8 Linux Installation You should now have a working VISA installation Verify your installation by invoking the Nlvisaic or visaconf tools NiIvisaic visaconft 1 9 USB Support In order to use USB for VISA remote control the current kernel must support usbfs or on older kernels usbdevfs Verify that this file system is mounted by using the mount command mount grep usb If usbfs is mounted a line such as usbfs on proc bus usb type usbfs should appear By default only the root user is allowed for raw access to USB devices In order to allow access to normal users National Instruments provides a script that configures your system accordingly Execute this script as root user usr local vxipnp linux NIvisa USB AddUsbRawPermissions sh Enter the vendor ID OxOAAD for Rohde amp Schwarz and the product of your instrument A list of all product IDs can be found in the next chapter Now connect the instrument to the USB port 9E
12. ffers more flexibility over direct GPIB connections as it allows the use of different interface types Please consult your Rohde amp Schwarz instrument manual or data sheet for details about which remote control interface is supported by your instrument Please see the documentation of your VISA installation for details about the VISA resource strings Note LAN based remote control requires that the instrument s firewall is disabled This for example applies to the Microsoft Windows based instruments SMU SMJ and SMATE The Linux based instruments such as the SMBV do not have an internal firewall 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 12 R amp S Toolkit Functions 1 11 rs_check_instrument_errors m The function rs_check_instrument_errors sends SYST ERR queries to the instrument until the error queue is entirely cleared lt status gt Ca check instrument _errors lt object gt Parameters lt object gt The instrument object returned by rs_connect Return value lt status gt 1 if successful Example code gt gt err gt gt err instrObj rs_connect gpib nii rs send command instrObj XXX rs_check_instrument_errors instrObj 113 Undefined header XXX gt gt err Q 28 D I 1 12 re send comandm The function rs_send_command sends a single SCPI command to a previously connected instrument lt status gt rs send command
13. mple Scripts The example scripts demonstrate the use of the toolkit functions The following list provides a brief overview of the examples Script m File Connect m Create_lIQ_AWGN m Create_IQ_Chirp m Create_IQ_MultiCarrier m Create_IQ_Pulse m Create_IQ_TwoTone m Convert_Mat2Wv m Run_SCPI_Batch m Functionality Connect to instrument and send IDN and OPT This example also describes the various hardware interfaces in detail Create a noise AWGN signal and load to the instrument s ARB Create a frequency sweep signal and load to the instrument s ARB Create a multi carrier signal and load to the instrument s ARB Create a pulsed signal and load to the instrument s ARB Create a two tone signal and load to the instrument s ARB Read data from a mat file and convert into a Rohde amp Schwarz waveform file for use with the instruments ARB Process a list of SCPI commands that are read from a text file 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 17 ADS Support 10 ADS Support The ADS sub directory of the toolkit contains a MATLAB routine that can be called from ADS in order to convert a complex vector into a Rohde amp Schwarz ARB waveform file The MATLAB routine also allows the user to start the waveform playback in path A or B and set the RF frequency and level 1 17 Installation On Microsoft Windows systems ADS only requires that the PAT
14. n rs_connect sets up the instrument connection and tests the link It returns a handle to the remote controlled instrument The connection can be established using the GPIB or VISA interface as well as via a raw TCP IP socket connection The recommended interface type is VISA Ca connect gpib lt advantech agilent cec contec ics 1otech keithley mcc ni gt lt board number gt lt primary address gt lt secondary address gt Ca Connect visa lt nilagilent tek gt lt visa resource string gt Ca connect tcpip lt hostname gt 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 11 R amp S Toolkit Functions GPIB parameters lt board number gt GPIB board number usually 0 lt primary address gt GPIB bus address of the instrument lt secondary address gt The secondary GPIB bus address of the instrument optional VISA parameters lt VISA resource string gt The VISA resource string describes the device as well as the interface type TCP IP parameters lt hostname gt The instrument host name or the IP address Return values lt status gt 1 if successful lt object gt The handle to the instrument The GPIB and VISA functions require an identifier for the installed hard or software interface The function call for opening device number 28 connected to the first National Instruments GPIB card is gt gt err instrObj rs_connect gpib ni 0 28 VISA o
15. nto local waveform file Transfer the waveform file block wise to the instrument Start playback on instrument Set RF parameters 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 20 ADS Support e Close the instrument connection The function uses the National Instruments VISA interface by default The MATLAB code needs to be changed if other interfaces are used 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 21 Additional Information Th 1GP61 1MA171 1EF46 1EF51 Additional Information R amp S MATLAB Toolkit for BAS NRP Z Senors How to use Rohde amp Schwarz Instruments in MATLAB Using MATLAB for Remote Control and Data Capture with R amp S Spectrum and Network Analyzers Using R amp S Signal Spectrum and Network Analyzers with MATLAB 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 22 About Rohde amp Schwarz Rohde amp Schwarz is an independent group of companies specializing in electronics It is a leading supplier of solutions in the fields of test and measurement broadcasting radiomonitoring and radiolocation as well as secure communications Established more than 75 years ago Rohde amp Schwarz has a global presence and a dedicated service network in over 70 countries Company headquarters are in Munich Germany Environmental commitment e Energy efficient products e Continuous improvement in environment
16. p S AFQ100B UWB Signal and UO Modulation Generator is referred to as AFQ The R amp S AMU200A Baseband Signal Generator and Fading Simulator is referred to as AMU Microsoft Windows MS Windows Windows NT and MS DOS are U S registered trademarks of Microsoft Corporation MATLAB is a U S registered trademark of The Math Works Inc Agilent and Agilent Eesof ADS are registered trademarks of Agilent Technologies Rohde amp Schwarz is a registered trademark of Rohde amp Schwarz GmbH amp Co KG 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 3 Overview 2 Overview MATLAB is widely used for the simulation of communication systems and the creation or analysis of custom signals This toolkit provides functions that simplify the remote control of Rohde amp Schwarz instruments from MATLAB scripts These functions cover the most common tasks such as sending SCPI commands to the instrument and reading responses back from it Additional functions convert UO data into R amp S waveform files and transfer these files to the instrument s ARB A set of example scripts demonstrate the use of the toolkit functions in various applications The toolkit supports remote control via GPIB hardware raw TCP IP socket connections or the VISA Virtual Instrument Software Architecture interface 3 Features The toolkit provides the following functionality Support Microsoft Windows and Linux based sys
17. t wv in the example above 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 19 ADS Support Finally the input values need to be provided to the BusMerged block as indicated in the following picture Const objects may be used for this purpose Level dB Jet BR Level 20 0 RE Freq Hz E EE Oa i Lee e E gt NumericSink ews Jl 1 Dem SE E E Plot None l mee eer ree He N ET AEN R Start DefaultNumericStart Stop 1 ControlSimulation No G Level 1 a EES SE _Level 10e6 Clock Rate Hz Ki a 7 SE Matlab M BusMerges lt lt MI a ssl ag Ee 2 Sse e e Matabeuncton output l Park M e a a P4 NumRows DefaultNNumericStop 4 _NumcCols 1 It is also required to pack the input data stream into a vector This can be done by using the PackCx_M object from ADS The example above uses QPSK encoded data and thus the length of the vector is set to DefaultNumericStop 4 no oversampling used DefaultNumericStop sets number of input bits The list below outlines the input parameters to the BusMerge block Complex vector of UO data Clock rate in Hz Playback path for instrument O none 1 A 2 B RF Frequency in Hz RF Level in Hz The MATLAB script rs_ADS_IQSink performs the following actions when called with the above parameters Open the VISA based instrument connection Process complex vector and turn i
18. tems Open device connections to R amp S Signal Generators Send SCPI commands or queries Process a script with SCPI commands or queries Create an R amp S waveform file from IQ data and send the waveform file to the instrument e Access instruments from within Agilent ADS Advanced Design System 9E Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 4 System Requirements 4 System Requirements 1 2 Hardware e The MATLAB requirements CPU memory hard drive e For the instrument remote control depending on instrument 100MBit LAN GPIB hardware USB interface 1 3 Software The MATLAB Toolkit can be used on Microsoft Windows XP or Linux operating systems The following configuration was tested by Rohde amp Schwarz e Microsoft Windows XP based system Windows XP Service Pack 2 MATLAB 7 4 0 R2007a MATLAB Instrument Control Toolbox National Instruments VISA Version 4 0 e Linux based system Linux kernel 2 6 18 e g Open SuSE 10 2 MATLAB R2009a MATLAB Instrument Control Toolbox provided from R2009a on National Instruments VISA Version 4 1 Rohde amp Schwarz MATLAB Toolkit for R amp S Signal Generators 5 Windows XP Installation 5 Windows XP Installation 1 4 Unpacking The Files The MATLAB Toolkit comes as a set of files bundled in a ZIP archive RS_MATLAB_Toolkit_ lt version number gt zip First create a new folder under your MATLAB toolbox dir

Download Pdf Manuals

image

Related Search

Related Contents

  K83 3GPP FDD, HSPA/HSPA+, Enhanced BS  「リユース製品 Version1.6」 認定基準書    DesignWare Library Quick Reference Guide  21 mai 1892 View  Novomatic 553 S III  SIM Editor User Manual  Rollei Sportsline 99  ID-52J取扱説明書  

Copyright © All rights reserved.
Failed to retrieve file