Home
Introduction to Attribute Based Instrument Drivers
Contents
1. LabWindows CVI and VXIplug amp play driver For C C based projects there is also the possibility to easily eliminate unused source code The source code files minimally needed for a correctly operating instrument driver are shown unterhalb using the rssoecan LabWindows CVI instrument driver as an example E ChangeLog vs license pdf rsidr_core c E rsidr_core h rsspecan c rsspecan fp rsspecan h rsspecan_attr chm rsspecan_attributes c rsspecan_attributes h rsspecan_b10 c rsspecan_b1 c rsspecan_b27 c rsspecan_b71 c rsspecan_callbacks c rsspecan_distance_to_Fault c rsspecan_fsmr c rsspecan_k5S c rsspecan_k c rsspecan_k s c rsspecan_k8 c rsspecan_k9 c rsspecan_ki0 c rsspecan_k14 c rsspecan_k15 c rsspecan_k20 c rsspecan_k30 c rsspecan_k40 c rsspecan_k7O c rsspecan_k 72_k 4 c rsspecan_k73 c rsspecan_k76 c rsspecan_k c rsspecan_k82_k83_k84_k85 c rsspecan_network_analyzer c rsspecan_receiver c rsspecan_ssa c rsspecan_utility c rsspecan_utility h EY rsspecan_vxi chm TUT Figure 19 Possible configuration of the rsspecan instrument driver In the figure above the minimal recommended configuration of the rsspecan LabWindows CVI instrument driver is highlighted in gray For example to have a proper setup for performing measurements on an LTE downlink signal only the rsspecan_k100_k102 c file
2. Get Attribute Check Attribute H Repeated Capability Position GPS Measurement Receiver Signal Source Analyzer Measuring Receiver Tracking Generator E Network Analyzer H Distance to Fault El B27 FM Demodulation Analog B71 Analog Baseband Input B17 Digital Baseband Input K5 GSM EDGE MS BS Test H K7 Analog Demodulator K7S FM Stereo E K8 Bluetooth Analyzer K3 Power Meter K10 GSM Measurement K14 Spectrogram Measurement K15 Avionics Measurement K20 Cable TV Analyzer K30 Noise Figure and Gain Measurement E 96660066066000000000 ccs F H A ic K40 Phase Noise Marker Receiver Frequency Coupling Marker Search Limits State Marker Search Limits Zoom Marker Search Minimum Auto Marker Search Peak Maximum Auto Marker State Marker Subscan Coupling Marker Threshold State Marker Zoom State Marker Zoom State Portable Measuring Receiver 10 dB Min Measuring Receiver AF Filter HP Measuring Receiver AF Filter LP Measuring Receiver Audio Input Result Display Mode Measuring Receiver Auto Preamplifier 21 Measuring Receiver Auto Recal x Constant RSSPECAN_ATTR_MARKER_ENABLED Data Type ViBoolean Description This attribute switches on or off the currently selected marker in the selected measurement window If no indication is made marker 1 is selected automatically If marker 2 3 or 4 is selected and used as a delta marker itis swit
3. rF OHeteroDsg sz E Repeap mainc TraceAddDiagramArea x EHE gt Source Files as Ed main c Ec rsidr_core c c fsvna c Ec rsvna_attributes c c rsvna_callbacks c c rsvna_utility c os a Find EHE gt Instruments al Ei Rohde amp Schwarz Vector Network Analyzer fsvna_init fe rsvna_InitWithOptions H File ELS Trace Measure H Format H Scale Instrument Handle Status E Trace Contig lo sid pane a rsvna_TraceAdd rsvna_Configure Trace Display State fe rsvna_TraceAssignDiagramArea rsvna_TraceUnassignDiagramArea rsvna_TraceSelect 2 rsvna_TraceDelete 4 z aL Pa User defined datatype y Channel Trace Name MyTrace2 J i rsvna_TraceAddDiagramArea io 1 1 MyTrace2 4 Figure 14 Example how to create a dynamic repeated capability using a high level function This example outlines how to use dynamic repeated capabilities here MyTrace2 in combination with an high level function as well as using it with a front panel Furthermore the default channel setup of the Rohde amp Schwarz ZNB network analyzer is required For the following example the dynamic repeated capability is fed into the driver attribute access function via a constant string parameter File Edit View Build Run Instrument Library Tools Window Options Help PERLON ATIE Repcap main c Source Fass 52 al Ed
4. TY Trigger Horizontal Syne Signal xl Attribute Operation Repeated Capabilities Read een ewes noel Figure 3 Front panel of rsspecan_core_attribute_express Source vi Now select an attribute from the tree structured list Each attribute has a different access type read only write only or read write The proper read write operation can be selected in the Attribute Operation box at the bottom left corner Repeated capabilities are set by using a string control at the bottom of the panel called Repeated Capabilities e g TR1 referring to trace 1 WinO referring to screen A The attribute value is entered using standard LabVIEW controls for each data type numeric Boolean string or ring For example in Basic Operation use the Set Frequency Start value 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 11 Use of Rohde amp Schwarz Attribute Instrument Drivers Configure rsspecan_core_attribute_ex Select Attribute El Basic Operation Amplitude Units Attenuation Attenuation Auto Attenuation Mode Attenuation Mode Portable Frequency Stop Frequency Offset Center Frequency Center Frequency Step Center Frequency Step Auto Center Frequency Coupling Center Frequency Coupling Factor Frequency Span Full Frequency Span Auto Span Mode Frequency Mode Frequency Input Mode Channel Table Attribute ID Attribute Help RSSPECAN_ATTR_FR
5. computer science technology to address the issues by making software more modular and flexible 1 2 The Definition of Instrument Drivers An instrument driver in the simplest definition is a set of software routines that handles the programmatic details of controlling and communicating with a specific instrument The most successful instrument driver concepts have always distributed instrument drivers in source code and provided end users with access to the same tools developers use to write drivers With this philosophy new instrument drivers were often easily developed by end users through modifying an existing driver for another instrument End users in general had come to view the availability of an instrument driver as an important factor in the choice of a particular instrument However users still had access to standard instrument driver development tools and source codes for other instruments VXlplug amp play instrument drivers are defined by VXlplug amp play Systems Alliance VXlplug amp play Systems Alliance which is part of the IVI Interchangeable Virtual Instrument Foundation Interchangeable Virtual Instrument Foundation since 2002 These drivers offer a simple API application programming interface using non structured data types This API is defined by a so called function panel file which contains graphical panels Each of these panels is representing a function s prototype Functions are designed to group several ins
6. needs to be preserved besides the files highlighted in gray The remaining folders can be easily deleted This is procedure is also applicable to other attribute based instrument drivers UMTS Long Term Evolution LTE Technology Introduction 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 27 Related Documents 4 Related Documents e Application Note 1MA153 Development Hints and Best Practices for Using Instrument Drivers http www rohde schwarz com appnote 1MA153 html e Automatic Measurement Control A tutorial on SCPI and IEEE 488 2 John M Pieper Rohde amp Schwarz GmbH amp Co KG e IEEE Std 488 2 1992 IEEE Standard Codes Formats Protocols and Common Commands for Use With IEEE Std 488 1 1987 IEEE Standard Digital Interface for Programmable Instrumentation http standards ieee org reading ieee std_public description im 488 2 1992 desc html 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 28 References 5 References 1 2 3 4 5 6 7 ANSI IEEE Std 488 1 1987 IEEE Standard Digital Interface for Programmable Instrumentation http standards ieee org reading ieee std_public description im 488 1 1987 _desc html The SCPI Consortium http www ivifoundation org scpi default aspx Note Became part of the IVI Foundation in 2002 The SCPI Standard http www ivifoundation org docs SCPI 99 padf VXlp
7. rsspecan driver Drag and drop the rsspecan Core Attribute Express Source vi Source vi in your block diagram After placing the express VI the front panel of the Express VI will be opened automatically see Fig unterhalb 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 10 Use of Rohde amp Schwarz Attribute Instrument Drivers gt Configure rsspecan_core_attribute SS pe E Select Attribute Attribute ID Attribute Help E Markers ooo eh System This class contains the attribute that configure a Be oy option FSP B6 TY Trigger H Reference Oscillator El Trigger 1 Trigger RF Power Level External Mixer This attribute sets the level of the RF power fl Amplitude trigger source E Limit Lines 2 TY and RFP Trigger Source H Display Control This attribute selects the trigger source for the G Hard Copy start of a sweep i Fle R 3 TY Trigger Free Run Mode Gi Service This attribute activates or deactivates the free E Measurement run trigger mode E Receiver H B10 External Generator Control 4 TV Trigger Vertical Signal r This attribute activates triggering at the vertical H B27 FM Demodulation Analog syne signal B71 Analog Baseband Input H B17 Digital Baseband Input 5 TY Trigger Line System KS GSM EDGE This attribute defines the line system in use 525 i K7 FM Demodulator or 625 lines with active TY trigger os gt 6
8. session and that different sessions of the same driver can run simultaneously on different threads To access a driver session from multiple threads the application initializes the driver in one thread and then shares the session handle or object with other threads If an application wants to treat several calls to a driver as a single operation that other threads must not interfere with the application must block other threads during the sequence of calls The application can do this by using synchronization functions provided by the operating system or programming environment Locking inside of a driver has not yet been implemented Multithread safety does not provide any mechanism to allow multiple processes to share the same session It also does not provide any mechanism to synchronize between multiple threads or processes that open multiple sessions on the same physical instrument To synchronize access to the same physical instrument from multiple processes applications must use its own resource locking 2 6 Events Events are basically attributes with no data This is different to IVI driver specification which does not allow implementation of events via attribute engine Events in Rohde amp Schwarz drivers are realized using prefix_SetAttributeViString with VI_ NULL or an empty string in place of the string argument 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 9 Use of Rohde amp Schwarz A
9. setting e g a aa frequency setting or b reading trace data 5 The rsspecan instrument driver is available at http Awww rohde schwarz com drivers 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 5 Attribute Based Instrument Drivers 2 1 Attribute Access Functions When a high level function in an instrument driver queries or modifies the current setting of an attribute it does so by calling one of the Rs_GetAttribute or Rs_SetAttribute functions Each driver contains five prefix _GetAttribute functions and five prefix_SetAttribute functions one for each possible attribute data type These are called typesafe functions Each driver also exports five typesafe prefix_CheckAttribute functions Instrument drivers can call these functions to verify that a particular value is valid for an attribute This allows users to bypass the high level functions in instrument drivers and directly query and modify the values of instrument attributes The prefix_GetAttribute prefix_SetAttribute and prefix_CheckAttribute functions are merely wrappers around calls to the Rs_GetAttribute Rs_SetAttribute and Rs_CheckAttribute functions This instrument driver contains high level functions that set most of the instrument attributes It is best to use the high level driver functions as much as possible because they handle order dependencies 2 2 Attributes and its Data Types Attributes can be grouped into
10. the sweep time So for example to configure only the resolution bandwidth the corresponding attribute can be used illustrated in the figure below step a and step aa Attribute based drivers are leveraging the best from both VXlplug amp play instrument drivers and IVI C instrument drivers Low level functionality is implemented in the same way as in IVI C drivers via attributes The high level driver functions are similar to the IVI standard but not limited to the restrictions of the IVI class definition like strict definition of function names number of arguments and its names of functions which are following the IVI class specification Most high level functions are implemented using attributes as well In this case also the shown steps a and aa are executed when calling one of theses high level functions However not all instrument commands can be implemented as attributes thus some functions are not using attributes but are implemented in the traditional way as already mentioned above In that case the shown step b is executed For instance all functions which have arrays as part of their API fall into this category for example a recorded trace of a spectrum a Accessing Attributes b Read Write Instrument Settings in the traditonal way aa Read Write Instrument Settings via Attributes Figure 1 Architecture of Rohde amp Schwarz attribute based instrument drivers Example of instrument hardware configuration
11. Application Note Products This application note introduces a novel R amp S FSW R amp S FSV R amp S FSVR R amp S FSQ R amp S FSP R amp S FSU R amp S FSMR R amp S FSUP R amp S FSL R amp S ESL R amp S FSC R amp S FSH4 8 R amp S CMW R amp S RTM R amp S RTO R amp S ZNC R amp S ZNB R amp S ZVL R amp S ZVH R amp S PR100 R amp S EM100 attribute based architecture for VXlplug amp play instrument drivers The presented architecture uses the attribute based concept of IVI C instrument drivers to introduce a two layer design for VXIplug amp play instrument drivers Introduction to Attribute Based Instrument Drivers R amp S ETL R amp S ETH R amp S SFC R amp S SFE R amp S SFU R amp S CLG R amp S DVSG Introduction to Attribute Based Instrument Drivers Jiri Kominek Juergen Engelbrecht 20 December 2012 1MA170_3e Table of Contents Table of Contents 1 1 1 2 2 1 2 2 2 2 1 2 2 2 2 3 2 4 2 5 2 6 3 1 3 1 1 3 1 2 3 2 3 2 1 3 2 2 3 3 3 3 1 3 3 2 3 4 3 4 1 3 4 2 3 4 3 3 4 4 3 4 5 VXIplug amp play Instrument Drivers eeeeeeeeeeeeeeeeeeeees 3 Prelat Bebra ER oS eo eo SE i We i eee oe eR neo oe 3 The Definition of Instrument Drivers cceecceceeeeeceeeeneeceeeeneeseeeeneneeeeeees 4 Attribute Based Instrument DriverS eeeeeeeeeeeeeeees 5 Attribute Access FUNCTIONS cccceseeeeeseeeeeeeeeeeees
12. EQUENCY_START Specifies the left edge of the frequency domain Aj in Hertz This is used in conjunction with the RSSPECAN_ATTR_FREQUENCY_STOP Stop attribute to define the frequency domain If the RSSPECAN_ATTR_FREQUENCY_START attribute value is equal to the attributes are in time domain Available Repeated Capabilities Remote control command s SENSe lt 1 2 gt FREQuency STARE RSSPECAN_ATTR_FREQUENCY_STOP attribute value then the spectrum analyzers horizontal Window Wind Win Win2 Win3 Wing Figure 4 Configuring Set Frequency Start example 1 Select the proper attribute To find the designated attribute easily the rsspecan chm help file can be used to look for it Be aware of the fact that the tree structures in the help file and the Express VI are the same Pon Fill the Repeated Capabilities box accordingly Type the desired frequency value in the Value text box After clicking the OK button a new instance of an attributed based VI is generated The name of the VI and its predefined values and also the help file will be adapted The result of the procedure is shown in Fig unterhalb Context Help E Set Frequency Start Input Double Set Frequency Start instrument handle 7 gt instrument handle Attribute ID Attribute ID Repeated Capabilities Repeated Capabil error in no error error in no error instrument handle instrument handle ou
13. Trace2 serves as input value for the pictured Express VI The picture unterhalb also shows the attribute access Express VI s user interface Configure rs na Set Trace Delete Channel1 Select Attribute Attribute ID a RSVNA_ATTR_TRACE_DELETE F Acquisition Attribute Help File 3 P re Trace This attribute deletes a trace with a specified trace name and channel Parameter Conversion Wave Quantities Unit Type DC Range Delete Balanced Port Delete All Balanced Ports Logical Port Reference Impedance Trace Format Trace Aperture Points Trace Assign Name Trace Assign Diagram Trace Diagram State Trace Select Active Available Repeated Capabilities Channel Channell Remote control command s CALCulate lt Channel gt PARameter DELete Trace Channel Catalog Trace Channel Rename Trace Catalog Trace Name Catalog m gt al Attribute Operation Repeated Capabilities Write Channel Cancel Help Figure 8 Example how to use a dynamic repeated capability using the attribute access ExpressVI 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 14 Use of Rohde amp Schwarz Attribute Instrument Drivers After running this sequence a new channel and trace has been added on the instrument and is stored in the instrument driver for future use To access this new trace the dynamic repeated c
14. apability MyTrace2 has to be used In this case the new trace can be addressed by other high level functions as well as using the attribute access functions directly The showed sequence is deleting the repeated capability MyTrace2 again 3 2 How to Use Attributes in LabWindows CVI This section explains how to use attributes in the rsspecan instrument driver This is necessary for instance if the driver does not support the functionality via high level functions API Please use the Driver Attribute Help chm file This help file is accessible via the Instrument Driver Help file e g rsspecan_vxi chm The rsspecan sub file has to be added to the project This file is mandatory for browsing attributes Example How to set the Frequency Start value by attributes To select an attribute use the provided function panels which are included in the instrument driver package These instrument driver function panels can be found in Instruments gt ROHDE amp SCHWARZ SpecAn gt Configuration gt Set Get Check Attribute Repeated Capabilities HE Libraries EME Instruments S n4 Rohde amp Schwarz Spectrum Analyzer rsspecan_init tsspecan_InitwithOptions rsspecan_SetSANMode H Configuration tsspecan_ConfigureFrequencyStartStop tsspecan_ConfigureFrequencyCenter tsspecan_ConfigureFrequencyCenterS par Transducer Hardcopy Calibration User Port S Set Get Check Attribute aye rsspecan_SetAttributeVilnt32 rsspecan_SetA
15. at cause the instrument to perform the desired operation Documenting an instrument command set in the user manual along with some example program listings has traditionally been the standard method for an instrument vendor to assist the end user in programming the instrument These documentation methods have served the industry well for many years but this approach still places the responsibility for writing the program code on the user many of whom may end up writing very similar application programs If the same command works for multiple instruments regardless of the manufacturer users can interchange or upgrade instruments and reduce the amount of changes to their application programs In particular many of the installed base of users who had substantial investments in their software environments that did not easily lend themselves to software modularity lobbied for this approach Through the mid to late 1980s many standard organizations including the IEEE worked on this objective with little progress The IEEE 488 2 specification ANSI IEEE Std 488 1 1987 completed in 1987 more carefully defined the operation of instruments like the program message exchange protocol but did not address the issue of standard command sets In 1990 the SCPI Consortium The SCPI Consortium was formed which became part of IVI Foundation in 2002 This organization approved a specification for standardized commands for message based programmable instrume
16. attributes of repeated capabilities When using attribute access functions on attributes see chapter 2 1 that do not apply to repeated capabilities application programs pass VI_NULL or an empty string for the parameter Dynamic Repeated Capabilities Some instruments for instance R amp S ZNB require user to create own identification strings for repeated capabilities traces channel windows etc In this case the multiplicity and the formatting of the so called dynamic repeated capabilities is defined by the user in the run time In general this implies that the user must allow the driver to track the creation and the deletion of such repeated capabilities Even dynamic repeated capabilities are statically predefined with default values which can be found on the instrument after its reset For instance there s always after reset one trace one window and one channel defined in network vector analyzer These capabilities are statically predefined in instrument driver However these can be deleted or replaced afterwards during run time of the software Examples for this topic are presented in chapter 3 1 1 chapter 3 2 1 and chapter 3 3 1 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 8 Attribute Based Instrument Drivers 2 5 Multithread Safety Rohde amp Schwarz attribute drivers are multithread safe Multithread safety means that multiple threads in the same process can use the same driver
17. ched to marker mode Note s 1 R amp S FSV instrument can use up to 16 markers Available Repeated Capabilities Window Wind Wint Win2 Win3 Win4 Marker M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15 M16 Cancel Figure 13 Example of Repeated Capabilities in LabWindows CV The attribute and its features can be changed at any time later by recalling the function panel which recalls the shown panel 3 2 2 Dynamic Repeated Capabilities in LabWindows CVI In comparison to the previously described repeated capabilities the so called dynamic repeated capabilities are specified by a user defined string parameter for each property in run time For example a property can be a channel or a trace of vector network analyzer The instrument driver stores and tracks this user defined string parameter each time a new parameter is created For this reason it is important to create new using the provided high level functions e g rsvna_TraceAddDiagramArea Creating new parameters using attribute access functions would not allow the instrument driver to trace this newly created dynamic repeated capability accordingly How to use a high level function is shown in the picture below Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 18 Use of Rohde amp Schwarz Attribute Instrument Drivers File Edit View Build Run Instrument Library Tools Window Options Help Bas s 6
18. cific 65 65 13 04 88 customersupport asia rohde schwarz com China 86 800 8 10 8228 86 400 650 5896 customersupport china 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 amp Schwarz GmbH amp Co KG Trade names are trademarks of the owners
19. de amp Schwarz Introduction to Attribute Based Instrument Drivers 21 Use of Rohde amp Schwarz Attribute Instrument Drivers 3 3 1 center frequency 1GHz double centerFrequency 1e9 m_specAn SetDouble rsspecanProperties FrequencyCenter centerFrequency insert more configuration and measurements here Close driver session m_specAn Dispose m_specAn null Repeated Capabilities in C Repeated capability instances are specified by a string parameter for each property They can also be specified by a function which selects the active instance To define the usage of particular capability the following overloaded functions are provided by the C wrapper file for example the rsspecan cs SetInt32 GetInt32 SetDouble GetDouble SetBoolean rsspecan_SetAttribute Vilnt32 rsspecan_GetAttribute ViInt32 rsspecan_SetAttribute ViReal64 rsspecan_GetAttribute ViReal64 rsspecan_SetAttribute ViBoolean rsspecan_GetAttribute ViBoolean rsspecan_SetAttribute ViString rsspecan_SetAttribute ViString GetBoolean SetString GetString A marker example using repeated capabilities is shown in the following example crepeated capabilty example set a marker to a specfic frequency double freqPosition 1 5e9 m_specAn SetDouble rsspecanProperties MarkerPosition Win0 M1 freqPosition The following figure outlines the Supported Repeated Capabilities of the attribute rs
20. e folder 12 Supported Instruments 2 Supported Environments 12 Supported Interfaces 2 What s New 2 Getting started and Examples Instrument Driver Tree Structure 2 Alphabetical list of functions 2 Contact 2 How to use this help E QC Driver Attribute Help Welcome E QQ Attribute Tree Structure E Inherent Instrument Specific Attributes Inherent Vendor Specific Attributes Basic Operation Inhalt Index Suchen E3 H E H amp o amp A 2 AG External Mixer Amplitude E Limit Lines E Display Control T Hard Conn F Trigger E Figure 16 Documentation of available attributes in the rsspecan instrument driver C attributes are accessible through the enum rsspecanProperties which is defined in the namespace InstrumentDrivers of the wrapper file rsspecan cs For example in Basic Operation use the Center Frequency attribute rsspecanProperties FrequencyCenter called RSSPECAN_ATTR_FREQUENCY_CENTER in the VXIplug amp play chm help file for configuring the center frequency as shown in the listing below using InstrumentDrivers namespace rsspecan Application Example class Program static void Main string args string resourceName TCPIP FSP7 100894 INSTR bool idQuery true bool resetDevice true Open driver session rsspecan m_specAn new rsspecan resourceName idQuery resetDevice 1MA170_3e Roh
21. e the same 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 16 Use of Rohde amp Schwarz Attribute Instrument Drivers Fill the Repeated Capabilities text box according to the documentation e g Wino Type the desired frequency value in the Attribute Value text box e g 1e 9 Enter a valid instrument handle in the nstrument Handle text box It is strongly recommended to evaluate the return value of your function if you type the name of a declared integer variable in the Status text box To include the function into your source code you can copy the created function string out of the window on the button of the function panel and insert it into the source code aRwhD gt The result of this procedure is shown in Fig 10 rsspecan_SetAttributeVikeal64 io Win0 RSSPECAN ATTR_FREQUENCY_START 1e 9 a Figure 11 Building a function string on the button of the rsspecan_SetAttributeViReal64 function panel The attribute and its features can be changed at any time later by right clicking the function and recalling the function panel See Fig 11 respecan_SetAttributeViReall64 io WinO RSSPECAN_ATTR_FREQUENCY_START 1e 9 3 Browse Identifier Ctri F1 SB Find UI Object Ctrl Shift U 4 Open Quoted Text Ctrl U 73 Go to Definition Ctrl I Figure 12 Recalling the function panel to modify the attributes 3 2 1 Repeated Capabilities in LabWindows CVI Rep
22. eated capability instances are specified by a string parameter for each property They can also be specified by a function which selects the active instance To define the usage of particular capability enter the proper value in the Repeated Capability text box in the function panel If more than one repeated capability is required for one attribute separate them with a comma A marker example using repeated capabilities is shown in the figure unterhalb 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 17 Use of Rohde amp Schwarz Attribute Instrument Drivers Gi Untitled cws Rohde amp Schwarz Spectrum Analyzer Set Attribute iBoolean File Edit Yiew Code Build Bun Instrument Library Tools Window Options Help i EG a e amp a Untitled Untiledtc SetAttibuteViBoolean j A Attribute ID J Query Instrument Status LJ Find 7 B Amplitude aj Limit Lines E Display Control Attribute Value Transducer OUO O O B Hardcopy i Select Attribute Constant 5 B x H Calibration User Port Data Type Attributes Y Filter f E e Auto Set y All data types Marker N dB Down State al ESS Sat Get Chack Altos ViBooleani Marker Noise Measurement State E Set Attribute EF rsspecan_SetAttributeVilnt32 Isspecan_SetAttributeViReal64 EA rsspecan_SetAttributeViString rsspecan_SetAttibuteViBoolean rsspecan_SetAttributeViSession
23. ed Capabilities in LabVIEW In comparison to the previously described repeated capabilities the so called dynamic repeated capabilities are specified by a user defined string parameter for each property in run time For example a property can be a channel or a trace of a vector network analyzer The instrument driver stores and tracks this user defined string parameter each time a new parameter is created For this reason it is important to create new one using the provided high level functions e g Trace Add Diagram Area vi Creating new parameters using attribute access functions would not allow the instrument driver to trace this newly created dynamic repeated capability accordingly How to use a high level function is shown in the picture unterhalb 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 13 Use of Rohde amp Schwarz Attribute Instrument Drivers ADD Figure 7 Example how to create a dynamic repeated capability using a high level function This example outlines how to use dynamic repeated capabilities here MyTrace2 in combination with high level function as well as using it with Express VI Furthermore the default channel setup of the Rohde amp Schwarz ZNB network analyzer is required For the following example the dynamic repeated capability is fed into the Express VI via parameter The internal default value Channel 7 will be used as channel configuration Here the parameter My
24. eeeeeeesesesnenseseenenensesenens 6 Attributes and its Data TypPes ccccseeesseseeeseseseeeseseseeeseseseenseseseneeseeeenens 6 Implementation of Attributes in Cu ese ceseeeeeeeeeseeeeneeeeeeseeeseeseseeeenseeeees 7 Implementation of Attributes in LabVIEW ccsssccssseeeesseeeeenseeeeeenees 7 Range Table eecsersnesin 8 Repeated Capabilities cccccccsscssseeesseeeeeeesesneeseseeeenseeeseseeeseaeeeseenenseaeees 8 Multithread Safety ccccccccesccesseesesneeenseeeeeeneeesaeseseeeeeseeessseessnaeseneeenseeeees 9 EVENS prcon eesctee eee ale cine eee eee eee 9 Use of Rohde amp Schwarz Attribute Instrument Drivers 10 How to Use Attributes in LabVIEW cecccsseseeesseeeeeesseeeeenseeneeeeseenenens 10 Repeated Capabilities in Lal VIEW ccsccssscesseeeeeeeeeseseenseeeenseeeeeeeees 13 Dynamic Repeated Capabilities in LabVIEW cssccssessseeeseeeesees 13 How to Use Attributes in LabWindOWS CVI c ssecceseessseeesseeeeseeeeeseees 15 Repeated Capabilities in LabWindows CVI ccsssseesseseeeeseseenees 17 Dynamic Repeated Capabilities in LabWindows CVI sseeese 18 How to Use Attributes in Microsoft Visual Studio Using C 0 20 Repeated Capabilities i C eccsseecsseeeseeeeesseeeeseeeeeeeeeseseseseeensneeenseees 22 Dynamic Repeated Capabilities in C cssscsseeeseeeeseeesseeeeseeeeeeeees 23 Tips and TRICKS srsscesannen
25. en eeceetee reeeenns Seeeteueraccnned eeeccuereeenned 24 Execution Speed Disable Instrument Status Checking 00ss0 24 How to Build Executables or Libraries in LabVIEW s s eeseeee 24 Error Handling Instrument version not Vali ccccsssetseeeereeeees 24 Error Handling Range Checking csccccesssssesceseeeeeeneeseeeeessensnsneeeeseees 25 How to Minimize the Size of an Attribute Based Instrument Driver 25 Related DOCUMENTS i sssissicsccaccnscccencainceectascetiesnsnstaneasnemensnennne 28 ReferenC S stictictiniiaitiaitditiptinne dae 29 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 2 VXlplug amp play Instrument Drivers 1 VXlplug amp play Instrument Drivers 1 1 Preface The task of programming instruments in a test system has always been a concern for end users and a major cost for the overall system development Many users know that programming can often be the most time consuming part of developing a system The developer spends much valuable time learning the specific programming requirements of each instrument in the system Almost all instruments are designed for interactive use through a physical front panel and also offer remote control capability via a communication port on the backside of the instrument The details for how to program the instrument remotely are usually documented in the instrument manual in the form of ASCII command sets th
26. ff Repeated Capability Name Attribute ID 4 H il Zattenuation LJ Find Z isspecan_ConfigureSweepCouplingAuto al 5 rsspecan_ConfigureSweepCoupling FE rsspecan_ConfigureS weepCouplingAdvanced Attribute Value tsspecan_ConfigureMainPLLB wid E J EF tsspecan_ConfigureFiterT ype EA rsspecan_ConfigureVBWMode EA tsspecan_ConfiqureFFT FilterMode EA tsspecan_ConfigureAveraging tsspecan_ConfigureAveragingT ype isspecan_ConfiguredveragingCount EA tsspecan_ConfigureAcquisition tsspecan_ConfigureVerticalScale Status tsspecan_ConfiqureHorizontalS cale Instrument Hande E tsspecan_ConfigureSweepPoints 4 tsspecan_QuerySweepPoints EF sspecan_ConfigueSweepType EA rsspecan_ConfigureReferenceLevel isspecan_ConfigureReferenceLevelOffse Data Type Attributes Y Filter Ls C3 tsspecan_ConfigureLevel All data types a File Recall al tsspecan_ConfigureAttenuationMode ViReal64 File Save EA isspecan_ConfigureParameterCoupling File Save Next EA tsspecan_ConfigureReferenceLevelCour File Startup Recall tsspecan_ConfigurelFOutputSource Frequency Counter Resolution ViReal4 tsspecan_ConfigureUnitPower tsspecan_ConfigureUnitLenath Frequency Counter State i isspecan_GetChannelNumber Frequency Input Mode B Trace Frequency Line Position ViReal64 H Multitrace Frequency Line State BO Marker Frequency Mode E Dela Marker Frequency Offset ViReal64 B System Frequency Span ViReal64 E Trigger Frequency Start ViReal64 H Gate Frequency Stop ViRea
27. hich is encapsulated by the instrument driver For instance a SCPI command with more than one argument can t be implemented as attributes but instead are implemented as high level functions The same is also true for SCPI commands which are dealing with data sets In the Rohde amp Schwarz spectrum analyzer for example the function for reading a Y trace of a spectrum analyzer is implemented in that way Implementation of Attributes in C Attributes are implemented as global data structures defined in file prefix_attributes c Because all drivers are distributed in source code users can freely modify remove or add any attribute range table and repeated capabilities Data structures are interpreted by the core which is implemented in files rsidr_core c and rsidr_core h These two files are always the same for all Rohde amp Schwarz attribute drivers thus when combining source codes of two different drivers these two files need to be added to the project once Using attributes in the C based LabWindows CVI environment is described in chapter 3 2 Implementation of Attributes in LabVIEW Similarly to C implementation in the latest version attributes and range tables in LabVIEW are implemented as global structures which are accessed via global variables Search for attributes and range tables uses pre generated sorted hash tables and binary search instead of linear search A global variable containing attribute def
28. inition is unique for each instrument driver as well as the driver core which is distributed as LabVIEW library This is the same for all Rohde amp Schwarz attribute based LabVIEW drivers As speaking of attribute based driver which are shipped as project based LabVIEW code here the same implementation of the functional global variable is realized the only difference are different file names of the related files Using attributes in LabVIEW is described in chapter 3 1 2 For details on National Instrument LabWindows CVI please visit http Avww ni com Iwevi 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 7 Attribute Based Instrument Drivers 2 3 Range Table An Attribute can have its range table which defines the attribute s valid values There are three types of range tables e Ranged valid values are defined as a closed interval of integer or floating point values according to the range table s data type The number of marker available on a spectrum analyzer can be named as example e Coerced valid values are defined as a discrete set of numbers If this range table is associated with an attribute then the attribute values are coerced to the nearest value listed in the coerced range table For example the number of sweep points of a spectrum can be limited to an increment of 100 for number of points equal or greater than 201 e Discrete valid values are defined as a discrete set of n
29. l64 Ertemal Mixer Extension Group Full Frequency Span Amplitude Function Capabilities Limit Lines H Display Control H Transducer Constant RSSPECAN_ATTR_FREQUENCY_START Hardcopy Data Type ViReal64 H Calibration Description Specifies the left edge of the frequency domain in Hertz This is used in conjunction with the H User Port RSSPECAN_ATTR_FREQUENCY_STOP Stop attribute to define the frequency domain If the RSSPECAN_ATTR_FREQUENCY_START H Auto Set attribute value is equal to the RSSPECAN_ATTR_FREQUENCY_STOP attribute value then the spectrum analyzers horizontal attributes E Set Get Check Attribute are in time domain E Set Attribute Iespecan_SetAttributeVilnt32 respecan_SetAttibuteVinlealo4 respecan_SetAttributeViString E respecan_SetAtibuteVBoolean ieenaes 1 961 FRE oUcney STARE E rsspecan_SetAttributeViSession E Get Attribute E Check Attribute H Repeated Capability H Position GPS Measurement Receiver rsspecan_SetAttributeViReal64 RSSPECAN_ATTR_ATTENUATION Available Repeated Capabilities Window Aino Wint Win2 Win3 Win4 aae Signal Source Analyzer xj a a Ja Figure 10 Selecting an attribute in the SetAttributeViReal64 function panel 1 Please select the desired attribute To find the designated attribute easily the rsspecan chm help file can be used to look for it Be aware of the fact that the tree structures in the help file and the Express VI ar
30. lug amp play Systems Alliance http www ivifoundation org V XIPlug_Play default aspx Note Became part of the IVI Foundation in 2002 Interchangeable Virtual Instrument Foundation IVI Foundation http www ivifoundation org Virtual Instrument Software Architecture VISA http www ivifoundation org specifications default aspx IVI Driver Architecture Specification http www ivifoundation org specifications default aspx 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 29 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 environmental sustainability e ISO 14001 certified environmental management system Certified Quality System ISO 9001 Regional contact Europe Africa Middle East 49 89 4129 12345 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 Pa
31. main c 53 Se tsidt_core c 540 int main void Ec rsvna c l cl RRN 5 3 _ ou cj fsvna_cal Sone 58 CHECKERR rsvna_TraceAddDiagramArea io Session rsvna_utility c 59 i Vindow J Include Files 60 1 7 Channel1 En tsidr_core h 61 i MyTrace2 Trace name pm h 62 CHECKERR rsvna_SetAttributeViString io ghy revna ail 63 Chi 1 default A H 64 nA KCE DELETE esl Trace name oi 66 7 H Trace 4 67 H Stimulus 68 return 0 Channel E B i 70 Display 71 H System 72 35 Utility 73 rsvna_reset 74l 75 feal rsvyna_SystemShutdown 76l EE rsvna_self_test 77 rsvna_revision_query 78 Isvna_error_query 79 rsvna_error_message R o E External Application Control 82 E Error Info 83 H Instrument 1 0 84 Set Get Check Attribute FA I Set Attribute 87 tsyna_SetAttributeVilnt32 88 rsvna_SetAttibuteViRealb4 89 n 30 al paa a e e a ac E 4 Ln 62 97 Col 25 SH p m INS Debug 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 19 Use of Rohde amp Schwarz Attribute Instrument Drivers Figure 15 Example how to use a dynamic repeated capability using the attribute access functions After running this sequence a new channel and trace has been added on the instrument and is stored in the instrument driver for future use To access this new trace the dynamic repeated capability MyTrace2 has to be used In this case the ne
32. mentation can be found in the Instrument Driver Help file in Instrument Driver Tree Structure gt Configuration gt Set Get Check Attribute Repeated Capabilities referring to listed function names in the brackets above It is important to distinguish between 32 bit and 64 bit remote control software applications These files are wrapper files for bitness dependent dynamically loaded libraries Please always configure your Microsoft Visual Studio project to be 32 bit or 64 bit as target The default setup Any CPU must not be enabled For further information please refer to Application Note 1MA153 available on http Awww rohde schwarz com appnote 1MA153 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 20 Use of Rohde amp Schwarz Attribute Instrument Drivers Example How to set the Center Frequency value by attributes This example shows how to use attributes without repeated capabilities The use of repeated capabilities is described in section 3 3 1 To find the proper attributes for specific configurations the rsspecan_vxi chm help file can be used All available attributes are listed in the Instrument Driver Help chapter under Driver Attribute Help see figure unterhalb 15 x a isi Ausblenden Zur ck Drucken Optionen This section contains Attribute help of the driver For 7 proper operation all CHM help files must be placed in 2 Why Instrument Drivers the sam
33. nts The SCPI Consortium is not active anymore and the last updated document was published in 1999 The SCPI Standard While more and more companies continue to endorse the SCPI standard and use it in their new instrument designs still instruments available today do not use this standard command set In addition while many users of SCPI instruments appreciated the progress and have experienced improvement in productivity once they learn the standard command set instrument interchangeability is still not a reality because most instruments have different often unique functionality and therefore a command set different to the SCPI standard command set Moreover syntactically equal SCPI commands are a necessary but not a sufficient condition for instrument interchangeability While the SCPI standard is certainly recognized by the entire industry as a step forward the lack of progress on this issue encouraged both users and vendors to explore other approaches before SCPI was completed Standard Commands for Programmable Instruments 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 3 VXI plug amp play Instrument Drivers They needed to decrease the time required to program instruments facilitating instrument interchangeability and easing system maintenance Rather than trying to solve the problems by standardizing the instruments from all suppliers both users and vendors began to take advantage of new
34. o your project With this manual reference the driver core is included in the build and the driver core is accessible during runtime 3 4 3 Error Handling Instrument version not valid If option checking is enabled the driver checks first if the following command is supported by the connected instrument While the initialization of the driver the ID Query has to be enabled to correctly identify the connected instrument Based on the installed instrument options the driver is generating the error Instrument version not valid if the command is not supported by the instrument For extended debugging the option checking functionality can be disabled using the function VI Option Checking and set the input variable to False This can be found in the Utility Functions folder of the driver documentation 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 24 Use of Rohde amp Schwarz Attribute Instrument Drivers 3 4 4 Error Handling Range Checking If range checking is enabled the driver checks if the input parameters are within the valid range for the connected instrument Range checking is most useful during debugging After users have validated their programs they can disable range checking to maximize performance Using the function VI Option Checking and set the input variable to False This can be found in the Utility Functions folder of the driver doc
35. rted functions and VIs in case of LabVIEW instrument drivers Rohde amp Schwarz offers a new approach to balance the instrument driver s API called Attribute Based Instrument Drivers For details on WiMAX please visit http www rohde schwarz com appnote 1MA96 html 3 For details on LTE please visit http www rohde schwarz com appnote 1MA111 html For details on National Instrument LabVIEW please visit http www ni com labview 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 4 Attribute Based Instrument Drivers 2 Attribute Based Instrument Drivers An attribute can be defined as an element of a hardware configuration of an instrument or a software configuration of an instrument driver Thus each instrument setting is associated with a hardware configuration attribute In general an attribute based driver is a standard VXlplug amp play instrument driver It can be used as a traditional single layer instrument driver However if the user needs to configure or measure a single parameter which is part of complex high level function He does not have to directly use a SCPI command or if available a low level function but can use the appropriate attribute access function For instance the high level function of the Rohde amp Schwarz spectrum analyzer instrument driver rsspecan for configuring the sweep coupling sets three parameters the resolution and the video bandwidth as well as
36. specanProperties MarkerPosition called RSSPECAN_ATTR_MARKER_POSITION in the rsspecan chm help file 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 22 Use of Rohde amp Schwarz Attribute Instrument Drivers E e 4 amp 4 F Ausblenden Zur ck Drucken Optionen rhat ide Suchen Marker Position RSSPECAN_ATTR_MARKER_POSITION 2 Welcome 2 Why Instrument Drivers a Supported Instruments 2 Supported Environments 2 Supported Interfaces 2 What s New 2 Getting started and Examples E Instrument Driver Tree Structure Bl Alphabetical list of functions 2 Contact 2 How to use this help E QQ Driver Attribute Help 2 Welcome oe ate Specific Attributes This attribute positions the selected marker to the indicated frequency span gt 0 time r span 0 or level APD measurement or CCDF measurement ON in the selected E Inherent Vendor Specific Attributes measurement window If marker 2 3 or 4 is selected and used as delta marker it is E e Basic Operation switched to marker mode aw Markers Note s a RSSPECAN_ATTR_MARKER_AMPLITUDE C Function Call s rsspecan SetAttributeViReal 4 instrSession repeated_capability_string RSSPECAN_ATTR_MARKER POSITION value_to_be_ set rsspecan GetAttributeViReal 4 instrSession repeated_capability_string RSSPECAN_ATTR_MARKER_ POSITION pointer_to_Vikeal 4_variable Basic Function Call s rsspecan SetAttrib
37. t error out error out This Express YI is configured as Follows fal Set Frequency Attribute ID RSSPECAN_ATTR_FREQUENCY_START Start Repeated Capabilities instrument handle Attribute Value 1E 9 aria i hi Specifies the left edge of the frequency domain in Hertz This is used Repeated Capabl in conjunction with the RSSPECAN_ATTR_FREQUENCY_STOP Stop attribute to define the Frequency domain If the instrument handle RSSPECAN_ATTR_FREQUENCY_START attribute value is equal to the RSSPECAN_ATTR_FREQUENCY_STOP attribute value then the a SE spectrum analyzers horizontal attributes are in time domain Available Repeated Capabilities Window Win Win1 Win2 Remote control command s SENSe lt 1 2 gt FREQuency STARE Figure 5 Instanced attribute based VI Set Frequency Start 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 12 Use of Rohde amp Schwarz Attribute Instrument Drivers 3 1 1 Repeated Capabilities in LabVIEW Repeated capability instances are specified by a predefined string parameter for each property They can also be specified by a function which selects the active instance To define the usage of a particular capability enter the proper value in the Repeated Capability text box in the front panel of the Express VI To use more than one repeated capability in one attribute separate them with a comma A marker example using repeated capabili
38. tation Test x73 3GPP FDD UE Measurements 76 TD SCDMA BTS Mode 77 TD SCDMA MS Mode xez CDM42000 Base Station Test kes CDM420001xE DY Mobile Station Test k84 1xE DO Base Station Test K85 1xE DO Mobile Station Test k90_K91 WLAN k92_k93_k94 WIMAX K100 EUTRA LTE Downlini nalysis Measurement B Measuring Receiver Network Analyzer Receiver Service Signal Source Analyzer Status Register Tracking Generator utility E dir mnu o rsspecan Close vi rsspecan Initialize vi m rsspecan Set Spectrum Analysis Mode vi mi rsspecan TETRA VI Tree vi m rsspecan YI Tree vi Ey rsspecan chm Ey rsspecan_attr chm Figure 18 Possible configuration of the rsspecan instrument driver In the figure above the minimal recommended configuration of the rsspecan LabVIEW instrument driver is highlighted in gray For example to have a proper setup for performing measurements on an LTE downlink signal only the K100 EUTRA LTE Downlink folder needs to be preserved besides the folders highlighted in gray The remaining folders can be easily deleted The content of the LabVIEW user lib _express rsspecan folder is mandatory This is procedure is also applicable to other attribute based instrument drivers 10 UMTS Long Term Evolution LTE Technology Introduction 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 26 Use of Rohde amp Schwarz Attribute Instrument Drivers
39. ties is shown in Fig unterhalb gt Configure rsspecan_core_attribute Fal Select Attribute Attribute ID JRSSPECAN_ATTR_MARKER_ENABLED Attribute Help This attribute switches on or off the currently al selected marker in the selected measurement window IF no indication is made marker 1 is selected automatically If marker 2 3 or 4 is El Basic Operation B Markers Marker Amplitude Marker Position Assign Marker to Trace selected and used as a delta marker it is All Markers Off switched to marker mode Marker Local Oscillator Suppression Note s Signal Track State Signal Track Bandwidth 1 R amp S FSV instrument can use up to 16 Signal Track Threshold markers Signal Track Trace Available Repeated Capabilities Marker Step Size Window Win0 Win1 Win2 Win3 Wind Marker Probability Marker M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 Marker Receiver Frequency Coupling M11 M12 M13 M14 M15 M16 Marker Subscan Coupling Remote control commands Marker Search CALCulate lt 1 2 gt MARKer lt 1 to 4 gt STATe Marker Search Configuration Marker Functions Delta Marker ei Attribute Operation Repeated Capabilities Input Boolean Write wif Wino M1 OFF OK Cancel Help Figure 6 Example of Repeated Capabilities The attribute and its features can be changed at any time later by double clicking the VI which recalls the shown Express VIs front panel 3 1 2 Dynamic Repeat
40. trument s parameters which are logically tied one to each other It allows the driver s user to make instrument setup or measurement in less steps compared to sending SCPI commands using low level or VISA functions Virtual Instrument Software Architecture On the other hand there are cases where access to specific commands is needed Modern instruments capable of measuring generating and analyzing advanced signals such as WiMAX or LTE are very complex and sometimes it may be necessary to configure only a single parameter of the instrument usually because of speed either speed of software execution or speed of instrument s internal reconfiguration and measurement Formerly this contradiction was solved by sending SCPI commands directly using either VISA low level functions like the VISA Read Write or utilizing the function of the driver that is configuring this parameter However issues like instrument state synchronization or error checking needs to be solved by the user To avoid mixing two different programming techniques new drivers have been designed with layered API consisting of low level and high level functions Low level functions are usually using only one SCPI command High level functions are then calling into several low level functions according to its parameters While this API structure allows the user to benefit from both having well organized high level functions and having low level functions it leads to high number of expo
41. ttribute Instrument Drivers 3 Use of Rohde amp Schwarz Attribute Instrument Drivers The following example is referring to the rsspecan and the rsvna instrument driver The described procedures are all adaptable to other attribute based Rohde amp Schwarz instrument drivers only the naming of the files can be different The naming convention is PREFIX where the PREFIX is the abbreviation of a specific instrument driver 3 1 How to Use Attributes in LabVIEW This section explains how to use the attributes in the rsspecan instrument driver This is necessary for instance if the driver does not support the functionality via high level Vis Please also use the Driver Attribute Help chm file This help file is accessible via the Instrument Driver Help file e g rsspecan chm Example How to set the Frequency Start value by attributes To select an attribute use the provided Express VI included in the instrument driver package This instrument driver Express VI can be found in User Libraries gt Express User Libraries gt rsspecan Functions Programming Measurement I O Instrument I O vision and Motion Mathematics Signal Processing Data Communication Connectivity Control Design amp Simulatic SignalExpress Express Addons Favorites dvv vvv vvv vvv vv User Libraries L Express User Libraries rsspecan Select a VI x Figure 2 Palette menu of
42. ttributeViReal64 rsspecan_SetAttributeViS tring rsspecan_SetAttributeViBoolean rsspecan_SetAttributeViSession Get Attribute Check Attribute 1 Repeated Capability Ha bd eee a Figure 9 Function panel for rsspecan driver attributes 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 15 Use of Rohde amp Schwarz Attribute Instrument Drivers To open the function panel double click on the desired function Fig 9 shows the function panel of rsspecan_SetAttribute ViReal64 Clicking on the Attribute ID text box opens the Select Attribute Constant window Now you can select the desired attribute from the tree structured list Each attribute can have a different access type read only write only or read write Proper read write operation can be selected by the proper function panel either Set Attribute Get Attribute or Check Attribute Repeated capabilities are set by using identifier or identifier names within the function panel called rsspecan_GetAttributeRepeatedCapabilityld s Names For example in Basic Operation use the Set Frequency Start value Gi Untitled cws Rohde amp Schwarz Spectrum Analyzer Set Attribute ViReal64 aw _ File Edit View Code Build Bun Instrument Library Tools Window Options Help GEES eVox alk ad ale o Untitled Untivedtc SetdttibuteViteat64
43. two categories hardware configuration attributes and software control attributes Generally each instrument setting is associated with a hardware configuration attribute e g a frequency setting Hardware configuration attributes allow the user to set and query values of the associated instrument settings Software control attributes control how the instrument driver works rather than representing particular instrument settings Those allow users to enable and disable features such as range checking and instrument status checking For more information about that please refer to chapter 3 4 prefix stands for a corresponding attribute based instrument driver e g prefix_SetAttributeBoolean stands for rsspecan_SetAttributeBoolean in case of the rsspecan attribute based instrument driver Five type safe functions are available for following data types ViBoolean Vilnt32 ViReal64 ViString and ViSession 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 6 Attribute Based Instrument Drivers Attributes are used in conjunction with the following data types e ViBoolean e Vilnt32 e ViReal64 e ViString e ViSession SCPI commands with enumerated string argument e g SENSe lt 1 2 gt AVERage TYPE VIDeo LINear are realized by an attribute of data type Vilnt32 and proper range table see image below The SCPI command itself is implemented in the attribute data structure w
44. ty can be a channel a trace or a window of vector network analyzer The instrument driver stores and tracks this user defined string parameter each time a new parameter is created For this reason it is important to create new using the provided high level functions e g m_specAn TraceAddDiagramArea Creating new parameters using attribute access functions would not allow the instrument driver to trace this newly created dynamic repeated capability accordingly How to use a high level function is shown below add a new trace MyTrace2 into a new diagramm area m_VNA TraceAddDiagramArea winNumber chanNumber MyTrace2 This example outlines how to use dynamic repeated capabilities here MyTrace2 in combination with high level function To get this line of code executed the default channel setup of the Rohde amp Schwarz ZNB network analyzer is required For the following example the dynamic repeated capability is fed into the driver attribute access function via a string parameter delete the trace named MyTrace2 m_VNA SetString rsvnaProperties TraceDelete Channeli default MyTrace2 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 23 Use of Rohde amp Schwarz Attribute Instrument Drivers After running this code a new channel and trace has been added on the instrument and is stored in the instrument driver for future use To access this new trace the d
45. umbers No coercion applies This range table is also used for mapping of integer constant values to enumerated string command arguments For instance the string VIDeo which needs to be sent to the instrument can be mapped to the symbolic constant PREFIX VAL AVERAGE _TYPE_VIDEO with integer value 0 for instance 2 4 Repeated Capabilities Many instruments contain multiple instances of the same type of functionality For example many instruments have multiple channels windows or traces with independent settings The general term for functionality that is duplicated in an instrument is repeated capability Repeated capabilities can be complex An instrument may have multiple sets of repeated capabilities such as windows and traces or markers Also repeated capabilities may be nested within other repeated capabilities for example traces within displays Repeated capability instances are specified by a string parameter to each function that accesses the repeated capability or by a function that selects the active instance Attribute access functions are provided with a string parameter which selects the capability to be used by function To define the usage of a particular capability fill the string with a proper value To use more than one repeated capability in one attribute separate them with comma The attribute access functions include a repeated capability selector parameter for use with channel based attributes or
46. umentation 3 4 5 How to Minimize the Size of an Attribute Based Instrument Driver The Rohde amp Schwarz attribute based instrument drivers are by definition divided into different independent modules These modules are based on the instrument s hardware and software options Consequently it is possible to include only the instrument driver core modules and the other driver modules corresponding to the instrument options used This allows you to avoid unused driver modules within your development project LabVIEW driver To avoid unused VIs in a LabVIEW project you can simply delete unused folders inside the instr lib folder The folders minimally needed for a correctly operating instrument driver are shown in the following using the rsspecan LabVIEW instrument driver as an example 1MA170_3e Rohde amp Schwarz Introduction to Attribute Based Instrument Drivers 25 Use of Rohde amp Schwarz Attribute Instrument Drivers utility B17 Digital Baseband Input 827 FM Demodulation Analog 871 Analog Baseband Input cpmazo00 Common Settings Configuration Distance to Fault OF ile Bks GSM EDGE MS B5 Test 9K Analog Demodulator 9k75 FM Stereo OKs Bluetooth Analyzer K9 Power Meter SK 10 GSM Measurement x14 Spectrogram Measurement xis Avionics Measurement k20 Cable TV Analyzer x30 Noise Figure and Gain Measurement K410 Phase Noise k70 Vector Signal Analysis x72_k74 3GPP FDD Base S
47. uteViReal 4 instrSession repeated _capability_string RSSPECAN_ATTR_MARKER_POSITION value_to_be_set rsspecan GetAttributeViReal64 instrSession repeated_capability_string RSSPECAN_ATTR_MARKER_POSITION ViReal64_variable Purpose 1 R amp S FSV instrument can use up to 16 markers RSSPECAN_ATTR_MARKER_ENABLED RSSPECAN_ATTR_MARKER_POSITION Valid Values RSSPECAN_ATTR_MARKER_TRACE RSSPECAN_ATTR_MARKER_OQUTPUT_FORMAT RSSPECAN_ATTR_MARKER_AOFF Default Value RSSPECAN_ATTR_MARKER_LOEX RSSPECAN_ATTR_SIGNAL_TRACK_ENABLED RSSPECAN_ATTR_SIGNAL_TRACK_BWID Supported Repeated Capabilities Not checked 0 RSSPECAN_ATTR_SIGNAL_TRACK_THRESHOLD RSSPECAN_ATTR_SIGNAL_TRACK_TRACE RSSPECAN_ATTR_MARKER_STEP_SIZE Window WinO Wind Win2 Win3 Wind RSSPECAN ATTR MARKER PROBABILITY Marker M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 M12 M13 M14 M15 M16 RSSPECAN_ATTR_MARKER_RECEIVER_FREG_COU RSSPECAN_ATTR_MARKER_SUBSCAN_COUPLING Marker Search Marker Search Configuration More info Option Checking None 0055525225522 E22E 1H A Remote control command CALCulate lt 1 2 gt MARKer lt 1 to 4 gt X Figure 17 Marker example to explain repeated capabilities 3 3 2 Dynamic Repeated Capabilities in C In comparison to previously described repeated capabilities the so called dynamic repeated capabilities are specified by a user defined string parameter for each property in run time For example a proper
48. w trace can be addressed by other high level functions as well as using the attribute access functions directly This attribute access function is deleting the trace The showed sequence is deleting the repeated capability MyTrace2 again 3 3 How to Use Attributes in Microsoft Visual Studio Using C This section explains how to use attributes in the rsspecan instrument driver in Microsoft Visual Studio 2008 This is necessary for instance if the driver does not support the functionality via high level functions API In the following examples the programming language C is used The rsspecan cs or the rsspecan64 cs file has to be added to the project This file comes together with the VXIplug amp play driver and is a prerequisite for using the driver in C To control an instrument via an attribute use one of the provided get and set functions of the C wrapper The available functions can be found in the following list SetSession rsspecan_SetAttributeViSession rsspecan_GetAttributeViSession e SetInt32 rsspecan_SetAttributeVilnt32 e GetInt32 rsspecan_GetAttributeVilnt32 e SetDouble rsspecan_SetAttributeViReal64 e GetDouble rsspecan_GetAttributeViReal64 e SetBoolean rsspecan_SetAttributeViBoolean e GetBoolean rsspecan_GetAttributeViBoolean e SetString rsspecan_SetAttributeViString e GetString rsspecan_SetAttributeViString GetSession The respective functions and their docu
49. ynamic repeated capability MyTrace2 has to be used In this case the new trace can be addressed by other high level functions as well as using the attribute access functions directly This attribute access function is deleting the trace The showed sequence is deleting the repeated capability MyTrace2 again 3 4 Tips and Tricks 3 4 1 Execution Speed Disable Instrument Status Checking If instrument status checking is enabled the driver automatically checks the status of the instrument after most operations If the instrument indicates an error condition the driver returns a special error code The user then calls the error query function to retrieve the instrument specific error code from the instrument Instrument status checking is most useful during debugging Once application development is complete this feature can be disabled to maximize performance 3 4 2 How to Build Executables or Libraries in LabVIEW The driver core of the attribute based instrument drivers is dynamically linked to any executed VI during runtime This cannot be recognized by the LabVIEW application builder The LabVIEW application builder follows all static dependencies and includes them in the distributed package when building an executable To create an executable in LabVIEW please manually add all Vis in the lt instr lib gt PREFIX _utility callbacks folder to the LabVIEW project In case of project based driver please add the Private folder t
Download Pdf Manuals
Related Search
Related Contents
Dell Precision M3800 Manual del propietario Catalogue Green Life 取扱説明書 運用支援ソフト PISTOLAS DE CLAVOS Y SUS COMPRESORES USER MANUAL - Video Electrolux 50877 User's Manual Graco Mark X 240 Volt User's Manual InLine Cat.6A 0.5m Twido and Lexium Magelis and Advantys System User Guide Multiquip Saw SP605716 User's Manual Copyright © All rights reserved.
Failed to retrieve file