Simulator

Overview

The Simulator is designed to quickly simulate message traffic on a network.  The simulator is easy to use, but is flexible enough for very complex simulations.  The flexibility allows a user to generate complete interactive simulations with a handful of mouse clicks.

The information required to setup the simulator is retrieved from the configured database.  This database lists the ECUs involved in a particular network, the messages they transmit and signals present.  If the configured database is a GMLAN UEF database, more information is available like virtual networks involved, periodic message rates, and the ability to simulate receive messages for the selected ECUs.

The simulated messages and signals can be sourced from the simulator or through the normal Vehicle Spy software transmit functions.  Signal data can be entered automatically from static values, calculated functions, Vehicle Spy expressions, and saved replay files (Figure 1).  Vehicle Spy features such as Graphical Panels, Function Blocks, and Java can provide the simulation with further options.



Figure 1: There are many potential sources of signal data.

Basic Setup

There are three main steps for creating a simulation.  First, you must setup a UEF database.  Second, you must select your simulation ECUs.  Finally you need to select your signal data (Figure 2).  This last step will be the majority of your work in building a simulation.


Figure 2: Three step process for creating a simulation.


Select Your Simulation ECUs

The first tab in the simulator dialog allows you to select what type of simulation and what ECUs to simulate.  The first choice is the type of simulator (Figure 3: ).  If a GMLAN UEF Database is used with the GMLAN UEF simulator selection, transmit or receive messages can be simulated for selected ECUs.  If any other database type is used, then Generic Simulator must be used.  This type of simulation is only for transmitting messages from selected ECUs.

Next, you must select the ECUs.  You can select one or more ECUs for any networks you are simulating (Figure 3: ). To quickly select all or unselect all ECUs you can use the two buttons at the bottom of the dialog (Figure 3: ).



Figure 3: Select simulation ECUs on the Basic Simulation Setup tab.


Modify the Simulation Messages and Signals

After the ECUs are selected, the simulator will generate a list of messages and signals required for the simulation.  The second tab in the simulator allows you to setup the messages and signals used for the simulation (Figure 4).

There are three ways to setup your simulation data.  First, you can assign an expression to each signal (Figure 4: ).  This expression can be a static value, a Vehicle Spy expression, or a signal generator function.  Next you can assign hex data to the message as a whole.  By clicking the "Setup" (Figure 4: ) hot link for a message you can enter default hex bytes for the entire message.  Finally, you can enter signal data from a replay file (Figure 4: ).  You can clear all of your setup for both messages and signals by clicking the "Clear All Customizations" button (Figure 4: ).

Each signal indicates the type of signal trigger (event or periodic), the rate for the signal, the applied expression, the data type of the signal, and the min and max value where appropriate.

Some messages appear in the list with a red line and circle - the NO symbol (Figure 4: ).  This indicates that the message is disabled.  Diagnostic messages are always disabled by the simulator.  You can manually disable any message in the message setup.

The simulation log file allows you to inject signal values into a simulation.  This Excel CSV file has columns for time and signal value.  When the time for each row is met the simulator will assign the values in the rows to the signals in the simulation.  To quickly generate a template file for use in Excel click the "Generate Template" button (Figure 4: ).  This template will create a blank file with a header line with all of the signals used in the simulation.  The log file created is compatible with the files saved in the Vehicle Spy logging and bus files that are converted.


Figure 4: Access message and signal properties from the Simulation Data tab.


Setup Signal Properties

You can apply a custom expression to each signal in the simulation.  You can accomplish this by selecting one or more signals and clicking apply expression.  When you do this the calculated signal dialog will appear (Figure 5).  In this dialog you can setup your expression for the selected signals.

The calculation type selection allows you to select one of the eight expression types (Figure 5: ).  These expression types include: 1) Random, 2) Sinusoidal, 3) Ramp, 4) Triangle, 5) Square, 6) Custom List, 7) Equation and 8) Static Value.  The static value allows you to enter a value that does not change.  The Equation type allows you to create a Vehicle Spy expression that can include data from other parts of Vehicle Spy.  All of the other types are signal generator types.  All parts of the signal generator can be controlled by an expression.  Your example waveform is shown in the right hand graph (Figure 5: ).



Figure 5: Applying an expression to a signal with the Setup Calculated Signal dialog.


Setup Message Options

Each message has setup options (Figure 6).  First, you can disable the message (Figure 6: ).  This allows you to use another part of Vehicle Spy to send this message.  Next, you can override the period in the UEF file (Figure 6: ).  For the Generic Simulator type, this must be specified or the message will not be sent.  Finally, you can enter the default message bytes (Figure 6: ).  These message bytes are entered into the message prior to applying signals from an expression or file replay.


Figure 6: Adjust message properties using the Custom Message Setup dialog.


Other Simulation Options

The simulator has a few settings that can be accessed from the options tab (Figure 7).  First, you can disable the simulator so it does not automatically start when Vehicle Spy starts (Figure 7: ).  This is useful if you are automating the simulator from a script and do not want the simulator to start until you setup some initial conditions.

The next group of settings has to do with network management for single wire CAN simulations.  First, you can generate a high voltage wake up when the simulation starts (Figure 7: ).  Second, you can have the simulator send out a VNMF message every three seconds with a specified ID (Figure 7: ).  This VNMF message will activate all VNs except for the diagnostics VN.

Note: It is possible the VNMF message the simulator sends out is not the most appropriate for your simulation.  In these cases you can disable the simulator's VNMF and generate your own using Vehicle Spy function block scripts.



Figure 7: Use the Options tab to change when the simulator starts and Network Management parameters.


Automating the Simulator

The simulator can be fully automated via the Text API which is accessible through Java, Function Blocks, and external applications.  You can automatically setup, start, and stop the simulator as your tests require.

  Vehicle Spy Documentation - (C) Copyright 1997-2011 Intrepid Control Systems, Inc.

Last Update: Monday, November 3, 2008