Power Electronics Development Center

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveforms during co-simulation

Output Current PLeakage 1u.jpg

During co-simulation, I use waveform chart to show the simulation waveform. But I notice that it can only record part of the waveform. Now the waveform shown above is the waveform during the simulation. Why can't I see the waveform of previous time?

0 Kudos
Message 1 of 2
(3,625 Views)

Hi there,

Good question. The LabVIEW waveform chart defaults to a tiny history length of 1024 or 8192, so right-click on the chart window and navigate to "Chart History Length...". Then set the history length to a larger value, such as 100,000, as shown below.

Chart History Length.png

Also, make sure you are using the Simulation Time Waveform block to collect the data points for your chart inside the LabVIEW Control & Simulation loop. This block collects is needed when you run a variable timestep simulation (such as Runge-Kutta 23 (variable) shown below) so the chart only displays the datapoints for successfully completed timesteps, which are known as "major time steps" of the simulation.

Simulation Time Waveform.png

This function is located on the LabVIEW Control & Simulation Palette. To find it, you should first enable the display of that palette. To do that, open a new LabVIEW VI, right click on a white area of the block diagram and click on the thumb tack in the upper right corner of the palette.

New VI - tack down the palette.png

Next, click "Customize" and then "Change Visible Palettes..." as shown below.

Select Visible Palettes.png

Check the box next to "Control Design & Simulation" or click "Select All" to enable the display of all palettes. Then click "OK".

Change Visible Palettes.png

Okay, now right-click on the block diagram again and navigate to Control Design & Simulation>Simulation>Control & Simulation Loop, as shown below, and draw the Control & Simulation Loop on your block diagram.

Drop CD&Sim Loop.png

Right-click inside the Control & Simulation loop and navigate to Graph Utilities>SimTime Waveform.

SimTime Waveform.png

Then on the LabVIEW front panel, right-click on the chart and set the Chart History Length to a value such as 100,000.

Chart History.png

As a test, you may want to wire up a Signal Generator and run the simulation, as shown below.

First, drop down the Signal Generator.

Signal Generator.png

Then wire it to the Simulation Time Waveform function.

Wired up Signal Generator.png

Then run the VI.

Run the VI.png

To add a Multisim Co-Simulation interface, drop down the block from the palette by right-clicking on the block diagram and navigating to Control Design & Simulation>Simulation>External Models>Multisim and then click on the Multisim Design block.

Add Multisim Interface.png

Now select the name of the Multisim schematic you want to co-simulate with. The RLC Circuit included in the NI Power Electronics Design Guide is a good one to start with.

Select Multisim Design.png

Click on the arrows at the bottom of the co-simulation block to drag down and show the names of the signal inputs and outputs.

Drag Down.pngDragged Down.png

Now wire the Signal Generator waveform into Vin and right click on C to create a front panel control for the Capacitance value.

Wire signal generator to cosimulation block.png

Next, right-click on the block-diagram and navigate to Programming>Array>Build Array.

Build array.png

Drop down the Build Array function and wire in the signal generator waveform and the Vout waveform from the co-simulation node. Then wire the output to the Simulation Time Waveform block.

Completed RLC Simulation.png

Set the Capacitance C value to 0.01 Farads and run the simulation.

Simulation Run.png

You may wish to right-click on the border of the chart and turn on the Graph Palette to enable zooming.

Graph Palette.png

You may also want to right-click on the name of one of the plots and turn on the Plot Visibility Checkbox.

Plot visibility checkbox.png

Also, you might want to right-click on the time axis, and change the "Formatting..." to floating point. 

Check time formatting to floating point.png

Message 2 of 2
(2,818 Views)