The Simulation Loop contains parameters that affect how often the simulation executes. You configure these parameters when you are running a simulation that has real-world timing needs. For example, if you are simulating a controller that must return a value every millisecond, you can configure the simulation to execute only once every millisecond. This example places a strict upper-bound on the execution of the Simulation Loop; therefore, the simulation is deterministic. National Instruments provides special real-time (RT) hardware targets you can use to ensure determinism in a simulation. In addition to an RT target, you must also install the LabVIEW Real-Time Module to execute a simulation deterministically. Refer to the National Instruments Web site for information about these RT hardware targets and the LabVIEW Real-Time Module.
![]() |
Note Deterministic simulations require fixed step-size ordinary differential equation (ODE) solvers. |
You use the Timing Parameters page of the Configure Simulation Parameters dialog box to configure the timing of the Simulation Loop. You can use this dialog box to configure the following timing scenarios:
To run a simulation without any timing restrictions, place a checkmark in the Software Timing checkbox on this page. In this situation, the simulation runs as fast as possible. This option is appropriate for running offline simulations.
The Ardence Real-Time Extension (RTX) does not support the Timed Loop or a hardware-timed Simulation Loop. To run a simulation on an RTX target, you can use the Wait Until Next ms Multiple function. Place this function on the simulation diagram and wire a value to the millisecond multiple input of this function.
If you are using either the Runge-Kutta 2, Runge-Kutta 3, or Runge-Kutta 4 ODE solver, National Instruments recommends you place this function in a subVI and configure that subVI to execute only on major time steps of the ODE solver. Complete the following steps to make this change.
If you do not have an RT target available, you can simulate 1 kHz timing by using a Windows computer. To make this change, remove the checkmark from the Software Timing checkbox and select 1 kHz from the Source Type list.
If you have a supported National Instruments RT target, you also can select the 1 MHz option. If you select this option for a simulation that is running on an unsupported target, the LabVIEW Simulation Module switches to 1 kHz timing when you run the simulation.
![]() |
Note You are not restricted to the 1 kHz or 1 MHz loop rates. You can use the Period control to adjust the period of the simulation as necessary. |
To specify a rate other than 1 kHz, you can use an external timing source, such as a National Instruments DAQ device, to control the Simulation Loop. To make this change, remove the checkmark from the Software Timing checkbox and select Other <defined by source name or terminal> from the Source Type list. Then, wire the timing source out output of the DAQmx Create Task VI to the Source name input of the Simulation Loop.
![]() |
Note You must install NI-DAQmx™, available on the National Instruments Device Driver CD, to use the DAQmx VIs. |
For an example of this procedure, refer to the analog discrete transfer function controller VI in the labview\examples\simulation\real-time\Analog discrete transfer function controller.llb.
Instead of using an external timing source, you can use the RT hardware I/O VIs to control the timing of the Simulation Loop. In this situation, you place a checkmark in the Software Timing checkbox so the Simulation Loop runs as fast as possible. Then, you use a VI, such as the DAQmx Read VI, to control the timing of the Simulation Loop. This method is also suitable for RTX targets.