Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > System generation for simulation - C, C++ and Java code > System simulation > Simulating a system > Starting a simulation (system simulation)
  
Starting a simulation (system simulation)
1. Ensure that the application you are going to debug is ready to start, because after starting the listener DLL you must start the application within 30 seconds.
For information about making Modeler wait a shorter or longer time than the default 30 seconds, see The Listener DLL Times Out.
2. In Modeler, open the model from which the application that is being simulated was generated.
3. If the State Simulation toolbar is not shown, on the View menu, point to Toolbars, and then click State Simulation.
4. If you want to animate instance diagrams during the simulation:
a. On the State Simulation toolbar, ensure that the Animate button is selected.
b. If you want instance diagrams to be created or get the focus as necessary to follow a simulation, ensure that the Enable Open Diagram Mode button is selected.
c. If you want instance diagrams to be created or get the focus only for certain State Diagrams, open those diagrams, and ensure that the Enable Open Diagram Mode button is not selected.
5. On the State Simulation toolbar, click the Run State Machine button.
6. Start your target application.
After clicking the Run State Machine button the target application must connect to the listener DLL within 30 seconds. If the target application does not connect within 30 seconds, Modeler unloads the listener DLL.
You can now interact with the simulation.
* 
While the Run State Machine toolbar button is selected, the listener DLL is loaded and running.