| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimEvents |
| Contents | Index |
| Learn more about SimEvents |
Block information in discrete-event simulation
blkinfo(blkid)
blkinfo(blkname)
blk_struct = blkinfo(...)
blkinfo(blkid) displays information about the SimEvents block with identifier blkid. To obtain a list of blocks and their identifiers, use sedb.blklist.
blkinfo(blkname) displays information about the SimEvents block with path name blkname.
blk_struct = blkinfo(...) returns a structure that stores information about the block.
The following blocks are exceptions that do not provide information:
Conn
Discrete Event Inport
Discrete Event Outport
Discrete Event Subsystem
Discrete Event Signal to Workspace
Event-Based Random Number
Event-Based Sequence
Initial Value
Instantaneous Event Counting Scope
Subsystem Configuration
blk_struct |
Structure that stores information about the block. The following table describes the blk_struct fields and the blocks for which each field appears.
|
View information about a block:
Begin a debugger session for a particular model. At the MATLAB command prompt, enter:
sedebug('sedemo_start_timer_read_timer')Proceed in the simulation. At the sedebug>> prompt, enter:
tbreak 2.51 cont
The partial output indicates that the server is about to execute a service completion event:
Hit b1 : Breakpoint for first operation at or after time 2.510000 %==============================================================================% Executing ServiceCompletion Event (ev8) Time = 2.581301297500028 : Entity = en4 Priority = 1 : Block = Infinite Server
View information about the block that is about to execute the event:
blkname = gceb blkid = gcebid
The output is:
blkname = sedemo_start_timer_read_timer/Infinite Server blkid = blk7
Proceed further in the simulation:
step
The output shows that the entity is about to depart from the server:
%..........................................................................%
Entity Advancing (en4)
: From = Infinite Server
: To = Read TimerUse the identifier, blkid, to get information about the block and the status of entities in it:
% Display information in Command Window.
blkinfo(blkid)
% Store information in structure.
blkdetails = blkinfo(blkid)
% Store status of entities in cell array.
blkentities = {blkdetails.Entities.Status}'The output is:
Infinite Server Current State T = 2.581301297500028
Block (blk7): Infinite Server
Entities (Capacity = Inf):
Pos ID Status Event EventTime
1 en2 In Service ev4 2.7303849396254689
2 en4 Advancing ev8 2.581301297500028
3 en5 In Service ev10 2.974736350905304
blkdetails =
Time: 2.5813
Block: 'sedemo_start_timer_read_timer/Infinite Server'
BlockID: 'blk7'
BlockType: 'Infinite Server'
Capacity: Inf
Entities: [1x3 struct]
blkentities =
'In Service'
'Advancing'
'In Service'Get more information about one of the entities by using data from the blkdetails structure as an input argument to the eninfo function:
adv_eninfo = eninfo(blkdetails.Entities(1).ID); time_in_system = adv_eninfo.Timers.ElapsedTime
The output is:
time_in_system =
1.5813End the debugger session. At the sedebug>> prompt, enter:
sedb.quit
![]() | sedb.bdelete | sedb.blklist | ![]() |

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 |