Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Running Multisim with Labview

Solved!
Go to solution

Hey,

 

  I am trying to convert a series of student labs for a dynamic systems course to run on a newer, better setup.  Previously, the lab I am working on took input from a sensor, fed that input through an analog circuit, and fed the output from that circuit into a Labview VI.  My question is, can that be done using a Multisim simulation instead of a physical circuit?  I have found volumes regarding running Labview VIs in Multisim, but nothing regarding a VI taking input from a Multisim circuit.  If this can be done, what configuration would you suggest?

0 Kudos
Message 1 of 44
(8,666 Views)

bjw5,

 

Sure you can do this in 2 different ways...

 

1. If you want to use a standard Multisim circuit you can feed I/O to Multisim via the LabVIEW Multisim Connectivity Toolkit...   You'll need to program the LabVIEW application to communicate with Multisim and you can write sensor or other voltage/current stimuli to sources within the Multisim circuit via the API.   The tool allows you to read the simulation data (by sampling voltage and current probes) which creates a waveform (and then you can process using LabVIEW).

 

https://lumen.ni.com/nicif/us/evalmultisimtlkt/content.xhtml

 

2. If you want everything run and controlled via Multisim, you can create LabVIEW VIs (input, output, or inout) that will run synchronously inside of Multisim.   You can create .llbs based on templates and then add functions that will allow you to create measurements, etc...

 

http://zone.ni.com/devzone/cda/tut/p/id/5635

 

Regards,

Pat Noonan

National Instruments

 

0 Kudos
Message 2 of 44
(8,657 Views)

Pat,

 

Thank you very much, I tried the second option and got the equivalent of my original VI to run in Multisim.  However, the system as a whole doesn't seem to like my myDAQ.  When I made a new Multisim VI to acquire input from the myDAQ, it doesn't register in Multisim under the Simulate tab where the other instruments I've made have.  Do I have to do something special to interface a myDAQ with Multisim?

0 Kudos
Message 3 of 44
(8,611 Views)

bjw5,

 

It is likely due to the fact that some of the vi.lib or DAQ driver libraries that you need to link into the VI are missing in the build of your Multisim LabVIEW .llb.   If Multisim cannot locate missing subVIs (from vi.lib or elsewhere) Multisim will not load the LabVIEW VIs that you have built.   Sometimes you need to include these vi.lib subVIs (usually contained in a LabVIEW library - lvlib) in the project build (by default all vi.lib functions are excluded).   When Multisim loads, it loads in the appropriate base level LabVIEW functionality only - this includes most LabVIEW functions, basic math, etc - however any advanced measurments or additional toolkits or drivers need to be included in the .llb build or the support folder directly.

 

How do you know?  In your LabVIEW project, if you click on the 'Dependencies' +/- twisty you will see any subVIs or .lvlibs which contain subVIs that may be used in your Multisim VI application ...

 

Here is a sampling of a recent project that I used that included some advanced measurement VIs in LabVIEW.   I believe the only ones included by default in Multisim are the 'Base' lvlibs (which does include most of the LV functionality, but for my application advanced measurements were needed). 

 

lvlibs.JPG

 

If you DO have any that say 'Pro' in the name or any hardware driver level functions or subVIs, you'll need to do one of two things:

 

1. Easiest method - Include all vi.libs in the Source Distribution under 'Additional Preferences'

 

Basically change this ....

build - additional exclusions _default.JPG

 

to this...

 

build - additional exclusions _w_vilibs.JPG

 

Note that it will take some additional time to build (since when LabVIEW builds your llb it will search all of the lvlibs for VIs that it thinks are in your application and then remove the ones that are not)... but your VI should then run in Multisim...

 

 

2.   Advanced method -> explicitly add the subVIs or lvlibs to the top level project and make them 'always included' in the Source Distribution 'Source Files' options.

 

Here you can explicitely call the lvlibs to be included in your build and then take out functions you don't need (but you may not know what subVIs are used if they are embedded in lvlibs that you're not aware you are using (such as the case with Express VIs) ).   You also have to be careful since I have found out the hard way that menus within the lvlibs cannot be included in .llbs, so you have to exclude any menus folders within the lvlibs (you can include/exclude pieces of lvlibs by the way)...   Sometimes this can reduce the build time, but it can be a little trickier since you need to know which things to include/exclude.   If you are just beginning, use method #1 at first.

 

Ok thats they way it is with most Multisim VIs that I am familiar with but there may be some things that I am missing because you are using myDAQ...   I've requested that someone familiar with the myDAQ products on the academic team also reply to this thread. 

 

Hope this helps and good luck!

 

Regards,

Pat Noonan

0 Kudos
Message 4 of 44
(8,601 Views)

Pat,

 

My Dependencies +/- includes some 100+ subVIs (almost all DAQmx related), and every build configuration I've tried results in a directory of (only) a dozen or so.  I've tracked down the subVIs required and copied them to the same folder as the rest of the unbuilt VI, but haven't seen any way to include them in the Build process.  How would I call a specific set of directories to be included in the build?

0 Kudos
Message 5 of 44
(8,582 Views)

I feel like I should add that the only VIs appearing under the 'Source Files' tab are the multisiminformation.vi file, generate Simulated Data.vi, and the .vit file

 

Many thanks

0 Kudos
Message 6 of 44
(8,581 Views)

Hi, I have some experience building LV Instruments to be used within Multisim, but I have never built a myDAQ VI in Multisim. If I create a LV Instrument that takes an analog input from channel 0 on the myDAQ, and this signal is fed into the simulation... would that be a good starting point for you?

 

Cheers,

Nestor
0 Kudos
Message 7 of 44
(8,537 Views)

BTW... my guess is that there is some error in the VI you have created, rather than missing VIs in the build process, unless your VI is used in a computer where LabVIEW, DAQmx and myDAQ are NOT installed. If the latter is the case, then you DO need to include all necessary VIs. But if you are going to run your VI in Multisim, in a computer that has LabVIEW, DAQmx and myDAQ installed, you should not need to include those VIs.

 

When a VI that you have built for Multisim has some sort of error, Multisim is unable to load it at startup, and simply does not shows up in the Instruments toolbar. Typical errors are related to the multisimInformation file and info not correlating to the main template VI, or some execution error on the main template VI.

 

Just reply to my previous post, and we'll take it from there, creating a simple example might clear any doubts on this.

Nestor
0 Kudos
Message 8 of 44
(8,533 Views)

Nestor,

 

I'm running this on a machine with LabVIEW, DAQmx, and myDAQ installed. That said, creating that theoretically simple sample VI would be fantastic.  My current approach involves following the tutorial user32 posted earlier in this thread, but starting with the Output folder and making a different .vit file.  Currently, in the case structure for "update initial output data", I have a flat sequence structure with the DAQ assistant subVI in one compartment and the Bundle by Name and Send Notification subVIs in the other.  I'm sure I'm forgetting to do something critical during or before the build process, but for the life of me can't figure out what. 

 

Thank you very much for your help

0 Kudos
Message 9 of 44
(8,514 Views)

Hi, I got it to work. Check it out:

 

screenshot.png

 

It seems that you do need to "include" vi.lib, otherwise Multisim cannot load the full VI at startup... so uncheck "exclude vi.lib" from the build settings. I'm attaching the whole project and LLB. Build the final instrument LLB from the project and try it out yourself. This simple VI acquires signals from the analog channel 0. I used the starter output template used in Multisim and just added the myDAQ related VI to acquire signals.

 

So, download the attachment, build the project and give a test. The way I configured the Build Settings, will include all DAQmx related VIs within the final LLB. I've seen cases in which Multisim does needs to add those VIs and others in which not. I recently finished a Keithley 2000 DMM driver to be used within Multisim and it did not required any of the GPIB VIs to be saved with the instrument. So, is just a matter of trial and error depending on what those VIs depend on.

 

Let me know if it works.

 

Cheers,

Nestor
0 Kudos
Message 10 of 44
(8,496 Views)