From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Running Multisim with Labview

Solved!
Go to solution

Hi LN:

 

Any output going from LabVIEW to Multisim must be formatted as a waveform. In a nutshell...Multisim's simulation engine needs to get the timestep information of the signal so it can properly introduce these sources into the netlist.

 

If you need more control on the LabVIEW side of things, instead of using the LabVIEW Instruments option, you could consider using the LabVIEW Multisim API Toolkit. The main difference between the two options... in the LabVIEW Instruments, Multisim is the master, LabVIEW is the slave. In the API Toolkit, you are running a LabVIEW program in LabVIEW, as a master, and connecting to Multisim and using it as a slave (via ActiveX). It was officially introduced in Multisim 13, but the COM API server of Multisim has been there since version 10.1. You could download the Multisim 14 evaluation, when installing it, let it install the API toolkit for your LabVIEW edition, then you'll have to re-register the Multisim 12 server as the default one to connect (since Multisim 14 was the last one to be installed it is the one registered to connect) and it should work. There is a troubleshooting section in the help that shows how to register the server. Beware that many LabVIEW VIs from the toolkit will not work in version 12 of Multisim since its API was not as elaborated as the 14 one, we have made many additions since then.

Nestor
0 Kudos
Message 31 of 44
(2,272 Views)

Hi LN:

 

In any of your *_multisimInformation.vi files of any project, either the inputs or the outputs are in that order of the array. You can use any name, the order is important though.

 

The fields number of input pins or number of output pins specify how many inputs or outputs Multisim and LabvIEW will use to exchange the data. They must match exactly with what input pin names or output pin names you have filled in the arrays.

 

Multisim and LabVIEW will then exchange data using the same order in the array. That is, say you called your first item in the input array as MyInput1, this will be the first pin shown in the Multisim symbol, and in LabVIEW it will be the first item you can index from the input waveform coming from Multisim. Same goes for outputs, the order of the names in the output array dictates the order in which you have to create the signal waveform to output and also the order in which the pins are shown in the Multisim symbol.

Nestor
0 Kudos
Message 32 of 44
(2,271 Views)

Ok. Thank you, Nestor. I can try the toolkit.

 

If I specify more than one input/output pins, how can i transfer data between the two softwares? My "random Number generator.vit" seems to have only one waveform output. Where all I would need to modify the code to implement transfer of more than one input/output between the two softwares?

 

 

Thanks,

LN

0 Kudos
Message 33 of 44
(2,246 Views)

In my previous post I talked about where you define the number of outputs in the "*_multisimInformation.vi", so that's where you increase the number of outputs.

 

On your main VI, in the "Update Data Get Output Values" state you build the array of waveforms for output. First item in the array is for the first output specified in the information VI, the second item in the array is for the second output and so on. Just build the array in the same order as your outputs.

Nestor
0 Kudos
Message 34 of 44
(2,237 Views)

I opened the template that you used to base your instrument from, the StarterIOInstrument.

 

You use the "multisim command element" cluster to get data from Multisim (like the input pins) into LabVIEW, and you use the "return data" cluster to get data from LabVIEW into Multisim. In the "Update Data" case the example reads the data from Multisim, in the "Update Data Get Output Values" case it creates the data to output. This information is in the yellow comment section with instructions on the top-left of the block diagram.

 

If you want to generate a random output. Use an output-only template, instead of a template that is going to also receive data from Multisim.

 

If you want to learn more about the order in which the cases execute or how they control the data, add some delays, create some indicators or write a log file, tinker a little bit so you get a better idea of how it works.

Nestor
0 Kudos
Message 35 of 44
(2,237 Views)

Thank you Nestor. I will check that out.

 

 

Regards,

LN

0 Kudos
Message 36 of 44
(2,218 Views)

Hi Nestor,

 

I tried the toolkit and found that using it would be better. I was meddling with that. I again have two doubts:

1. I tried to make Multisim 12 as server as you suggested. I used Command prompt, moved to the installation location and gave command "regsvr32 MSInterface.dll". 

I get an error messasge saying that the "Module was loaded but the call to register server has failed ", with error code "0x80070005". On searching the net for information I would that, this error code is "ACCESS DENIED". I have attached the screenshot of the error. I am the administrator of the PC. When I looked up on internet, I found some pages on " Windows update Error 0x80070005".

                              http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_update/windows-update-error-0x800...

Would I need to use the procedure on this page? Or is there any other way?

 

2. I have some pulses coming in from Multisim to Labview. Those pulses are generated at random(using my random number generator). They are not being detected on Labview waveform chart.

However, if I use a periodic clock pulse to generate them in Multisim(avoiding my random generator), I am able to view them in LV.

Am I missing some setting?

 

Thanks,

LN

0 Kudos
Message 37 of 44
(2,197 Views)

Hi LN:

 

Have you tried opening the command line interface as an administrator? It works this way...click Start in your Windows taskbar, type cmd, right-click the cmd.exe result at the top of the list and select Run as administrator, follow the prompts and attempt again to register your Multisim 12 server.

 

For your second question, it sounds like a sampling problem. Try setting the sampling rate in the toolkit in LabVIEW a lot faster.

 

 

Nestor
0 Kudos
Message 38 of 44
(2,158 Views)

Hey Nestor,

 

I tried the "Run as administrator" option. That worked.

 

I am still trying to figure out the second one though. should I be adjusting the "Discrete steps" of the "Control and Simulation Loop" for the same? I tried keeping it at 1E-12. But the simulation becomes very slow then i mean my graph appears very slowly on LV.

 

Thanks,

LN

0 Kudos
Message 39 of 44
(2,141 Views)

I think you are using the wrong toolkit.

 

There's the LabVIEW Multisim API Toolkit, which is the one I suggested. And then there's the LabVIEW-Multisim Co-simulation Plugin, which is used in conjunction with the LabVIEW Control Design & Simulation Toolkit (which is where the Control and Simulation Loop you referenced is included).

 

The API toolkit is ActiveX-based, a server and a client. Multisim is the server, LabVIEW is the client, although execution-wise, you are using LabVIEW as the master that will control Multisim as a slave for the purpose of circuit simulation.

 

The Co-simulation plugin, is used with LabVIEW's simulation engine to execute in parallel with Multisim's simulation engine. Both simulators run in parallel, negotiating timesteps and exchanging data.

 

For what you're trying to do, the API toolkit is the right way to go.

 

Just use the API toolkit, it comes with good Help documentation and several example programs.

Nestor
0 Kudos
Message 40 of 44
(2,096 Views)