Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Jan 8, 2010

Virtual Test: Using Simulation to Improve Design and Test

1 ratings | 2.00 out of 5
Print | PDF

Overview

This article describes how you can use NI LabVIEW and Multisim software to speed the definition of test applications. Through the acquisition of simulated circuit measurements in the LabVIEW environment, you can begin defining test setup earlier.

Simulated designs are available in advance of a physical prototype, so you can rapidly develop LabVIEW applications in parallel to the circuit design process.

The result is a faster approach to design and test.

Introduction

The PCB design flow is traditionally a serial process. A design transitions from concept to design to layout and, finally, to test and validation. This traditional serial process means each stage relies on the completion of the previous stage.


[+] Enlarge Image

Figure 1. Serial Design Flow

Once circuit research has been completed, a design can be transferred to a layout specialist. Likewise, the test engineer waits at the latter stages of the design flow to receive the completed PCB to begin test development. This may cause the following:

    • Inefficiencies in the design process (particularly with lost time)
    • Slower test application development, delaying the overall design flow
    • Multiple iterations of both the physical prototype and test application due to inefficient design practices

You can improve your design flow by using circuit simulation to help develop test applications in parallel to board layout. The idea is to reduce the latency inherent to the circuit design flow by having design and layout occur at the same time as test development. This means that a test engineer can be immediately ready to test a PCB when it is returned from a fabrication house.

This is possible with the circuit simulation of Multisim and the test application development of LabVIEW. 

Figure 2. The Proposed Parallel Design Flow

Now consider an example that uses Multisim and LabVIEW to introduce the concept of a virtual device under test (VDUT) and learn how you can speed test application development.

Multisim Circuit Simulation

Multisim is an advanced schematic capture and simulation environment that abstracts away the difficulties of traditional SPICE simulation with a highly graphical approach to analysis. Because of the ease of use of this mixed-mode simulation environment, you can, regardless of your experience level, capture a circuit diagram and simulate its performance. 

Learn more about Multisim»

Acquiring Simulation Data in LabVIEW

A unique feature of Multisim is its integration with LabVIEW. Multisim includes an Automation API, meaning any COM-aware programming language (such as LabVIEW, Visual Basic, and so on) can access simulated measurements and analyze them in a custom application.

Virtual Test

A Multisim circuit simulation is a virtual prototype of a design. Although it has not yet been physically prototyped, you can model the behavior of a physical prototype in a virtual simulation environment. With a variety of measurements (transient, frequency based, and so on), you can gain insight into how the circuit performs when finally developed.

The circuit model, an effective representation of the final prototype, can be used as a surrogate for developing test applications. This is called virtual test. By using Multisim simulation in this capacity, you have defined a VDUT. 

Because of the integration of Multisim and LabVIEW, you can develop a LabVIEW application to interrogate the simulated characteristics of a design. You can then use this exact same application to test and validate a physical prototype.



[+] Enlarge Image

Figure 3. Virtual Device Under Test 

Virtual Test with the VDUT

To use Multisim and LabVIEW for performing virtual test, follow these three steps:

Step 1: Use Multisim to define and simulate a circuit design. This virtual incarnation of a design can be developed by the design or test engineer.

Figure 4. Create a schematic and simulate in Multisim.

 

Step 2: Use LabVIEW connectivity to acquire simulated measurements from a Multisim schematic. The LabVIEW code you develop at this time analyzes the transient or frequency domain measurements of the Multisim "virtual prototype."


[+] Enlarge Image

Figure 5. Using Multisim as a VDUT with LabVIEW for Analysis

 

Step 3: Replace the LabVIEW connection to the Multisim simulation with a connection to a real prototype. You need some form of data acquisition or measurement device (GPIB, data acquisition card, PXI instrumentation, and so on) to acquire data from the real hardware. Use the exact same code from step 2 to analyze the real hardware.


[+] Enlarge Image

Figure 6. Testing Real Hardware with the Same LabVIEW Analysis

Advantages of a VDUT

With a VDUT, you can:

  • Begin test application development in parallel with circuit design and layout
  • Be ready to test as soon as a physical prototype is delivered
  • Iterate on the development of the test application in a risk-free platform powered by simulation
  • Experiment on corner cases and troubleshoot problems in the test application
  • Troubleshoot circuit performance sooner during the simulation stages and uncover problems that will impact design performance

The concept of the VDUT is simple: Save time by developing based on a virtual prototype before a physical prototype is even available.

How to Connect LabVIEW to Multisim with the LabVIEW Multisim Connectivity Toolkit 

With the LabVIEW Multisim Connectivity Toolkit, it is easy to develop a connection to a virtual prototype. This toolkit featuring more than 80 functions helps you use standard LabVIEW VIs to define an application that acquires measurements from simulation.

The LabVIEW Multisim Connectivity Toolkit is a wrapper for the previously mentioned Multisim Automation API.

  1. Download the LabVIEW Multisim Connectivity Toolkit from ni.com/labs (you need LabVIEW 8.6.x or LabVIEW 2009 to use the toolkit).
  2. Download a 30-day evaluation of Multisim.
  3. View the Introduction to Multisim Automation with LabVIEW article to learn more about the toolkit palette.

 

A simple LabVIEW application to connect and automate a Multisim AC analysis is described below. The code consists of eight basic elements:

  1. Connect to the Multisim Automation API (Multisim Connection palette).
  2. Open a Multisim file based on the "File Path In" data (File Management palette).
  3. Enumerate the various inputs and outputs in the circuit (I/O Configuration & Control palette).
  4. Perform an AC analysis (Simulation Control palette).
  5. Wait until the end of the AC analysis (Simulation Control palette).
  6. Obtain output data from the analysis (I/O Configuration & Control palette).
  7. Show simulation data.
  8. Close the connection to the Multisim Automation API (Multisim Connection palette).

 


[+] Enlarge Image

Figure 7. LabVIEW Code to Automate Multisim Simulation

How to Connect LabVIEW to Multisim with Multisim PXI Instruments

If you are not developing a unique test application but are using PXI instrumentation for validation, consider Multisim PXI instruments. With these time-saving, custom simulation-driven instruments, you can acquire both real and simulated measurements. The Multisim PXI instruments reside in Multisim.

You launch a PXI instrument from within Multisim. It is connected to a circuit the same way other simulation-driven instruments are. It is connected to a net of interest.

Figure 8. Simulation-Driven Instrument

During a transient simulation, the instrument (the oscilloscope shown in Figure 9) visualizes the behavior of the circuit. Beneath, you see both the input (Channel 1 – square wave) and output (Channel 2) plotted on the instrument axis.


[+] Enlarge Image

Figure 9. PXI Instrument for Multisim

During the simulation, the various properties of the instrument are set to view the simulated behavior, such as the scale (volts/division), vertical position, coupling, triggering, and timebase. You likely will reuse these settings based on simulation during physical prototype validation.

For this reason, notice that the PXI instruments have a "Device" drop-down box. With this dialog, you can acquire either simulated or real measurements. In this instance, you can connect to an NI PXI-5122 oscilloscope/digitizer.

Figure 10. Device Selection in PXI Instruments

By flipping the switch, you can acquire prototype measurements from PXI modular instruments attached to your local system. You can plot simulated and real measurements on the same set of axes to correlate and benchmark your design performance.

Available Multisim PXI Instruments

Download Multisim PXI instruments»

Note that to use these instruments, you must have Multisim 10.1.x or later, and you must have installed the hardware drivers for all these instruments.

 Instrument  Function

Image

 

Oscilloscope

100 MHz

2-Channel Scope

 

The oscilloscope can visualize simulated behavior as well as real prototype behavior from PXI-based instruments such as the PXI-5122.

 

 

 

Arbitrary Waveform Generator

200 MHz

 

Define custom signals as stimulus for simulated or real circuits. Real hardware that can be controlled includes PXI-5422.

 

 

 

DMM

7½ Digit

 

In simulation mode, take DC current and DC voltage. On a real prototype, take all measurements (with ohmmeter and so on) using hardware such as the NI PXI-4071 7½-digit DMM.

 

 

 

A digital waveform generator (high-speed digital I/O) and DC variable power supply are also available. 

Conclusion

With LabVIEW and Multisim, you have the only platform that can help you intuitively implement a VDUT. Whether you use the LabVIEW Multisim Connectivity Toolkit or Multisim PXI instruments, you can make that connection between simulation and test.

You can define your test application based on simulated measurements, so you do not need to wait for a physical prototype to be delivered before developing LabVIEW code.

With VDUTs, you can:

  • Begin test application in parallel with circuit design and layout
  • Start test development without waiting for the layout stage to end
  • Iterate on and improve your test application earlier in the design flow
  • Create code to uncover corner cases and troubleshoot problems sooner
  • Identify design errors earlier with the design engineer

 

1 ratings | 2.00 out of 5
Print | PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).