3. visa and visa tools -ag真人试玩网址


at the time, where gpib was the main physical communication interface, remote control applications communicated directly with gpib hardware drivers. then, the rs232 serial interface was introduced as a cheaper alternative to gpib. also here, applications communicated directly with the rs232 hardware drivers.

the situation got even more complex as lan interface has become the standard in the computer industry. test & measurement instrument vendors have foreseen the potential lan interface can bring to connectivity options for their instruments. however, using a third software interface for the lan-connected instruments would bring more complexity to test and measurement applications.

out of the motivation to unify the software interface, vxiplug&play alliance introduced visa standard (virtual instrument software architecture). currently, the maintanance of visa is done by the ivi foundation. for the lan interface, the tcp/ip-based protocol was named vxi-11. later, came its improved version called hislip. the last addition was support for the usb interface. the usb class of devices natively supported by visa are called usb-tmc (test and measurement class).

visa structure

bellow, is a list of the most important visa functions:

access and search functions:

  • visa open default rm - opens a new resource manager for all visa remote connections.
  • visa find resource / find next resource - find an instrument according given criteria
  • visa open / close - opens and closes remote connection to an instrument.
  • visa set / get attribute - sets or reads a session attribute.

input / output functions:

  • visa write - writes a command string to an instrument.
  • visa read - reads a response string from an instrument.
  • visa clear - clears device input and output buffers.
  • visa read stb - reads instrument's status system summary byte called status byte.

above, is a picture showing different software and hardware layers involved in a remote-control task. the instrument is at the bottom, your application is at the top. the visa layer shields your application from the specifics of the physical communication interface. one exception where you can bypass visa is telnet connection - see *note1.

r&s visa

visa implementations come from different vendors, but they all must abide to the same visa interface standard. in the following chapters we present visa and visa tools from rohde & schwarz and national instruments.

advantages of r&s visa compared to other visa vendors:

  • compact size - the installer has only cca 35mb, deployed 45 mb
  • search for instruments in the network via mdns and vxi-11
  • native support for r&s nrp-zxx powersensors (see *note5)

rohde & schwarz visa is available for download here:

1dc02: r&s®visa description

r&s®visa installers

mac os x:

visa tester tools

visa tester tools represent ready-to-use applications that allow connecting to your instrument, sending scpi commands and reading responses. they provide a complete independent way to verify the communication with your instrument.

rohde & schwarz visa tester tool is called rsvisatester. you can find it in:

windows start menu -> all programs -> r&s visa -> tester 32bit/64bit

how do you tell visa which instrument over which interface you want to connect to? all this information is coded into one string called resource string that is passed into the visa open function. if you already know your resource string, you enter it into the resource field. if not, you can use the menu item find resource.

here are the most typical examples of the resource strings:

  • tcpip0:: - instrument is connected over lan (vxi-11 protocol), its ip address is the 'tcpip0' identifies lan-adapter index, if more than one are available. the part 'inst0' identifies the instance of an instrument in case of more logical instruments share the same ip address (e.g. r&s cmw). you can leave it out and use the shorter form tcpip::
  • tcpip0:: - instrument is connected over lan (hislip protocol), its ip address is similar to vxi-11, '0' at the end identifies instrument instance. see *note2.
  • tcpip0:: - instrument is connected over lan (rawsocket), its ip address is and the port is 5025
  • gpib0::20::instr - instrument is connected over gpib interface, its gpib address is 20. if more gpib controller cards are available, you distinguish between them with the 'gpib0', 'gpib1', 'gpib2' and so on... see *note3.
  • asrl3::instr - instrument is connected over serial interface com3.
  • usb::0x0aad::0x0119::022019943::instr - instrument is connected over usb interface (usb test and measurement class), with vendor id 0xaad, product id 0x119, serial number 022019943.
  • rsnrp::0x0095::104015::instr - rohde & schwarz nrp-zxx, product id 0x095 (nrp-z86), serial number 104015 (see *note5)

assuming you already have the correct resource string, connect to your instrument by hitting the connect button. then, enter the string *idn?\n into the command field and hit write read, or query which automatically combines write read operations. for the '\n' character see *note4. the result is the instrument responding with an identification string:

ni visa offers the same options with its application ni max. in the left tree-control branch devices and interfaces, you can search for your instrument or add a new one. the connection is established when you open visa test panel. the input/output tab provides controls similar to the rsvisatester:

visa trace tools

another advantage of using visa is the ability to trace and log the entire communication with your instrument. the log contains information about every action you performed over visa - every command you sent, every message you received from an instrument, plus timestamps of those actions and errors if they occur. you can analyze this log for errors, performance issuses or other problems you might be facing. if you cannot resolve the problem yourself, you can save the communication log into a file and send it to a colleague or to one of our experts in rohde & schwarz customer support. our instrument driver plugin for labview allows for importing io trace and quickly convert it into labview code (see tip 2.1 in 1ma228).

rohde & schwarz visa io trace utility is called rsvisatracetool. you can find it in windows start menu -> all programs -> r&s visa -> trace tool. detailed description is available in the r&s visa manual placed in the same folder. rsvisatracetool logging the *idn? query communication:

ni visa trace tool is called ni io trace. you can find it in windows start menu -> all programs -> national instruments -> ni io trace. ni io trace logging the *idn? query communication contains more entries due to reading of several session attributes:

*note1 - telnet and rawsocket connection

rohde & schwarz instruments support telnet (teletype network) protocol for the cases where visa cannot be used (very often on linux or embedded systems) or may not be used (e.g. a&d industry). if an instrument supports telnet protocol for remote control, you can still use visa to communicate with it. in that case, the connection is called rawsocket.

*note2 - hislip protocol

the hislip (high-speed lan instrument protocol) is explained in more detail in the application note 1ma208: fast remote instrument control with hislip, including list of the rohde & schwarz instruments supporting the hislip protocol.

*note3 - gpib interface and r&s visa

the vendor of your gpib controller (pci / pcie / usb-gpib) must match the visa provider. if for example, you use ni gpib controller, you have to use the ni visa.

*note4 - termination character '\n'

'\n' is a linefeed (lf) termination character, hexadecimally represented as 0x0a. it serves as message termination character.

in case of rawsocket and serial connection, for visa write operations you always have to terminate strings with the lf character, because that is the only way to tell the instrument that message has ended. to recognise the end of the response in visa read operations, you need to set the visa attributes vi_attr_termchar_en to true and vi_attr_termchar to 0x0a. otherwise, although visa read receives correct response, it finishes with timeout error since it still expects more bytes to arrive.

some instruments require the lf regardless of the connection type. in any case, sending the message with the lf at the end is the most universal and always works properly.

according the scpi standard, instruments must terminate responses with lf. in our example above, notice the lf at the end of the identification string response in the ni visa test panel. rsvisatester does not display white characters, but you can see them in the rsvisatracetool log.

*note5 - r&s nrp-zxx support

starting from version 5.11.0, r&s visa for windows supports the previous generation of r&s powersensors nrp-zxx. to enable this functionality, you need to install the r&s nrp toolkit 4.17 or newer for windows.

as the resource string, you can use two different variants which are interchangeable:

  • rsnrp::0x0095::104015::instr - rohde & schwarz nrp-zxx, product id 0x095 (nrp-z86), serial number 104015
  • usb::0x0aad::0x0095::104015::instr - vendor id 0x0aad (rohde & schwarz) product id 0x095 (nrp-z86), serial number 104015

tip: if you do not know the pid of your powersensor(s), connect them to your computer, and perform the find resource on the r&s visa tester. then you either use the desired resource string from the list, or in case you have more then one powersensor connected, you can pair the product id with the serial number printed on the powersensor label above its bar code.

request information

do you have questions or need additional information? simply fill out this form and we will get right back to you.




我同意,在网站imprint中提到的rohde & schwarz gmbh & co. kg和罗德与施瓦茨实体及分支机构 可出于营销和广告之目的(例如提供特价优惠和折扣促销信息)而通过选定渠道(电子邮件或邮政信件)与我联系并提供相关信息,包括但不限于测试与测量、安全通信、监测与网络测试、广播电视与媒体以及网络安全领域的产品和ag真人试玩网址的解决方案相关信息


您可以随时发送电子邮件至 撤销此同意声明,邮件主题注明“unsubscribe”即可。此外,我们发送给您的每一封电子邮件中都含有电子邮件取消订阅链接。有关个人数据使用和撤销程序的详情,请参阅“隐私声明”

an error is occurred, please try it again later.