Demo
This 4-minute video shows how to connect Simulink with CarSim, BikeSim, and TruckSim (July 2020).

Running Under Other Software

CarSim, TruckSim, and BikeSim models are complete with respect to simulating conventional vehicles in a full range of test and driving conditions. However, they all support running under the control of external software, such as Simulink, LabVIEW, and FMI/FMU.

The programs that solve the equations of the math models are called VS Solver programs; they use core equations that describe the basic 3D kinematical and dynamical equations of a vehicle with pneumatic tires and conventional suspension, steering, braking, and powertrain systems.

The VehicleSim architecture is designed so the core vehicle models can be extended to account for advanced electronic controllers, alternative component models (tires, steering, powertrain, etc.), driver control, advanced test procedures, etc. The same architecture also supports the use of our vehicle models in other simulation environments. Read here about compatible software packages.

Import and Export Variables

Communication with other software is accomplished with arrays of import and export variables. The math model equations include effects of variables that are defined in other software and imported as the simulation runs. Output variables are computed by the model and can be sent to other software (exported) during a run. For example, CarSim models have about 400 available import variables and 800 available output variables. More import and export variables are easily defined using the VS Commands DEFINE_IMPORT and DEFINE_OUTPUT.

MATLAB/Simulink

Simulink provides a graphical user interface for building math models as block diagrams. The graphical interface is popular for developing dynamical models for many fields, such as electronics, hydraulics, chemistry, and especially, control systems.

The VS browser simplifies the connection VS Math Models and Simulink, as shown in the video at the top of this page.

  • Work in the VS Browser (on the main Run Control screen) and use Simulink models the same way you would use the built-in math models. You can use models created by Simulink users even if you have little or no knowledge about how to use Simulink. Just click the Run Now button whenever you want to run a new simulation.
  • Work in Simulink and use our S-function plug-ins the same way you would use other S-functions. You can use our vehicle dynamics models from within Simulink with little knowledge about the VS Browser or our model details. Click the Send to Simulink button to transfer all necessary data to Simulink, and then do your work in Simulink. Besides the normal viewing of results from within Simulink, you can transfer back to the VS Browser at any time to adjust vehicle properties or use VS Visualizer to view the results you generated in Simulink.

Although our vehicle models have hundreds of variables available for import and export, you do not need to handle all of them when including the vehicle model in Simulink. A typical Simulink model will use only a few of the available variables. They are activated by pointing-and-clicking from VS Browser screens that you use to activate specific variables for import and export to and from Simulink.

VehicleSim products support FMU for FMI versions 1.0, 2.0, & 3.0, flat or structured I/O, self-contained or with shared data, and 32-bit or 64-bit solvers.

Functional Mock-up Interface (FMI)

Functional Mock-up Interface (FMI) is an open standard interface for for linking multiple simulation tools together. FMI supports model exchange and co-simulation of dynamic models (see the web site https://www.fmi-standard.org for details).

A Functional mock-up unit (FMU) is a block that can run in a simulation workspace.

BikeSim, CarSim, and TruckSim can automatically generate a VS FMU as a co-simulation slave for the following options:

  1. FMI versions 1.0, 2.0, & 3.0.
  2. "Flat" and "Structured" I/O definitions.
  3. Both self-contained FMUs and FMUs that work with external files.
    1. The FMU that uses external data files operates in a similar fashion to a Simulink S-Function, accessing external database files, and generating output files that can be viewed with VS Visualizer.
    2. The self-contained version contains the solvers and all supporting data in the single FMU file. Output files are written in a temporary folder.
  4. Compiled for both 32-bit and 64-bit Windows OS.
  5. Compiled for Concurrent, dSPACE, Speedogat, & CANoe RT opertating systems.

LabVIEW

National Instruments LabVIEW is a simulation environment that can also be used to extend our vehicle models. The VS browser GUI supports the same type of simple-click configuration and connection controls that are provided for Simulink.

Fast, Consistent, and Compatible

The core vehicle models are compiled as dynamically linked library (DLL) files that all support the VehicleSim application program interface (VS API). The same DLL is used for stand-alone runs (the core vehicle model running with no external software), or with Simulink, or LabView, or custom programs written in any language that can use DLLs. The DLL always runs at high speed, giving results much faster than real-time on typical PCs. Identical behavior is obtained regardless of the simulation environment, because there is just one DLL used in different contexts.

NI-LabVIEW






The Run Control screen has simple buttons for controlling runs with a Simulink model either from the Run Control screen or from Simulink. Similar options are available for LabVIEW.

Create an FMU for use with FMI-compatible software using a single button. The FMU includes all settings for the current Run Control setup.
Contact Us