An Introduction to Multisim Automation with the LabVIEW Multisim Connectivity Toolkit (beta)

Publish Date: Mar 12, 2012 | 13 Ratings | 3.46 out of 5 |  PDF

Overview

This article is an introduction to the LabVIEW Multisim Connectivity Toolkit (beta). This toolkit, available at ni.com/labs is a wrapper for the Multisim Automation API. With this set of toolkit VIs for LabVIEW, you can create applications which acquire circuit simulation data.

Within this white paper, you will learn about the use cases of Multisim Automation, and the toolkit.

Table of Contents

  1. Introduction
  2. Need to Improve Validation
  3. Multisim and LabVIEW
  4. Automating Simulation
  5. LabVIEW Multisim Connectivity Toolkit 
  6. Applying the Toolkit
  7. Use Cases of Multisim Automation with the LabVIEW Connectivity Toolkit

1. Introduction

The traditional world of circuit design and test continue to be segregated by different tools and a lack of a common interface to facilitate the transfer of design and test data. This divide between initial analysis of a design, and the verification of prototype behavior, has long been the cause of errors and multiple prototype iterations.

By leveraging simulation as a part of the design flow, the behavior of the circuit can be dynamically evaluated, and errors identified earlier. With improved validation, and benchmarking of prototype performance, the overall success of the design can more appropriately be judged.

NI Multisim and NI LabVIEW are unique in their ability to transfer simulated and real measurement data, as a part of an integrated platform. Through this integration, the test environment (LabVIEW) is able to acquire not only prototype measurement data, but also simulation output. With both sets of data in a single interface, comparison and correlation can be easily approached. With an extensive set of analysis functions, LabVIEW can further analyze how the prototype deviates from the expected results (simulation).

In this introductory white paper you will learn how to acquire simulated data within the LabVIEW environment, through the use of the LabVIEW Multisim Connectivity Toolkit (beta). This set of utility VIs allows you to programmatically control, and automate Multisim simulation. Multisim 10.1 employs automation functionality which allows connectivity to COM-aware programming languages. The LabVIEW Multisim Connectivity Toolkit is a wrapper for this automation functionality, thereby allowing LabVIEW to connect to, and visualize Multisim simulated measurements. Through this acquisition, you have an improved method for validation.

 

Back to Top

2. Need to Improve Validation

To understand why validation needs to be improved, we must first examine the design flow. The traditional design flow for circuits consists of three major stages:

  1. The design topology must be captured, and design decisions validated with simulation
  2. The validated design must be prototyped through the layout and routing process
  3. The prototype behavior must be validated

Finally we enter a state of iteration, as we improve the design based upon the validation of the prototype.

However a major issue at this stage of the design flow, is that there is no integration between the traditional worlds of design and test and validation. This lack of connectivity between the two worlds increases the difficulty with which engineers can transfer data and measurements. Without an accurate perspective of design performance compared to  design specifications (i.e. the simulation results), it becomes increasingly difficult to truly benchmark the performance of the design. This can mean that errors can cascade through the design flow, and make its way into fabrication.

This is the Brick Wall Divide. A hindrance to a predictable, unified and streamlined flow from design specification to prototype validation.

 

To overcome this brick wall divide, a platform which integrates both elements of design and validation is required. The graphical design of Multisim, and the validation of LabVIEW can now be seamlessly integrated in order to overcome this hurdle and facilitate an improved validation approach.

 

 

Back to Top

3. Multisim and LabVIEW

Multisim is a schematic capture and interactive simulation environment for analog and digital circuits. By wrapping the capabilities of SPICE simulation within a graphical interface, it is easier and quicker to simulate circuits. Multisim has a number of different analyses, ranging from transient to AC analysis, from Monte Carlo to Worst-Case. Multisim connects to layout tools such as Ultiboard and Mentor Graphics to physically prototype the circuit.

LabVIEW is a graphical programming language, designed for rapid development of applications. It enables engineers to quickly connect to hardware, and acquire real measurements. By utilizing LabVIEW, engineers can graphically define algorithms to analyze measured data specific to the needs of the application.

It is by unifying these two environments that both real and simulated measurements can be compared and analyzed, to improve the validation of physical circuits. This unification can be done through the Multisim Automation API.

 

 

Back to Top

4. Automating Simulation

The Multisim Automation API allows the automation and acquisition of Multisim simulation through a COM-based interface. The API lets you programmatically control a Multisim simulation without needing to view Multisim. Clients written in any COM-aware programming language, such as NI LabVIEW, can access Multisim through this interface, and leverage the simulation engine to acquire simulated measurements.

Through the API, you can:

    1. Open and close an existing circuit.
    2. Optionally inject a signal in place of an existing voltage or current source.
    3. Start, stop, and pause simulations.
    4. Read out simulation results from an existing static probe.
    5. Enumerate the components in the schematic.
    6. Replace components with components from the database.
    7. Get and set the values of resistor, capacitor, and inductor components.
    8. Enumerate variants.
    9. Get and set the active variant for simulation.
    10. Generate reports on the schematic, including a bill of materials and a netlist report.
    11. Produce an image of the circuit.
    12. The API can change and replace components on the top level of a design; components in sub-circuits and hierarchical blocks cannot be altered. 

 

 

Setting up Inputs

In order to setup a Multisim simulation for Automation, certain elements need to be defined to ultimately poll a schematic for input and output values. 

By utilizing the API you are able to set the value of a source. Input values are current and voltage sources (such as V2) in the schematic below. Within the Multisim schematic place a DC or AC power supply at any point where you will require the Automation API to be able to adjust or set input values. The DC or AC power supply creates the connection between the Multisim simulation engine, and the automation program.

To place a DC or AC power supply:

    1. Select Place >> Component.
    2. In the Select a Component dialog select the Master Database.
    3. In the Group field, select the Sources group.
    4. In the Family field, select the POWER_SOURCES family.
    5. In here you can select either AC_POWER or DC_POWER sources.

 

 

Setting up Outputs

Outputs are denoted by probes placed at nodes requiring analysis. These probes, and their associated names identify to the automation application, the exact place where simulation data is to be acquired from the schematic.

To place and identify a probe:

  1. Select Simulate > Instruments > Measurement Probe.
  2. Connect the probe to a node of interest in the circuit (as seen below at the output).
  3. Double-click on the probe.
  4. Select the Display tab.
  5. In the RefDes section, type the name of the probe. For the purposes of an output of a circuit output is generally an appropriate name.

 

 

 

Automation

With the circuit setup, it is time to begin automating the simulation. Automation is based upon Active-X, and as such Active-X controls, allow you to connect from the programming language (C, Visual Basic, LabVIEW etc...) and acquire data from a Multisim schematic/simulation.

Below we can see in LabVIEW a small selection of code that utilizes the Active-X based connection to Multisim.

 

 

Back to Top

5. LabVIEW Multisim Connectivity Toolkit 

The LabVIEW Multisim Connectivity Toolkit (beta) is a set of wrappers for the Multisim Automation API. All the various functions such as opening, closing, and viewing a circuit, as well as running, pausing and stopping simulation have been organized into VIs. This means that rather than having to access Active-X controls (as shown above), standard LabVIEW programming practices can be utilized.

To download and install the Connectivity Toolkit, visit ni.com/labs and follow the associated instructions.

Once installed, the LabVIEW Multisim Connectivity Toolkit can be found in the Connectivity Function palette (as seen below) and can be selected through Functions > Connectivity > Multisim.

 

 

Toolkit Functions

Below the a table describing all of the various sub-palettes in the toolkit, the associated VIs and their general use or functionality.

 

Connectivity Functions 

Functionality

Description

 

Multisim Connection

  • Multisim Connect.vi
  • Multisim Is Connected.vi
  • Multisim Disconnect.vi

 

These connection VIs allow you to connect/disconnect to the Multisim simulation engine.

 

 

I/O Configuration & Control

  • Multisim Enum Inputs.vi
  • Multisim Reserve Input.vi
  • Multisim Set Input Data.vi
  • Multisim Clear Input Data.vi
  • Multisim Enum Outputs.vi
  • Multisim Set Output Request.vi
  • Multisim Output Ready.vi
  • Multisim Get Output Data.vi
  • Multisim Clear Output Request.vi

There are various I/O elements to automated simulation. These I/O functions allow you to get, set or clear inputs and outputs to the simulation.

 

Simulation Control

  • Multisim Run Simulation.vi
  • Multisim Pause Simulation.vi
  • Multisim Resume Simulation.vi
  • Multisim Stop Simulation.vi
  • Multisim Run Simulation Until Next Output.vi
  • Multisim Wait For Next Output.vi
  • Multisim Simulation State.vi
  • Multisim Do AC Sweep.vi
  • Multisim Do Command Line.vi

The actual control of the simulation (run, stop, pause, resume etc…) are accomplished through these control functions.

 

File Management

  • Multisim Open File.vi
  • Multisim Save.vi
  • Multisim New File.vi
  • Multisim File Name.vi
  • Multisim Circuit Name.vi 

These standard VIs allow you to open, save, close and name schematics viewed through the toolkit.

Circuit Configuration

  • Multisim Enum Components.vi
  • Multisim Enum Sections.vi
  • Multisim Replace Component.vi
  • Multisim Enum Variants.vi
  • Multisim Active Variant.vi 

As mentioned previously the toolkit allows you to use the API functionality of changing values/components in the design

 

 

Error & Utility

  • Multisim Last Error Message.vi
  • Multisim Log File.vi
  • Multisim Report.vi
  • Multisim Version Info.vi
  • Multisim Path.vi
  • Multisim Register Stop Event.vi
  • Multisim Get Circuit Image.vi

These standard VIs allow you to handle errors, and other utilities which correspond to the use of the automation API.

 

 

Polymorphic Functions

To make design easier, many of the LabVIEW functions are polymorphic, meaning that a single block has multiple functions, based upon the "personality" setting. For example if we look below at the Log File function, it can have one of three personalities:

  1. Get the Log File Path
  2. Set the Log File Path
  3. Disable the Log File Path

The following table showcases all of the various polymorphic functions that are available, and their associated personalities:

Function

Personalities

Enum Inputs

  • 1D String Array
  • Variant

Enum Outputs

  • 1D String Array
  • Variant

Set Input Data

  • Raw
  • Sampled

Clear Input

  • Input
  • All Inputs

Clear Output

  • Output
  • All Outputs

AC Sweep

  • String
  • 1D String Array
  • Variant

Save

  • Save
  • Save As…

Enum Components

  • 1D String Array
  • Variant

Active Variant

  • Get
  • Set

RLC Value

  • Get
  • Set

Last Error Message

  • From Application
  • From Circuit

Report

  • BOM   (Real, Virtual, Txt, Csv)
  • Netlist (Probes, No Probes, Txt, Csv)

Log File

  • Get
  • Set
  • Disable

Multisim Path

  • Get
  • Set

 

 

Back to Top

6. Applying the Toolkit

Below we can see a small example of how to setup an AC Analysis. This code is based almost exclusively on the above mentioned LabVIEW Multisim Connectivity Toolkit VIs. You will notice that the LabVIEW approach to coding is a based upon "data flow" from, one function to the next. By simply selecting a few basic Connectivity VIs, simulation data can be acquired.

The basic flow of the code is from left to right, and performs the following functions:

  1. Connect to the Multisim Automation API (Multisim Connection palette)
  2. Open a Multisim file, based upon 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 till the end of the AC Analysis (Simulation Control palette)
  6. Get output data from analysis (I/O Configuration & Control palette)
  7. Show simulation data
  8. Close the connection to the Multisim Automation API (Multisim Connection palette)

 

 

Back to Top

7. Use Cases of Multisim Automation with the LabVIEW Connectivity Toolkit

There are three major use cases for the automation of simulation, and the LabVIEW Multisim Connectivity Toolkit:

  1. The automation of simulation and validation in a single environment
  2. Performing complex, multi-simulation analyses
  3. Leveraging LabVIEW web functionality, to access simulation online

 

Simulation and Validation

Due to the intuitive connection to hardware that LabVIEW provides, it is easy for real and simulated measurements to be acquired in a single environment. With both measurements within one interface, LabVIEW can be utilized to compare simulated and real measurements to validate the behavior of a physical prototype as compared to the simulated results.

This amounts to a very simple, yet powerful way in which to benchmark prototype behavior, based upon the original design specifications. This is called Integrated Design and Test.

Learn More

  1. View a webcast on Improving Circuit Design with Multisim Automation and LabVIEW
  2. Learn how companies are utilizing Integrated Design and Test to improve validation

 

 

Complex Analyses

Automated simulation means that complex analyses can be setup to effectively. For example if one wishes to see what the effects of changing component values will have upon a circuit design, Multisim can be automated through LabVIEW, and values of the various components can be iterated to plot, view and analyze the effects.

Similarly if multiple analyses must be ran over different circuits, and their various outputs made available to managers, and other engineering groups for decision making, LabVIEW can again automate the simulation and present the data.

 

Learn More

  1. Access a white paper on automated simulation (with example code, and reference design)

 

 

Online Simulation

For applications, such as online component evaluation, SPICE simulation is a powerful tool in order to provide strong analysis of device choices. Traditionally SPICE cannot be leveraged on the web, however with LabVIEW connectivity, LabVIEW web services can be utilized in order to take simulation to the web. For example Analog Devices, have available the ADIOpAmpSim web application online which utilizes Multisim simulation in order to allow engineers to select one of 300 different OpAmps and evaluate its behavior.

This ability to take simulation to the web is based upon the Multisim Automation API, and LabVIEW as a web services tool, connecting to the simulation DLL.

 

Learn More

  1. See Multisim Automation in action, evaluating the behavior of circuits at Analog Devices ADIOpAmpSim.

 

Back to Top

Bookmark & Share

Ratings

Rate this document

Answered Your Question?
Yes No

Submit