LabVIEW Simulation Interface Toolkit API Reference

Understanding the Block Diagram of the Batch Simulation Host VI (Simulation Interface Toolkit)

  • Updated2023-02-21
  • 2 minute(s) read

The block diagram for the Batch Simulation VI has three parts—the code to initialize the batch simulation, the code to set the parameter values, and the code to receive indicator updates from the simulation. This VI performs these tasks programmatically instead of waiting for you to set parameter values and run the simulation.

Initializing the Batch Simulation

The initialization code uses the SIT Initialize Simulation VI to start the simulation. This VI initiates a connection to the SIT Server, which resides on the computer that the hostname control specifies. The port control specifies the port number through which the Batch Simulation VI communicates with the sinewave model. The Model path control specifies the path to the model that you want to run.

Setting the Parameter Values

The For Loop contains the code that sets the parameter values and the code that updates the Output indicator. The For Loop uses automatic indexing to determine the number of times it executes. Specifically, the For Loop executes one time for every element in the Array of parameter values control.

The block diagram code that sets the parameter values uses the SIT Write VI to set the parameter values in the sinewave model. Given a path to a model parameter, this VI sets the initial value of that parameter using the value specified in the Array of parameter values control. The SIT Specify Signals to Probe VI tells the SIT Server which signals to probe. After the SIT Write VI sets the initial values for the simulation, the SIT Run Pause Stop VI notifies the SIT Server to start running the simulation.

Updating the Indicator

The While Loop contains block diagram code that receives signal data from the model and updates the front panel XY graph. The While Loop contains the SIT Read VI and the SIT Update Indicator VI. The SIT Read VI contains all the probed signal data. This VI wires the Raw Data output containing the signal data to the Raw Data input of the SIT Update Indicator VI, which creates an array of signal values. The SIT Update Indicator VI collects this array using shift registers and updates the host VI indicators at the end of the simulation.

The SIT Read VI executes until the While Loop receives an indication from the SIT Server that the simulation is complete. The result, for this example, is a plot of three sine waves with different amplitudes and frequencies.