FAQ 021: Data Capture at Simulation Start
Question
When I download a model, the simulation starts straight away, so that it is impossible to capture the behaviour of the model at the simulation start via ControlDesk. Is there a way of to start and stop the real-time processor manually so that data capture begins at time 0.0?
Solution
Working with ControlDesk
The simState variable in each model controls the simulation state, i.e., it determines whether the simulation is stopped, paused, or running. By default, simState is initialized to RUN, so that the simulation is started immediately after download.
To initialize simState to STOP
- Modify the simulation parameters as follows:
For RTI models, select STOP or PAUSE as theInitial simulation state. You can find theInitial simulation stateon theRTI simulation optionspage under the Code Generation page in the Model Configuration Parameters dialog.For RTI-MP models, select Stop as theInitial Simulation State. You can find it on theMainpage of the Multiprocessor Setup dialog
- Build and download the model as usual.
- Start ControlDesk and prepare your experiment.
- Connect a virtual instrument, such as the Radio Button instrument, to the simState variable. Use the following values:
|
simState |
Value |
|---|---|
|
STOP |
0 |
|
PAUSE1 |
1 |
|
RUN |
2 |
1 is not supported by the DS1007 Processor Board
- Connect the variables you want to capture to a suitable data acquisition instrument, e.g., a plotter.
- Select the
Edit Capture Settingscontext menu command of the data acquisition instrument to open theCapture Settingswindow and clear theAuto Repeatcheckbox. This ensures that the captured data is not overwritten after the plot is complete. - Start Measuring in ControlDesk.
- Set simState to RUN. The data is captured from the first sampling step.
If your model is already built, downloaded, and running, you can also use ControlDesk to switch simState to STOP (see steps 4 - 8). Then restart the data capture services via the Start/Stop button in the Capture Settings window and set simState back to RUN.
Working with ControlDesk Next Generation
The approach described above also applies to ControlDesk Next Generation Version 5.0 and later, provided that the real time application was built with dSPACE Release 2013A or later.
With ControlDesk Next Generation versions prior to 5.0, it is not possible to start a measurement with simState set to STOP. You can, however, load the application with simState set to STOP, change it to RUN, and directly start the measurement. However, you will not receive the results for the first simulation steps this way.
Related dSPACE HelpDesk documents
Tags
| Date | 2026-10-01 |
| 软件类型 | 实现软件, 实验和的可视化软件, 总线和网络软件, ECU 接口软件 |
| 产品 | ControlDesk, RTI (Real-Time Interface) |
| 资料信息 | 常见问答 |
| 信息类别 | 常规使用 |
| dSPACE 版本发布 | 2013-A之前版本 |
| Keywords | Data capture, Model behavior, Simulation start, Time 0.0, SimState, RUN, STOP |