NI Circuit Design Community Blog

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW-Multisim Co-Simulation with Variants and Hierarchical Blocks (Part 1)

GarretF
NI Employee (retired)

Back when we were designing LabVIEW-Multisim co-simulation, we talked a lot about workflow, and what you see today is one of several options we explored. One of the important factors we considered was how someone would go from iterative design to implementation on a PCB. We wanted that to be seamless so that you wouldn't have to recapture any part of your design. For example, if layout required a change to the design, you could change it in once in Multisim, and it would immediately be reflected in co-simulation.

Brian MacCleery's blog discusses these approaches, but I though I would add my input. We envisioned two approaches to seamless design with co-simulation - which one you choose depends entirely on personal preference. The summer example file is probably my favourite example because it is so simple, yet demonstrates the power of this approach so clearly.

summer.png

Here we have a design with HB/SC connectors are already setup for co-simulation. But what if you want to simulate only in Multisim? How do you do this without changing your design so that you can seamlessly switch back and forth between Multisim-only simulation and LabVIEW-Multisim co-simulation?

When you co-simulate, the input HB/SC connectors are driven by LabVIEW. When you simulate only in Multisim, you therefore need to supply a substitute driving signal on the input HB/SC connectors. Given this posts title, you might have guessed the way to achieve this is through hierarchical blocks or variants. Which one you choose is entirely up to you and your personal preference, although my personal preference is hierarchical blocks.

Variants

First, let's add some variants to the design. In the Variant Manager (Tools > Variant Manager), rename Default1 to Co-simulation and add a new variant Multisim-only. Once you are done, your variant manager should look like the following:

variantsmanager.png

Next, add some sources to your design to drive the input HB/SC connectors. You can use any source you like, and I've put a variety on the design.

summer_with_sources.png

Finally, for each of the sources, edit the properties, and exclude it from the Co-simulation variant, and include it in the Multisim-only variant.

variant_properties.PNG

When your done, you'll have created the following design (it looks the same as the last design, but the sources now have different variant settings).

summer_complete.png

Switching between the Co-simulation and Multisim-only variants in the Design Toolbox adds/removes the sources from simulation.

design_toolbox.PNG

For LabVIEW-Multisim co-simulation, select the Co-simulation variant, save the file, and run the simulation from within LabVIEW. For Multisim-only simulation, select the Multisim-only variant, and run the simulation from within Multisim. To take this design to Ultiboard, use the normal method and only select the co-simulation variant. Transfer to Ultiboard will exclude the sources anyway because they don't have footprints, but I like to exclude them because it makes more sense to me.

So that's how you use variants to reuse the exact same design for LabVIEW-Multisim co-simulation, Multisim-only simulation, and tranferring to layout. Next week I'll describe how to achieve this using hierarchical blocks.

Garret
Senior Software Developer
National Instruments
Circuit Design Community and Blog

If someone helped you, let them know. Mark as solved or give a kudo. 🙂