| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimEvents |
| Contents | Index |
| Learn more about SimEvents |
Set breakpoint for execution or cancelation of event
evbreak(evid)
bid = evbreak(evid)
evbreak(evid) sets a breakpoint for execution or cancelation of the event with identifier, evid, in the simulation. To obtain a list of events on the event calendar and their identifiers, use sedb.evcal.
bid = evbreak(evid) returns the identifier of the breakpoint.
Set a breakpoint on a service completion event:
Begin a debugger session for a particular model. At the MATLAB command prompt, enter:
sedebug('sedemo_server_service_time')Proceed in the simulation. At the sedebug>> prompt, enter:
step over
The output is:
%==============================================================================%
Initializing Time-Based Entity Generators
%..........................................................................%
Scheduling EntityGeneration Event (ev1)
: EventTime = 0.000000000000000 (Now)
: Priority = 500
: Block = Time-Based Entity Generator
%..........................................................................%
Scheduling EntityGeneration Event (ev2)
: EventTime = 0.000000000000000 (Now)
: Priority = 500
: Block = Time-Based Entity Generator 1
%..........................................................................%
Scheduling EntityGeneration Event (ev3)
: EventTime = 0.000000000000000 (Now)
: Priority = 500
: Block = Time-Based Entity Generator 3
%==============================================================================%
Executing EntityGeneration Event (ev1) Time = 0.000000000000000
: Entity = <none> Priority = 500
: Block = Time-Based Entity GeneratorProceed further:
step over
The output, with bold added, shows that a service completion event with identifier, ev4, appears on the event calendar. The scheduled time of the event is T=1.
%..........................................................................%
Generating Entity (en1)
: Block = Time-Based Entity Generator
%..........................................................................%
Entity Advancing (en1)
: From = Time-Based Entity Generator
: To = Single Server
%..........................................................................%
Scheduling ServiceCompletion Event (ev4)
: EventTime = 1.000000000000000
: Priority = 500
: Entity = en1
: Block = Single Server
%..........................................................................%
Scheduling EntityGeneration Event (ev5)
: EventTime = 1.000000000000000
: Priority = 500
: Block = Time-Based Entity Generator
%==============================================================================%
Executing EntityGeneration Event (ev2) Time = 0.000000000000000
: Entity = <none> Priority = 500
: Block = Time-Based Entity Generator 1Set a breakpoint that causes the debugger to stop when it is about to execute the service completion event, ev4:
evbreak ev4
The output confirms the operation:
Set b1 : Breakpoint for execution or cancelation of event ev4
Run the simulation until the breakpoint:
cont
The partial output shows that the debugger proceeds through a different event at T=1, and stops upon hitting the breakpoint at event ev4. Because that event is not the first event the simulation executes at that time, the example shows how an event breakpoint differs from a timed breakpoint. A timed breakpoint at T=1 would have caused the debugger to stop upon the first event at this time, ev6.
%==============================================================================%
Executing ServiceCompletion Event (ev6) Time = 1.000000000000000
: Entity = en2 Priority = 300
: Block = Infinite Server
%..........................................................................%
Entity Advancing (en2)
: From = Infinite Server
: To = Entity Sink2
%..........................................................................%
Destroying Entity (en2)
: Block = Entity Sink2
Hit b1 : Breakpoint for execution or cancelation of event ev4
%==============================================================================%
Executing ServiceCompletion Event (ev4) Time = 1.000000000000000
: Entity = en1 Priority = 500
: Block = Single ServerEnd the debugger session. At the sedebug>> prompt, enter:
sedb.quit
sedb.bdelete | sedb.breakpoints | sedb.cont | sedb.evcal
![]() | sedb.eninfo | sedb.evcal | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |