|On this page…|
The animation capability animates the entities and signals in a SimEvents® model. With animation, you can observe SimEvents entities and signals as they move through the model. This behavior is enabled by default in the debugger. With animation, you can observe the following operations listed in this table.
Entity advancing through the block.
Path history for the currently active entity motion. In the case of a virtual subsystem, this icon indicates that the entity is advancing within the subsystem; to observe that animation, open the subsystem. When the darker icon appears outside the subsystem, it indicates that the entity has exited the subsystem.
Signal update currently being executed.
Signal blocks executed so far for currently independent operation. In the case of a virtual subsystem, this icon indicates that the signal updates are occurring within the subsystem; to observe that animation, open the subsystem. When the darker icon appears outside the subsystem, it indicates that the signal has exited the subsystem.
Enabling entity animation also displays the number of entities currently in the storage block in the bottom left corner of the block icon, as follows. This text appears on all storage blocks in the model. The software updates this number as simulation proceeds.
In this block, the 0 of 1 indicates that no entity is currently in the storage block.
Use the sedb.animate command to control animation settings. For example, you can turn the animation off and on, control the animation speed, and so forth.
By default, animation of a SimEvents model is enabled without the debugger. To view the animation, in the MATLAB® Command Window, start the debugger for that model (sedebug('model').
At the debugger prompt, to disable animation, type:
To restart animation, type:
Alternatively, you can type animate to toggle animation on and off.
The sedb.detail command controls the amount of animation content in the model. By default, animation is enabled for signals and entities.
If you want to disable the animation of entities and signals, use the detail to disable them. For example:
detail('en', 0, 'sig', 0);
This command also disables all animation. Turning off entity details also turns off the display of the number of entities currently in storage blocks.
By default, the animation delay is 0.0 seconds. You can change the animation speed by specifying a value between 0.0 and 5.0 seconds as the animation delay. For example, the following command slows the animation to update every 5 seconds:
If you turn off the animation and then turn it on again, the animation delay is that of the previously specified delay value.
Begin a debugger session for the model. At the MATLAB command prompt, type:
Turn on animation with an update delay of 0.5 seconds. Turn off debugger text output.
animate on 0.5; detail off
Simulate the model to the end.
Observe the animation in the model, as illustrated.