You can configure the SimEvents® debugger to include or omit certain kinds of messages in its simulation log. You can focus on the messages that are relevant to you by omitting irrelevant messages.
The overall configuration regarding including or omitting messages is called the debugger's detail settings. Each individual category of messages that you can include or omit corresponds to an individual detail setting. A particular detail setting is on if the simulation log includes messages in the corresponding category.The setting is off if the simulation log omits messages in the category.
detail function lets you configure
and view detail settings. The following table lists the available
detail settings and the programmatic names that you see as inputs
or field names when you use the
|Category of Messages||Programmatic Name in detail Function||Further Information About Messages in Category|
|Event operations, except independent operations representing event executions||Event Scheduling, Execution, and Cancelation Messages|
|Entity operations||Entity Operation Messages|
|Event calendar information||Optional Displays of Event Calendar in the Simulation Log|
|Signal operations||Signal Operation Messages|
Messages that you cannot selectively omit from the simulation log include messages about independent operations, such as the execution of events on the event calendar. Messages about independent operations appear whenever any of the detail settings is on. The reason for including messages about independent operations is that they provide a context in which you can understand other messages. To learn more about independent operations, see Independent Operations and Consequences in the Debugger.
Different debugging scenarios benefit from different detail settings. Use these suggestions to help you choose appropriate settings for your needs:
step to proceed in
the simulation, include event or entity operations in the simulation log if
you want the debugger to suspend the simulation at such operations
to let you inspect states.
When using breakpoints to skip a large portion of
the simulation that is irrelevant to you, omitting all messages (
none) can prevent the Command Window from accumulating a
lot of simulation log text that does not interest you.
If you use
If you want to inspect final states but are not interested
in the simulation log, omit all messages (
and then enter
cont. The simulation proceeds until
the built-in breakpoint at the end of the simulation, with minimal
text in the simulation log.
If you want to focus on entities instead of events,
detail('en',1,'ev',0, 'sig', 0). The simulation log still
shows independent operations, but the dependent operations in the simulation log exclude
event scheduling, cancelation, and execution operations.
If you want to focus on events instead of entities,
detail('en',0,'ev',1, 'sig', 0) or
If you want to focus on signals instead, try
If you are not sure which messages in the simulation log might be useful for later reference, consider these approaches:
If you include less information in the simulation log, the simulation might run more quickly and the simulation log might be more manageable. However, you risk missing important information and having to run the simulation again to see that information.
If you include more information in the simulation log, it might be harder for you to find the relevant portions. Using Edit > Find in the Command Window might help you see the portions of interest to you.
Reducing textual output in the Command Window can save time.
The behavior of
related. If you change the detail settings from their default values
to cause the simulation log to omit entity messages or event messages,
then you cannot step to an operation that corresponds to an omitted
message, unless a breakpoint coincides with the operation. A specific
example of this behavior follows.
If your detail settings cause the simulation log to omit all messages
(equivalent to the
detail none command), you cannot
step to anything other than breakpoints. In the absence of breakpoints,
a step causes the simulation to proceed until the end. If you inadvertently
reach the end of the simulation in this way and want to return to
the point in the simulation from which you tried to step, use a time
or event identifier that appears in the Command Window to set a breakpoint
in a subsequent debugging session. For example, if the last message
in the simulation log, before you inadvertently stepped too far, indicates
the execution of event
ev5, then you can exit the
debugger session, restart it, and enter
evbreak ev5; cont.
Skip Entity Operations When Stepping
When the detail setting for entity operations is off, the simulation log omits messages about entity operations and you cannot step to entity operations.
Open and debug a model. At the MATLAB® command prompt, enter:
Omit entity operation messages. At the
Proceed with the simulation. At the
enter the following command six times in succession:
The output reflects that when you step through the simulation, the debugger does not suspend the simulation upon the entity's generation, advancement, attribute assignment, or destruction. The reason is that the detail setting for entity operations is off.
Detected Sample Time Hit Time = 0.000000000000000 : Block = Subsystem/Event-Based Entity Generator sedebug>> step %..........................................................................% Scheduling EntityGeneration Event (ev1) : EventTime = 0.000000000000000 (Now) : Priority = SYS1 : Entity = <none> : Block = Subsystem/Event-Based Entity Generator %==============================================================================% Executing EntityGeneration Event (ev1) Time = 0.000000000000000 : Entity = <none> Priority = SYS1 : Block = Subsystem/Event-Based Entity Generator sedebug>> step %..........................................................................% Scheduling ServiceCompletion Event (ev2) : EventTime = 0.055383948677907 : Priority = 500 : Entity = en1 : Block = Subsystem/Infinite Server %==============================================================================% Executing ServiceCompletion Event (ev2) Time = 0.055383948677907 : Entity = en1 Priority = 500 : Block = Subsystem/Infinite Server %==============================================================================% Detected Sample Time Hit Time = 0.100000000000000 : Block = Subsystem/Event-Based Entity Generator
End the debugger session. At the
To view the current detail settings in the Command Window, at
sedebug>> prompt, enter:
The output looks like this, where the
depend on your current detail settings:
Event Operations (ev) : on Entity Operations (en) : off Signal Operations (sig) : on Event Calendar (cal) : off
If a line in the output says
on, the simulation log shows
the corresponding type of message. Otherwise, the simulation log omits
the corresponding type of message.
To change detail settings, enter a
that includes one or more inputs. For available syntaxes, see the
reference page for the
Tips to help you select a suitable syntax are:
To change one or more detail settings but not all detail settings, use inputs that specify the name and new value of the detail settings you want to change. Detail settings you omit from the syntax remain unchanged.
To change all detail settings, use inputs that specify the name and new value of all detail settings. One way to ensure that you include all settings in the command is to use a structure variable containing the current settings as a starting point. For an example, see Include Event Calendar Information Using a Structure.
To make it easier to restore previous settings later, use a syntax that includes an output. For details, see How to Save and Restore Detail Settings.
To learn which messages in the simulation log correspond to each detail setting, see Customizable Information in the Simulation Log.
For suggestions on choosing which messages to include or omit based on your debugging situation, see Tips for Choosing Appropriate Detail Settings.
Include Event Calendar Information Using a Parameter/Value Pair
To cause the simulation log to include event calendar information
but not change any other detail settings, at the
The output includes the following line confirming the change:
Event Calendar (cal) : on
Include Event Calendar Information Using a Structure
Entering these commands at the
has the same effect as the example above and also creates a structure
s, that records the new detail settings:
s = detail; % Get current detail settings. s.cal = 1; % Change value of cal field of structure s. detail(s); % Use s to change cal detail setting.
If you expect to change detail settings frequently or temporarily
during a debugger session, you can use an output from the
to facilitate restoring previous settings. Use this procedure:
When changing detail settings, enter a
that includes an output. The output variable records the settings before they
change to correspond to the inputs that you specify in your command.
When you want to restore the earlier detail settings,
use the variable as an input to
As a special case, you can restore default detail settings.
sedebug>> prompt, enter
Omit and Reinstate Entity Messages
To cause the simulation log to include event calendar information
and also create a structure variable,
records the previous detail settings, at the
prev = detail('cal',1) % Record settings and then change them.
The next command restores the earlier settings:
detail(prev) % Restore previous settings.