1. 1/5 www.ni.com
Automate Circuits Analyses with the NI LabVIEW Multisim API Toolkit
Publish Date: Oct 07, 2013
Overview
The NI LabVIEW Multisim API Toolkit has been developed for the LabVIEW environment and provides access tomore than 120 functions toautomate thesimulation of a Multisim circuit from
LabVIEW. This toolkit is an innovative new connection between theworlds of designand graphical programming. You can for automate simulations easily from a graphical programming
language, to:
• Access simulatedmeasurements within the LabVIEW environment for further, domain specific analysis
• Correlate simulated and real measurements in a single LabVIEW environment
• Use simulated measurements as a designunder test (DUT), in order to build test/validate cases earlier in the design flow
Table of Contents
1. Introduction
2. What is the LabVIEW Multisim API Toolkit?
3. How to Install the LabVIEW Multisim API Toolkit
4. Example 1: Efficiency Calculation of a Buck Converter
5. Example 2: Automating a Simulation of a Signal Conditioning Circuit with Acquired Heart-Beat Signal
6. Additional Resources
1 . Introduction
Multisim allows engineers touse simulation to optimize the performance of designs earlier in the design flow and ensure circuits meet specifications with fewer prototypeiterations. The
LabVIEW Multisim API toolkit added in Multisim 13.0enables designers of analog and mixed-mode circuits toeasily creategraphical program in LabVIEW that rapidly perform or automate
critical design tasks which is impossible in other simulation tools. Some of the critical types of analyses that areavailable include:
Ev aluatingcircuit performance withnon-ideal signals from real measurements
Visualizing outputs of circuits in custom graphs and interfaces
Automating and iterating through different design scenarios with LabVIEW
2 . What is the LabVIEW Multisim API Toolkit?
Multisim natively provides an Application Programming Interface (API)that allows for the automation of circuit simulation and analyses through a COM interface that designers canuseto
programmatically control.
The LabVIEW Multisim API Toolkit is a collection of VIs that makes the Multisim API ready-to-use for LabVIEW users. With this API toolkit users can take advantage of over 120 ready-to-use
LabVIEW Virtual Instruments (VIs) to:
1. Establish a connection toMultisim, check the connection status, disconnect from Multisim, query the applicationlocation and version.
2. Manage Multisim files (open, create and savefiles, as well as query file information).
3. Conf igure inputs and outputs, as well as also set datafor inputs or get data from outputs.
4. Control and check thestate of the simulation (DC, AC, or Transient).
5. Execute analyses and use the SPICE command line.
6. Conf igure component values, switch models, change circuit parameters, and replacevariants of a Multisim circuit.
7. Perf orm different utility functions.
8. Check for error messages, get a circuit image or generate reports.
3 . How to Install the LabVIEW Multisim API Toolkit
The LabVIEW Multisim API Toolkit is installedautomatically with Multisim 13
4 . Example 1: EfficiencyCalculation of a Buck Converter
This example uses theLabVIEW Multisim API Toolkit to iterate through multiple critical values in a circuit in an automated fashion to assist us in calculatingefficiency. Without a toolkit such as
this one in LabVIEW an individual would try to optimize efficiency by manually changingvalues in a circuit and recording the simulated value in each. This is time consuming and error-prone.
2. 2/5 www.ni.com
Our goal f or this example will thereforebe to set the switching frequency of parameters on a buck converter based on NXP components andthen perform a sweep across several switching
f requency, Fsw, values. Foreach step a transient analysis is run and the efficiency of the circuit is automatically calculated. This can all then be plottedand the best switching frequency will be
observ ed throughthis process.
Using the circuit parameters (click here to learn moreabout circuit parameters) and toolkit we canstep through the development of this test.
All the example files are attached tothis document in thefoldercalled apidemo.zip
Open the f ile Circuit Parameters.vi in LabVIEW 2013
Go to the block diagram and see the new VIs for the Multisim connectivity. They are under Connectivity>Multisim
Notice how f rom LabVIEW there are now ready to use VIs for establishing a Multisim connection, running simulation files, configuringcircuits, and read/write IOs.
On the block diagram there are available explanations on what each of theVIs accomplishes.
Open the Multisim circuit that this VI is supposed to control and noticethe DC-DC buck circuit converting10V to 3.1V (BuckConverter_API.ms13).
Run a quick interactive simulation by pressing theplay button to evaluate the circuit operation. The probes should be showing theexpected values.
3. 3/5 www.ni.com
Go to the LabVIEW front panel and run theVI
LabVIEW is now controlling Multisim and iterating over multiplevalues of the switching frequency andcreating a plot of thecircuit efficiency
By using this approach we can clearly seethe various efficiency values of our circuit. The best option can be chosenand we have been ableto automate what has traditionally beena complex
and error-heavy process
5 . Example 2: Automating a Simulation of a Signal Conditioning Circuit with Acquired Heart-Beat Signal
In this example a signal conditioning circuit is designed in Multisim to filteracquired heartbeat signals for the development of a biomedical device application.
The circuit is a single stage active filterusing operational amplifiers from Texas Instruments. Whilethe heart beat signals are real-world signals that could be acquired usinga sensor device or
simulated using the LabVIEW Biomedical Toolkit.
All the design f iles of this example are in the attached file sigcond.rar
4. 4/5 www.ni.com
As y ou can see the transient simulation in Multisim couldbe used to evaluatewhether the chosen op-ampwill provide the desired filtering responseor not for this low-voltage signal. However,
f or
5. 5/5 www.ni.com
As y ou can see usingthis automation code multiple output plots for different op-amps and input signals havebeen very easily created. Also the table on top of the graphindicates the different
corresponding SNR values. Without the automation of LabVIEW this toolkit provides, such calculationwould a separate simulationrun for each case whichis a lengthy process.
6 . Additional Resources
Download Multisim
Learn about more Multisim circuit design applications
the purpose of this design, the LabVIEW Multisim API Toolkit is leveraged to automate multiplesimulation runs that:
Iterate over a various selection of op-amp to determine which op-amp providebetter conditioning
Iterate over various input heart-beat signals with various noise levels
Calculate the transient responses for eachop-amp versus multipleinput noise levels
Perf orm advanced signal processing tasks to calculate critical parameters such as the Signal to Noise Ratio (SNR)
The application below is writtenin LabVIEW. You can simply download and run underthe project .main.vi Heart Beat Signal Conditioning.lvproj