
2 Building Simple Models with SimEvents Software
2-16
set_param('MyModel/Time-Based Entity Generator','position',[65 63 150 117]);
The position parameter specifies the top left (x,y) and lower right (x+block width, y
+block height) corners of the block.
Add the FIFO Queue block and position it.
add_block('simeventslib/Queues/FIFO Queue','MyModel/FIFO Queue');
set_param('MyModel/FIFO Queue','position',[195 63 280 117]);
Connect the blocks.
add_line('MyModel','Time-Based Entity Generator/RConn1','FIFO Queue/LConn1','autorouting','on');
Port indices, such as Time-Based Entity Generator/RConn1, correspond to the top-
down order of connection ports when you look at the block in the Simulink Editor. The
autorouting feature routes lines around any intervening blocks or other lines, as needed.
Note: If you want to connect blocks that are inside a subsystem, use the full path to the
subsystem as the first argument of the add_line function:
add_line('MyModel/MySubsystem', 'Time-Based Entity Generator/RConn1',... )
Comentários a estes Manuais