|
|
||||||||||||||||||||||||
|
The Magazine Dedicated to the Next Generation of Test Systems that Harness the Power of Ethernet |
||||||||||||||||||||||||
|
Articles |
||||||||||||||||||||||||
|

|
By Paul G. Schreier, LXI ConneXion Editor, and
By Bill Yonkers and Stephen Kugler, Kepco
PlugFest Offers More Than Conformance Testing By Paul G. Schreier, Editor
LXI 1.2 Improves Discovery and Identification By Nick Barendt, VXI Technologies
LXI System Setup Is Quick and Easy By Tim Ludy, Data Translation
Programming Preliminaries
By Paul G. Schreier, LXI ConneXion Editor, and In some situations, working with an LXI instrument can be extremely easy. Make an Ethernet connection between a PC and an LXI instrument, enter its IP address into a Web browser, and begin some simple work on the Web pages embedded in the instrument such as taking a reading.
This approach, however, is useful for only the most basic applications and might not work for some LXI instruments. Before you can start to program an LXI test system of any realistic complexity, you must do some minor prep work involving drivers and other support software. In the process, you’ll run into a number of standards and terms that might not be familiar. Keep in mind, though, that much of this software functions behind the scenes so you won’t have to concern yourself with what is going on at the low level. Nevertheless, knowledge of what is going on is important (Figure 1). Start With Drivers The LXI standard mandates that every LXI instrument must have an Interchangeable Virtual Instrument (IVI) driver. The IVI Foundation defines a standard driver application programming interface (API) for programmable instruments. Currently, there are two IVI driver formats: IVI-COM for working with COM-based development environments and IVI-C for working in traditional programming languages. However, most LXI instruments can be programmed in ways besides IVI, so it’s not mandatory to work with an IVI driver. Instead, developers can use other driver technologies or work directly with SCPI commands. This is good news for users of Linux and other operating systems because IVI drivers are certified only for Windows. Most programmable instruments speak a language called the Standard Commands for Programmable Instrumentation (SCPI). SCPI defines a standard command syntax rather than a standard set of commands. For instruments that support SCPI, the command language works regardless of the bus being used, whether it’s GPIB, RS-232, or Ethernet. But SCPI doesn’t define how you send those commands. Without such higher-level APIs, users would have to write code specific to each bus. For instance, if you wanted to write to a serial device, you could look up the OS’s serial API, such as CreateFile on Windows, to send and receive ASCII strings. If you wanted to write to a GPIB device, you could use the vendor’s driver that came with the GPIB card. To write to a USB device, you could learn the OS’s USB API and implement a USB test and measurement class layer. And for a VXI-11 device such as an LXI instrument, you could use remote procedure calls (RPC) with an RPC library. Fortunately, there is a higher-level API called the Virtual Instrument Software Architecture (VISA) that abstracts the different buses into a single unified API. VISA allows you to send SCPI commands to an instrument in an OS-independent, transport-independent way. In the case of LXI, VISA eases the communications between the Ethernet controller in a PC and an LXI instrument. Over Ethernet, VISA supports two different technologies for communications. One is a protocol called VXI-11 defined in 1995 by the VXIbus Consortium. This standard isn’t specific to VXI hardware. In fact, it’s become the de facto standard for all Ethernet-based instrumentation. It supports concepts familiar to users of GPIB such as the capability for instruments to request service and for computers to interrupt a measurement in progress. The LXI 1.0 and 1.1 standards required that LXI instruments implement basic VXI-11 capabilities for instrument identification. This will be changed in future versions of the LXI standard. The other network protocol supported by VISA is a raw TCP/IP socket, which you can use with instruments that do not fully implement VXI-11. Some instrument designers forgo the complexities of VXI-11 and only implement a simple network port through which you can send commands and receive responses. This usually means that those instruments do not implement an asynchronous notification mechanism such as service requests. VISA also can communicate over other buses. The common implementations of VISA know how to talk to instruments over GPIB, RS-232, USB, PCI/PXI, and VME/VXI. With VISA, you can concentrate on writes and reads without worrying about RPCs, serial I/O, or lower-level bus technologies. Further, VISA isolates the user software from the instrument bus so users can easily combine LXI instruments with GPIB, serial, or USB instruments in hybrid systems with little effort. As for commercial VISA implementations, the two most popular are NI-VISA from National Instruments and Agilent VISA. NI-VISA is available as a separate product and included with the company’s instrument control hardware such as GPIB controllers and various software development environments. Agilent VISA comes as part of the Agilent IO Libraries Suite, available as a separate product, and with the company’s hardware products. Neither implementation is free. You must either purchase a license for it or use one of the companies’ other products to be properly licensed. Suppliers of other application development environments (ADEs) sometimes assume you have a VISA that comes with the instruments you own. IVI Abstracts Instrument Classes Besides installing an instrument-specific IVI driver, you also must load a set of IVI Shared Components. Because there are some key components to all implementations, the IVI Foundation created these shared components to make it easier for users when they combine drivers and software from multiple vendors. The components provide services to drivers and clients that need to be common such as the administration of system-wide configuration. They generally are installed with the development environment or as part of an instrument driver’s installation procedure. If not, they can be downloaded separately from the IVI Foundation website. When speaking of shared components, you’ll sometimes see a reference to the IVI Configuration Store, which is accessed only through the IVI Configuration Server, one of the shared components. The Configuration Store publishes the list of instruments supported by a particular driver. In addition, an end user can create an alias for an IVI device through utilities such as NI’s Measurement & Automation Explorer (MAX), which will write this information to the Configuration Store. The average user doesn’t interact with the Configuration Store directly but only through installers and higher-level configuration utilities. Accessing Advanced Features With IviLxiSync, you can configure an instrument to participate in IEEE 1588 time synchronization through a Web page and have the data automatically timestamped, or you also can set up LAN and Wired Trigger Bus triggers through normal SCPI commands. The purpose of the IviLxiSync API is to make that job easier. However, because each vendor supplies its own IviLxiSync API with its instrument drivers, you have to use a different library for each instrument. How users approach LXI instrument drivers varies widely. Some are very happy to have prewritten drop-in drivers they can use right away for system development without worrying how they are implemented. Other users want to look inside to see how the driver is implemented and be able to debug and optimize the driver to meet their needs. As a result, the availability of source code in a language they’re familiar with for their instrument drivers can be important. Some users feel that drivers without source code can be problematic—they must rely on the driver vendor for explanations, bug fixes, or updates. Sometimes instrument vendors contract driver work to third parties, making it even more difficult to get good support. On the other hand, drivers that ship with source code native to their development environment are easily understandable by end users. For instance, engineers familiar with C can dig into IVI-C drivers. NI’s LabWindows/CVI is a popular tool for C driver development. LabVIEW is another application development environment that enables end users to work with driver source code directly. The Final Step: Discovery
The LXI Consortium has defined an improved mechanism for instrument discovery and identification in the recent LXI 1.2 standard.1 These updates will be implemented in the discovery tools that instrument vendors offer. System setup is complete, and the ADE knows which instruments are on the network. Now you can move on to the actual program development. Reference About the Authors
FOR MORE INFORMATION
View Past Archived Articles
Class C Can Be Quick and Easy
By Bill Yonkers and Stephen Kugler,
Kepco The LXI protocol offers a multitude of interfaces for communications with test equipment, including LAN Web pages, VISA sockets, and VISA VXI-11 interfaces. Converting an existing serial instrument to an LXI Class C device can be done quickly and economically using an off-the-shelf Ethernet-to-serial converter. Choosing the Converter Although most available converters share the same space for code and data buffers, some do have separate areas for those two items. An evaluation of the requirements showed that an LXI Class C device needs a minimum of 24 kB of buffer space to support the required ports. Kepco designed LXI devices by modifying off-the-shelf converters manufactured by Lantronix and Netburner. Our development cycle time was less than one man-year, and we used a subcontractor for the IVI driver. Our LXI devices have at least 256 kB of space allocated for the program code. With both the Lantronix and Netburner converters, we used 130 kB for the application with almost 70 kB of the space allocated to Web pages. Ethernet Basics
An instrumentation engineer usually has worked with GPIB and is accustomed to having unlimited connections to a device. However, the connections to an LXI device are limited because each one requires dedicated memory for its send and receive buffers. If an LXI device has insufficient connections, program debug becomes complicated. At least four connections are needed to improve the first-time experience designing and debugging an LXI product. Another feature helpful during user integration is the Telnet port. While not required by the specification, it provides a way to send commands to a device and get responses, like the features found in the National Instruments Measurement & Automation Explorer and the Agilent Technologies Connection Expert. Converter Modifications Let’s take a look at implementation details of each of these requirements.
LAN LED
If the converter supports AutoIP, then it accommodates duplicate IP detection as well. When an LXI device detects a duplicate IP, it must stop using that IP address. However, if the address in use was selected using AutoIP, device operation over the LAN can continue using a different IP address. Otherwise the LAN LED must be turned off and remain off until either the power is cycled or the LAN Reset is activated.
LAN Reset
Duplicate IP Detection
ARP packets have a content that Wikipedia defines as, “On Ethernet networks, these packets use an EtherType of 0x0806 and are sent to the broadcast MAC address of FF:FF:FF:FF:FF:FF. Note that the packet structure shown in Table 1 has SHA, SPA, THA, and TPA as 32-bit words but this is just for convenience—their actual lengths are determined by the hardware and protocol length fields.”
AutoIP Support
An LXI device can use the ARP logic to ask another device to send its IP address. This is done using a special ARP packet called a Null Probe.
The Null Probe is used to ensure that either a static IP address, an address provided by the DHCP server in the system, or an AutoIP address is not already in use on the network. The Null Probe contains the sender’s media access control (MAC) address, a 0 for the sender’s protocol address, the target’s hardware address, and the IP address being verified as the target protocol address.
ARP packets are broadcast to all devices on the network. If the target protocol address matches the device’s IP address, the target responds with an ARP packet to the sender.
Broadcast messages sometimes are lost in large networks, but this can be overcome by sending the Null Probe packet multiple times. This code snippet shows the Null Probe packet is sent three times with different delays and the duplicate address flag is tested:
The transmission of three packets is a standard method as defined in RFC 3927. This time-delayed multiple transmission process provides adequate assurance that the packet will be received by all devices in the network. There are multiple attempts to detect the duplicate address, but if the address is duplicated, the routine exits to reduce network traffic.
AutoIP
Not all converters support AutoIP, but you can implement it by trying an address, detecting if it’s in use, and if so, looping until a free IP address is found. AutoIP uses a specific address range from 169.254.000.000 through 169.254.254.254.
We recommend that AutoIP be done using a pseudorandom number generator and that the numbers be seeded using a MAC address. In this way, each device has a unique series of addresses that will be probed.
This method has been proven in networks of 1,800 devices; the number of attempts any device incurs is three to find a valid address. This yields a 30-s time period for all 1,800 units if they powered up at the same time.
Implementing the VXI-11 Protocol The VXI-11 protocol mimics the IEEE 488.2 interface using Ethernet to make the connection between the host and the device. It has some advantages over a socket interface because it provides the capability to support an interrupt request such as the SRQ line of the GPIB interface and single-byte commands like Selected Device Clear.
The VXI-11 protocol is based on the standard for RPCs developed in the 1970s. The RPC relies on a tool called RPCGEN that creates all the code needed to implement this functionality in an LXI device. When working with a small embedded-processor instrument, this tool generates more code than is required to meet the LXI requirements.
Implementing VXI-11 LXI Discovery The LXI specification states, “The VXI-11 protocol shall be supported by all LXI devices for discovery purposes. Discovery shall be accomplished by issuing a broadcast RPC on the host’s subnet. The broadcast RPC shall be to either the portmapper itself on Port 111 (querying for VXI-11 support) or the Null procedure (procedure 0) on the Program Number assigned to the VXI-11 Core Service (0x0607AF).”
The first part of this requirement is creating the portmapper process for a broadcast packet to Port 111. The response to a broadcast command is either the port address or no response at all. This makes the code easy because the packet returned is a constant, and a response is only required if the program number is 0x0607AF. The second part of the portmapper is supporting a standard RPC to the Null procedure. When a Null procedure is received, the device should indicate that the port is supported by the device.
To complete successfully, the discovery process needs five VXI-11 commands: create_link, destroy link, device write, device read, and do_cmd. This functionality is provided in the VXI-11 discovery code available in documents archived by the LXI Consortium’s LAN and Web groups.
This code offers only minimal functionality for discovery. Without modification, it allows a device to be discovered, but it does not provide a properly formatted *IDN? response. The response to the *IDN? query should be in the IEEE 488.2 format, which is defined as a string consisting of four comma-separated fields with a line feed 0x0a at the end of the data.
The first field is the manufacturer name, the second field is the device’s model number, the third field is the device’s serial number, and the fourth field is the revision level. The fields themselves must not contain any commas, which instead are used by the recommended discovery tool available at the LXI website. This tool parses the response and provides the information in a columnar table.
Creating an IVI Driver
The IVI driver specified by its class has common function names. This standardization on functions across instrument classes reduces integration time for users of LXI devices and provides common functionality among vendors of LXI devices.
For the manufacturer of an LXI device, the creation of an IVI class-compliant driver might appear to be very difficult. However, if supplied in the IVI-COM format, the driver works in LabVIEW, Agilent VEE Pro, MATLAB, Measure Foundry, Visual Basic, and all C environments, multiplying the return on investment.
Looking at the list of LXI instruments on the IVI Foundation website, almost all provide an IVI-COM driver. A COM driver is not modifiable by the user and gives the instrument vendor control to prevent unintentional changes in the driver. For customers who want to work on the driver or use it in the Linux or other operating systems, the C source code of the COM driver, if available, allows users to work with the driver and make modifications.
When developing the driver, time is divided into three tasks: creating the driver, testing it, and documenting it. Each task takes about the same time, and driver testing is the most difficult.
Start thinking about driver development early in the design phase to be sure that any functionality required by the driver is incorporated in the basic instrument. For instance, driver development for our KLP power supplies revealed that a function called Trigger Immediate needed to be added to the basic instrument. It turned out that this function provided a way to debug trigger code quickly and easily, and we have added it to all our products.
When developing an IVI driver, be aware of available helpful tools such as National Instruments’ LabWindows/CVI as well as those from Vektrex and Pacific Mindworks. A check with LXI Consortium members shows that the overwhelming choice for outside help in driver development is Pacific Mindworks.
Finally, the LXI specification for Class C requires two Web pages, which must be in valid HTML as defined by the w3c.org validator. When writing the HTML, use cascading style sheets (CSS) styles instead of embedding the formatting. This reduces code size and makes it much easier to change the look of the pages during the design phase.
Conclusion We recommend that anyone starting to develop their first LXI instrument join the LXI Consortium, in particular the Technical Committee and the LAN, Web, and Compliance working groups. In these groups, you can gain access to an extensive knowledge base as well as the annotated LXI specification. This annotated specification provides observations on how the specification was created and why some of the implementation requirements were included. We found it extremely useful during product development.
Further, during Kepco’s design process, the capability to test ideas and get feedback at the LXI group meetings and LXI Consortium PlugFests was invaluable in completing the development in a timely manner. Our company joined the Technical Committee and the LAN and Web working groups. The document archives maintained by the consortium and the ability to question members on specific aspects of the design moved us quickly toward successful completion and should prove equally helpful to other designers implementing LXI for the first time.
PlugFest Offers More Than Conformance Testing
By Paul G. Schreier, Editor
Going by the name alone, you might think that an LXI PlugFest is a meeting aimed at helping manufacturers get LXI instruments certified for conformance to the specification and added to the list of approved instruments. The October meeting in Munich, hosted by Rohde & Schwarz at its Training Center, shows that a PlugFest is only partially about instrument testing.
A variety of meetings provided a great deal of information about the current state of the LXI spec, user tips and tricks, and what to look for in the future. With approximately 50 attendees, mostly consortium members from Europe and North America, this was a gathering of the LXI elite.
A visit to a subsequent PlugFest would be well worth the time if you are thinking about introducing an LXI instrument or deploying an LXI system or have questions about existing systems. The attendees are all very knowledgeable about LXI and more than happy to share their expertise in this open, friendly environment.
If this summary has attracted your interest, the next PlugFest will be held Feb. 11-13 in Anaheim, CA. Best of all, there is no attendance charge. For anyone serious about working with LXI, this is an opportunity that should not be missed. Details are available on the LXI Consortium website.1
A PlugFest typically is three days long, and participation in the first half is limited to members of the LXI Consortium. During this time, compliance testing takes place, and the technical committees meet to review progress and make plans for improvements to the spec. This time, they also voted to approve Version 1.2 of the specification. See the article about Revision 1.2 in this issue for details.
The second half of the meeting kicked off with a series of tutorials to help developers and users get the most out of their LXI systems. The last day included a series of application talks that illustrated how extensively LXI is being adopted.
One consortium officer remarked on how the flavor of an LXI PlugFest has changed. Just a year ago there were few products in use while at this one there were quite a few applications for vendors to report. Until this meeting, the only authorized testing lab was run by Wheelwright Enterprises.2 Lynn Wheelwright, the owner and a 35-year veteran of Hewlett-Packard and Agilent Technologies, also provides consulting services for companies developing LXI instruments. For the moment, he only tests Class C devices shipped to his facility in Santa Rosa, CA, although he was performing Class A and B testing at the PlugFest.
To give European companies a similar resource, the consortium announced that a second test lab had been approved: the German Hardware Test Center (GHTC), the internal compliance and reliability test lab of Agilent in Böblingen, Germany. Again, this is only for Class C devices although Jochen Schmidt and Marcus Flach, the two engineers responsible for LXI testing, hope to add Class B testing capabilities soon.
Although the GHTC focuses on instruments from Agilent, the services also are available to outside companies. This lab operates independently from the Agilent business unit, offers experience testing non-Agilent devices, and has strict quality and confidentiality processes. In particular, the GHTC has been accredited according to ISO/IEC 17025 by DATech, the German accreditation body for technology.
When companies are preparing new LXI instruments, they also should be aware of the software developed by Mr. Wheelwright that is used during conformance tests. Consisting of a .net application and some PERL scripts, the Compliance Testing Suite steps through a tree structure to test key aspects of conformance to the spec, gives some corrective suggestions if errors arise, and creates the necessary documentation for final signoffs.
Best of all, this same software is a free download to members only on the LXI Consortium website. That way developers can check their new instruments on the same certification software at their own sites and have a good idea of what to expect when they submit the instrument for approvals.
Along these lines, manufacturers should note that obtaining certification is just one reason to attend a PlugFest. Another is to see how well a product in progress performs and get guidance on where to focus further engineering efforts. Or, when a product is almost complete, most of the compliance testing can take place at the PlugFest, and the remaining details then can be completed at the vendor’s facility.
In all, four companies submitted products for review: Data Translation, GOEPEL electronic, Agilent, and Rohde & Schwarz. Of these, Data Translation and GOEPEL presented their first LXI products.
At the conclusion of the PlugFest, the consortium announced that two products had been certified. However, the specifics were not disclosed, per consortium policy, because some companies might have a later official launch planned. We did learn that Data Translation was getting advice on the development of an LXI thermocouple box and that Rohde & Schwarz received conformance for its Model AMU 200A Arbitrary Waveform Generator. Next on the agenda was Bill Yonkers from Kepco, who addressed key points for developing LXI instruments. His presentation had a very interesting perspective because Kepco did all the development in-house for a series of Class C power supplies. He noted that the company had no previous experience with networks or HTML. Even so, the project took only 10 man-months; of that, only two man-months were spent on testing.
Mr. Yonkers shared a number of areas in which he had some difficulty or confusion and his experiences in IVI driver development, where testing was half of the effort. The first-time developer suggested several items that can speed up progress. He also recommended joining working groups to gather and swap information and getting a copy of the annotated specification with more details and rationales on several aspects of the standard.
As Mr. Yonkers said, “It’s not scary, it’s not very hard, and it’s straightforward. Just make sure your microprocessor has plenty of RAM so you can open all the necessary ports.”
Mr. Eidson related some information he learned while attending the recent IEEE 1588 meeting in Vienna. Among the most exciting bits of news was the announcement of new silicon from National Semiconductor that will make it much cheaper and easier for LXI instruments to incorporate Class B capabilities.
With Class B synchronization, one instrument can establish itself as the grandmaster, and all system measurements can be made in reference to this clock with an accuracy of just a few nanoseconds. To do so, the key is keeping the accuracy of timestamps associated with events.
Until now, the preferred approach was to design an FPGA that acted like a packet detector/sniffer to pull out timing packets early in the stack; you want to generate the timestamps as far down the stack as possible for peak accuracy. Then the scheme attached the timestamp to the data after it had worked its way through the communications stack.
But, Mr. Eidson added, the days of doing this implementation with an FPGA are gone thanks to the DP83640 from National Semiconductor. This is the industry’s first Ethernet transceiver with integrated hardware support for IEEE 1588. It incorporates all the external logic that previously was needed for accurate clock timestamping into a PHY layer chip. This PHYTER transceiver synchronizes the distributed network nodes to a master clock with 8-ns accuracy.
The chip integrates hardware timestamping of receive and transmit packets, a high-accuracy 1588 clock, and 12 general-purpose I/O pins that handle simultaneous real-time events or multiple triggers. The device interfaces with any controller, FPGA, or ASIC that has an Ethernet MAC.
The announcement of this device certainly caught everyone’s interest, and it could lead to a rapid proliferation of Class B products. As Mr. Eidson said, “Implementing 1588 is now the easy part, especially with these new chips. Deciding how to use these clocks is where careful design is needed.”
He pointed to three general uses of synchronized clocks among instruments in a system: to timestamp data, generate events or triggers, and produce signals such as periodic triggers that are synchronized with the clock. The next company to review some of its applications was the German company LXinstruments, which designs custom racks of equipment, much of it LXI but with some legacy equipment running on the GPIB bus. The company discussed automobile antenna tuning with RF stimulus-response, GSM wireless testing for remote heating-energy management, and automotive quality-assurance applications. While the LXI spec mandates the delivery of IVI drivers, this company does not use them and instead works with VISA and directly with SCPI commands.
At this point, the attendees went to the certification room for a demonstration by Rohde & Schwarz on how to coordinate the activities of the Class A hardware Wired Trigger Bus with those of Class B IEEE 1588 LAN triggering. The company developed a Web interface in which users can configure the triggers to interact. Consortium members were quite appreciative of this work and curious about how they can incorporate such features into their systems.
Pickering Interfaces then discussed a number of switching applications. Because PXI forms the largest part of their sales today, the speaker was able to discuss some clear areas of differentiation between LXI and PXI.
PXI has advantages, the Pickering representative added, such as support for a large variety of functions in a small package. Also, for simple functions, LXI has high overhead because of the need to include an embedded controller. He illustrated these concepts with applications the company has implemented in an RF matrix, switching video inputs to a bank of displays for soak testing, and testing cables in an airframe.
Xantrex then reviewed a programmable power-supply controller for spacecraft environmental testing. Much of this work has been described in a previous article in LXI ConneXion.3
The final applications presentation came from Agilent, one that focused on the use of LXI when running Linux. This is a particularly interesting issue because the IVI-C and IVI-COM drivers mandated by the LXI standard are designed for Windows and do not work under Linux. An alternative is to work directly with SCPI commands. Further, LXI instruments can be controlled either through the VXI-11 protocol based on RPC or direct TCP socket communications. This talk covered some of the issues involved in working with each of these.
Mr. Franklin concluded by saying that LXI is reaching a turning point. The consortium has been working hard on usability, ease of use, and interoperability. Now the members want to further their work in getting devices to recognize each other automatically and learn about each other—without user intervention.
LXI already is quite advanced, but by no means is it standing still. The consortium will continue to leverage the latest technological advances and work to make the process of setting up and programming a test system easier than it has ever been before. Meanwhile, you can get even more information about some of the key happenings at the PlugFest by watching a series of podcasts that were made there as well as examining the slides from public sessions.1
About the Author
By Nick Barendt, VXI Technologies
Since the initial version of the LXI specification was released in 2005, the Technical Committee of the LXI Consortium and its constituent working groups have been improving and refining the standard. Revison 1.2 (LXI 1.2) is their latest effort. It includes a number of upgrades in functionality and clarifications to improve interoperability.
• Discovery of the addresses of all instruments on the bus.
• Identification to obtain information such as manufacturer, model, serial number, and version for each instrument.
To perform these two tasks, the LXI Consortium chose VXI-11 for the 1.0 standard because it fulfilled the goal of leveraging existing technologies as much as possible. VXI-11 already was supported as part of VISA, and most VISA libraries provided at least rudimentary utilities for discovering VXI-11 instruments. LXI 1.0 used the SCPI command *IDN? through a VXI-11 connection to each instrument, and each one responded with a 4-tuple of information: manufacturer, model, serial number, and revision.
However, there are several shortcomings with VXI-11. So even before LXI 1.0 was ratified, the technical working group was discussing alternative protocols.
From an instrument-implementation perspective, the open network computing remote procedure call (ONC-RPC) protocol on which VXI-11 was built presented some difficulties for certain instrument platforms, particularly for applications constrained in resources such as CPU and memory.
From a user-perspective, there were three primary issues to overcome with a VXI-11 replacement:
• Locked devices generally are unidentifiable, effectively disappearing from the network.
• There is no straightforward mechanism to discover instruments attached to VXI-11 bridges for other instruments’ buses such as GPIB, VXI, or PXI.
• VXI-11 is relatively slow. Discovery can be fast, but identification by connecting to each instrument, issuing a *RST command, and querying and parsing results can be time-consuming, especially with a large collection of LAN instruments.
As replacements for VXI-11, the technical working group chose two different but complementary technologies: one for identification and one for discovery. Generally, additional information would be useful to users and applications, such as a list of connected instruments and description of the network configuration. In the end, the goals for a new identification mechanism were the following:
• Provide more information than in the *IDN? response.
• Support bridges and other devices that allow multiple instruments on a single IP address.
• Minimize instrument implementation and overhead.
• Support extensibility so vendors can add custom information.
The technical working group considered several solutions. The most promising was based on an analogous operation: How would a human gather the required information from an LXI instrument?
Given the IP address/hostname of an LXI instrument, one common way to determine the instrument’s identity is to open the instrument’s Web page in a browser. Any compliant device presents a table of information on the Welcome page as required by the LXI standard (Figure 1).
But while that Web page is easy for a human operator to read and interpret, it generally is difficult for a software application to locate salient data amid the HTML and Javascript. As a result, LXI 1.2 adds a requirement for a new Web interface that returns detailed identification information in an easy-to-parse eXtensible Markup Language (XML) document. (To view code please click here.)
Because XML is so extensible and flexible, the working group was concerned that vendors would develop identification documents with a variety of formats and contents, again making it difficult for users and applications to find the desired information. Clearly, a template or format of some form is required—a schema. This adds another requirement: It is insufficient for a document to be just well-formed XML. It also must conform to the schema to be valid.
After considering several XML schema languages, the technical working group chose the World Wide Web Consortium’s XML Schema language, which results in an XML Schema Definition (XSD). The LXI Consortium has published such a schema for LXI 1.2.1
Accessing an LXI instrument’s identification document is as easy as opening a Web page. To construct the URL given an IP address or hostname, simply concatenate the string http://<address> with /lxi/identification. For an instrument at 192.168.1.10, that document can be retrieved from http://192.168.1.10/lxi/identification.
As part of LXI 1.2, all URL paths beginning with /lxi are reserved for use by the LXI Consortium. /lxi/identification will likely be the first of several URL paths defined by the consortium for programmatic use as opposed to URLs that typically would be used directly by a Web browser.
The LXI Identification Document, as constrained by the XSD Schema, provides basic instrument information plus LXI-specific information such as LXI Class A, B, or C and LXI standard revision. The document also can offer additional hints to applications and utilities such as the IVI software module name or the page on the manufacturer’s website where the latest software drivers can be downloaded.
Device manufacturers are free to add their own proprietary data in a carefully demarcated section of the Identification Document, an XML element called Extension. For instance, a data-acquisition instrument could include information on the expiration date of the current calibration or information about the last calibration such as date and serial numbers of equipment used during the calibration.
To accommodate bridges and other devices that support multiple instruments at a single IP address such as a two-channel DMM, the Identification Document may optionally list ConnectedDevices. This section consists of a list of base URLs for the connected devices that the LXI instrument hosts on the network. Client applications can append the same lxi/identification URL path onto the end of the base URL and query that URL for the identification information for each ConnectedDevice. (To view code please click here.)
The identification documents for connected devices must conform to the LXI Identification Schema as well, but vendors are permitted to derive a new schema for connected devices. This allows vendors to extend the XML document and add information as needed.
For example, an LXI bridge device, such as the VXI Technology EX2500 Gigabit VXI Slot-0 Module, might use a derived schema specific to VXI bus devices and return identification documents conforming to the schema for each VXI module present. For VXI devices, the Schema and Identification Document would likely include a logical address and possibly the values of a few required A16 registers that client applications may find useful.
Ideally, the process of getting all the IP addresses should proceed quickly. Just as importantly, though, the discovery operation should not generate so much traffic on the network that it becomes a burden.
A number of technologies exist for discovery including UPnP, Bonjour, and an LXI proprietary scheme. The technical working group investigated several options before settling on multicast domain name service (mDNS) and DNS service discovery (DNS-SD).
The combination of mDNS and DNS-SD is alternatively known as Zero Configuration networking (Zeroconf)2,3, and Apple’s variation is called Bonjour. The LXI standard already requires support for another Zeroconf technology: Auto-IP, also known as Dynamic Configuration of IPv4 Link-Local Addresses, which is used by devices to choose a unique address in the 169.254.0.0/16 subnet on a LAN when no dynamic host configuration protocol (DHCP) server is found.
Zeroconf technology has been incorporated into a wide variety of network devices. For example, nearly all network printers now support mDNS/DNS-SD, making the task of discovering and configuring them almost trivial. Some operating systems, such as Apple’s OS X, have built-in support for these technologies while other OSs, such as Microsoft Windows XP and Vista, require some additional software.
On the instrument side, it is very straightforward to add support for mDNS and DNS-SD to most of the embedded operating systems commonly used on LXI products. In many cases, free and open-source options are available.
First, a query is performed against the centrally maintained name servers for google.com to determine which name server is responsible for the google.com domain. Then an additional query is made to look up the IP address of the www host within that domain. With this IP address in hand, the Web browser can open up a TCP/IP connection to www.google.com.
The DNS system works amazingly well, but for smaller or ad hoc networks like those often seen in test and measurement networks, the administrative overhead and complexity of configuring and managing a DNS server are hard to justify. This is where mDNS comes into play.4 It makes a few modifications to the traditional unicast DNS model.
As its name implies, mDNS takes advantage of multicast, a network transport that allows all interested network devices to receive and monitor particular types of messages on the LAN. Like broadcast, multicast traffic typically is limited to just a LAN and possibly just a portion of that LAN, depending on how the LAN infrastructure is configured. Broadcast messages are received by all LAN devices; multicast messages are received only by all devices participating in the multicast set.
mDNS essentially provides the same services as traditional unicast DNS. However, instead of querying a centralized database on the Internet, queries are directed to a multicast address and port number on the LAN, allowing any network device with pertinent information to respond.
In a similar manner to how network devices select nonconflicting addresses using Auto-IP, devices supporting mDNS choose a unique hostname in the .local domain—.local being equivalent to the google.com in the www.google.com example.
Unlike the Auto-IP case where any random IP address in 169.254.0.0/16 is as good as any other, you would prefer that a particular device reserve a hostname with some mnemonic value. So, a DMM that supports mDNS might choose a hostname such as dmm.local.
If two devices attempt to reserve the same hostname, the mDNS standards provide procedures for resolving the conflict, with each device acquiring a unique hostname. One DMM would likely get the desired dmm.local while the other DMM would get a numeral appended such as dmm-1.local.
What can you do with these mDNS hostnames? With OS support, the mDNS hostname can be used anywhere you might use an IP address or unicast DNS hostname. As a result, a Web browser could contact the DMM with a URL such as http://dmm.local.
When a Web browser attempts to access the http server at dmm.local, an mDNS lookup for dmm.local is performed. This multicast message to all mDNS servers on the network asks if anyone knows the IP address of dmm.local. The DMM itself, which contains an mDNS server, would send a reply like dmm.local’s IP address is 10.1.3.57, permitting the Web browser to open up a connection to the DMM’s Web browser.
Given the multicast nature of this communication, all mDNS servers on the network such as laptops, desktops, and other instruments see the query/response and can update their local caches with this information. When another device on the LAN needs to communicate with dmm.local, it likely already knows the IP address and can open the connection without performing a network query.
Such cache records have limited lifetimes, controlled via time-to-live (TTL) fields that keep the caches from filling up with stale data. Additionally, if no answer is received to the query, all mDNS servers observe that and remove dmm.local from their caches. While the support provided by DNS and mDNS for resolving a hostname to an IP address is useful, it does not really assist with telling network devices what services a particular host is offering. For instance, most networked printers support multiple network protocols for sending jobs to be printed as well as a Web server for configuring the printer and checking status.
For a service advertisement, DNS-SD uses a DNS record type known as a service (SRV) record. While SRV records can be used with traditional unicast DNS, they find wider use with mDNS.
SRV records allow a networked device to advertise services along with the hostname and port number where the service can be contacted. So a DMM that supports a Web browser might advertise an SRV record that contains a hostname of dmm.local and a port number of 80.
Just as importantly, though, the SRV record includes a service name. Much like the way hostnames are built on domain names, SRV service names are built on an analogous hierarchical domain.
A Web server running on a DMM might have a service name of ACME DMM._http._tcp, with the particular service name of ACME DMM in the _http._tcp service domain, because the Web server supports the http protocol over the TCP/IP transport layer protocol. The underscore characters before http and tcp in this example are required for SRV records and there to disambiguate service names from hostnames, which cannot contain underscores.
Unlike hostnames, which must be short and use a limited set of characters, service names can be long and can use any unicode transformation format (UTF-8) characters including spaces and punctuation. Service names typically are not typed in by users but rather selected from a drop-down menu or similar selection component, encouraging long and descriptive names to be used. Just as with .local hostnames, there are conflict resolution procedures to guarantee that each service name is unique.
LXI 1.2 requires two services to be advertised: http because all LXI devices contain a Web server and lxi, a new, LXI-specific service.
The new lxi element advertises LXI services on the LAN, beginning with the new identification document. This specialized Web service could likely have additional capabilities added in future versions of the LXI standard.
For now, though, it is sufficient to detect LXI Identification Services. A client application then might do an mDNS query for all _lxi._tcp services on the LAN for discovery and perform a normal http query to retrieve the identification document from each.
In many cases, an additional related record known as a text (TXT) also will be of use in discovery and identification. Each SRV record must have an associated TXT record that allows information about a service beyond just the port number to be advertised, encoding information in key/value pairs, formatted as key=value.
For the _lxi._tcp service, LXI 1.2 requires four key/value pairs of interest: Manufacturer, Model, SerialNumber, and FirmwareVersion. These correspond exactly to the response to the IEEE 488.2 *IDN? query. This allows you to retrieve a bare minimum of useful identification information during the discovery operation. The identification document can be queried for further details when needed.
With mDNS and DNS-SD, when a device is first connected to a network or is powered on, it sends messages advertising its services. Because all mDNS servers receive these messages including controller PCs running mDNS software, client applications always have an up-to-date list of services available on the LAN. The more traditional operation of clicking a discover button and waiting 10 seconds for all devices to respond before displaying a list of all devices is replaced with a continuously updated list of all active services.
While devices can send updated advertisements when being shut down to notify clients they are going away, it is unusual for instruments or most embedded devices to enjoy such orderly shutdown operations. Often, power is just unceremoniously removed.
How is a client informed that a device and its services are no longer available? For this, mDNS/DNS-SD offers a few mechanisms. First, all records include a TTL field that tells recipients how long the record should remain in their caches before it should be removed and forgotten. Services eventually disappear as their SRV and TXT records age and the device is no longer available to send out replacement records. Additionally, due to the multicast nature of mDNS, as soon as one client fails in an attempt to contact an advertised service, all mDNS servers observe that fact and remove the associated records from their caches.
The effort needed to add support for the new identification mechanism to an LXI instrument is small. LXI 1.2 still requires VXI-11 support, so all instruments, regardless of LXI version, can be discovered via VXI-11, but LXI 1.2 instruments also will respond to the new identification mechanism.
Because the new LXI 1.2 identification mechanism is innocuous, it can be safely performed on pre-LXI 1.2 instruments. Accordingly, software utilities can perform a VXI-11 discovery operation and then attempt to use the LXI 1.2 identification mechanism on all discovered instruments. LXI 1.2 instruments will properly respond, and pre-LXI 1.2 instruments will return an error, after which the software utility can fall back to using the VXI-11 identification mechanism on them.
LXI 1.2 includes mDNS and DNS-SD as future rules and recommendations. A later version of the LXI standard will require instruments to follow the rules regarding mDNS and DNS-SD support, but that requirement does not apply to instruments tested against 1.2 for conformance.
Vendors are encouraged, however, to treat the future rules as recommendations for LXI 1.2 devices. This use of future rules is intended to minimize the short-term impact of adding requirements on new instruments but make the LXI Consortium’s technical direction clear.
When the next version of the LXI standard is released, future will be dropped, making those rules required on all compliant instruments although many LXI 1.2 instruments are expected to offer support for those rules. This includes the mDNS and DNS-SD. Software utilities can begin to use both the new discovery and identification mechanisms. 2. Steinberg, D. and Cheshire, S., Zero Configuration Networking: The Definitive Guide, O’Reilly Media, 2006.
3. Zeroconf, www.zeroconf.org/
4. Multicast DNS, www.multicastdns.org
5. DNS Service Discovery, www.dns-sd.org/
By Tim Ludy, Data Translation
Because LXI physical connections are so simple, creating an instrument setup and programming it are easy and quick. To illustrate the point, this step-by-step example describes how to configure multiple instruments on a private LAN using a commercial PC and a router. The recommended router utilizes the dynamic host configuration protocol (DHCP), which automatically assigns an IP address for an instrument. Most new routers come with this DHCP server capability.
This example uses two instruments from Agilent Technologies: a Model 33220A Function Generator and a Model MSO6014A Oscilloscope. Beginning with a running PC and router equipped with DHCP, follow these steps to configure each LXI instrument: Now design the desired application, which consists of this simple task: Configure the LXI function generator to output a 1,000-Hz sine wave. Make a physical connection between the function generator’s output and the input of the LXI oscilloscope. Then configure the function generator to create the signal and set up the scope to acquire and send it to the PC for display and analysis.
As written, the sine wave output program for the function generator and the scope-input program accept GPIB and USB addresses but not a LAN address. For that reason, the first thing to do is change the programs so they also accept an IP address. Do so by adding an I/O type and a corresponding text box (Figure 1).
The following code snippets show how to modify the program to access a LAN address.
Original Code ' Open the I/O session with the driver Modified Code
' Open the I/O session with the driver
This example now instructs the function generator to output an arbitrary waveform.
When the program finishes running, a new dialog box appears (Figure 2). At this time, the signal is being displayed on the oscilloscope.
The next step is to modify the second example program to address the scope, capture the signal over the hardwired connection between the two instruments, and read it in on the PC. Then, tie the two examples together to create the finished application. On the property page, enter the instrument’s IP address. Or, if you set up an alias name for it, choose the alias from the list to make connection to the device. Click Connect and then click OK to open a connection to the instrument.
A socket connection is required for each device being accessed. Next double-click the Function Generator component you dragged to the form to open its property page. If the device driver has been installed, select it from the available drivers in the pull-down menu (Figure 4). This associates the Function Generator component with the socket connection. The socket and device objects combine to provide the easiest access to standard LXI instruments.
You also want to access the scope, so drag and drop another Instrument Socket component and an IVI Oscilloscope component onto the form. Configure the second Instrument Socket to connect to the scope. Double-click the IVI Oscilloscope component to open its property pages, and then click Next to access additional properties.
The oscilloscope driver publishes many measurements that can be very useful to include in an application. In this case, select the Waveform and Frequency channels for the component to publish as data channels to the rest of the application (Figure 5).
In the application, you also want to start/stop the function generator’s waveform output and display the waveform from the hardware oscilloscope. For these purposes, add a Control Button and an Oscilloscope display component from the Foundry as shown in Figure 6.
To make the application even more useful, next add control components for the waveform type and frequency setting as well as a display component that reads the frequency measurement from the oscilloscope (Figure 7).
The Windows application controls the amplitude and signal type that is output from the function generator. It also captures the signal back from the oscilloscope and displays both the waveform and the frequency-measurement data.
Utilizing the standards that exist today and eliminating the complex nature of traditional programming, this new breed of test-and-measurement development tools allows the engineer to build complete applications faster and make them easier to maintain. Test engineers now can focus on what needs to be tested and what results they require rather than how to do it.
References
|
|||||||||||||||||||||||