|
|||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||
|
|
T&M Main | Archives | Feedback
Prototyping Test Systems in Software Using IVI Simulation
In a previous article entitled Tune Up Your Test System With IVI Drivers we discussed the Interchangeable Virtual Instruments initiative and described its benefits. Now, let's turn our attention to IVI simulation, a feature that's beneficial not only during product development, but when a system is in full production. By Dany Cheij, IVI Product Manager, National Instruments, Austin, TX. (512) 683-5286, or e-mail: dany.cheij@ni.com.
One of the features that the Interchangeable Virtual Instrument (IVI) specification requires is simulation. At a minimum, IVI instrument drivers should be able to simulate the presence of the instrument in a system, and return basic measurement data when required. The specific implementation and any additional simulation features are left up to you to decide. Simply put, simulation is the ability to use an instrument driver when hardware isn't present in a system. When an instrument initialization function is called, conventional instrument drivers send the required commands to the instrument and wait for a response from that instrument. If the initialization succeeds, the driver returns an instrument software handle that the developer can use in subsequent instrument driver calls to identify the current session. However, if the instrument isn't present, this initialization function will fail and return an invalid handle, making it impossible to call any other functions. IVI drivers correct for this by determining whether or not the user is operating in simulation mode. If so, the initialization function doesn't actually communicate to the instrument. Instead, it returns a valid instrument handle that can be used in subsequent calls to the driver. Simulation of Actual Data
The other aspect of IVI simulation is simulation of the actual data that an instrument returns. For the classes of instruments capable of making measurements, IVI instrument drivers are required to return data values (usually random) when measurement functions are called. You can add any other advanced simulation capabilities when you develop the driver (these don't have to be required by the Foundation).
This screen shot shows a typical feature-laden virtual oscilloscope. Since the IVI Foundation only requires a basic level of simulation, you have the flexibility of implementing additional simulation support into your system. For example, National Instruments' (NI) implementation includes the required basic simulation and adds some advanced simulation features. Two Layers
An IVI system's functionality is split into two different layers. An instrument-specific layer is designed to communicate with one particular instrument. A class layer is designed to provide a generic interface to any instrument within a specific class. National Instruments instrument-specific drivers, for example, permit a user to simulate the presence of an instrument by returning a valid instrument handle, and they return random data for measurement functions. NI also provides some class level simulation drivers that permit a user to do further simulation. These include: * Measurement Data: Instead of random data, class simulation drivers have the capability to return advanced waveforms and precise user defined values. These values can be specified using a class simulation setup panel. * VXI Plug and Play Functions: Through the class simulation setup panel, a user is able to specify the return values of self-test, error-query, and revision-query VXI Plug and Play functions. * Status Codes Simulation: A user is able to simulate the occurrence of errors by determining specific status codes to be returned when particular functions are called from within the driver. These capabilities provide a user with great simulation control. They also permit a user to fully test code response to error situations and erroneous measurement data. In the case of NI's instrument-specific drivers, they're provided in source code, so they can be modified to include some of these advanced simulation features. The Benefits of Simulation
Simulation provides several benefits. First, it gives a developer the ability to begin prototyping a test system in software prior to obtaining hardware. By acquiring the driver for an instrument, a developer can begin creating code prior to purchasing the hardware. This can provide valuable feedback regarding what functions the instrument supports, and which aspects of system design will have to be modified to accommodate the chosen hardware. Even after the system has been in place, simulation can provide a great avenue for developers to drop in new hardware, and gauge the amount of software changes, if any, are required. Second, simulation provides the ability to share one set of test hardware among a team of developers. That can decrease development time and cost. When a team of developers is working on a system, purchasing test hardware for everyone to develop code on can be cost-prohibitive. Programmers are often forced to share test hardware among themselves as well as with test engineers on the production floor. The inability to test code without the hardware can be very costly, in terms of wasted time. Simulation provides a mechanism to verify code, while waiting for the hardware to complete the testing. Non-Hardware Dependent
Finally, simulation can also be helpful in a non-hardware dependent way. Consider this scenario. Test developers will often build mechanisms and protections into their code to detect certain error conditions or instrument behavior. Sometimes it isn't possible to force the instrument to return a specific error code, or to fail on a particular function. With advanced features that can be built into the simulation infrastructure, you can simulate error situations and specify which functions should trigger those errors. By permitting multiple developers to share the same hardware, systems to be tested with new hardware-IVI instrument drivers can be used to prototype and verify test systems. That can speed up test development, and reduce development cost. To find out more, visit http://www.ni.com/ivi and http://www.ivifoundation.org.
|
||||||||||||||||||||||||||||||||||||
|
Copyright © 2003 ChipCenter-QuestLink About ChipCenter-Questlink |
|||||||||||||||||||||||||||||||||||||