in this video let's take a look at new
capabilities and enhancements and
simulate for modeling runtime software
you will see capabilities that support
how you model simulate and target
simulant components for embedded
software frameworks one example of this
are simulating functions simulating
functions have been around since release
our 2014 be and initially they were
global in scope so you could call them
from any part of the model now we're
introducing scoping which helps you
encapsulate components that means that
you can have simulant functions within a
subsystem closer to where they're used
and also scoped to that subsystem if you
need to call that function outside of
the subsystem you can do that too by
simply using the dot notation meaning
subsystem name dot function name and you
have the option to use function
connectors that show you the graphical
connections between Simulink functions
and their colors if you're using model
references simulant functions can also
cross the model boundaries so that can
help you model share resources in a
reusable software component so these
scoping capabilities are helpful for
promoting componentization and reuse in
your designs another example of new and
better ways to model software components
are initialized reset and terminate
functions and state reader and writer
blocks and these are all important
because they enable new modeling
workflows for instance you can model
functions that embedded systems use to
start up and shut down and you can
customize and aggregate these functions
in the generated code and with the state
reader and writer blocks you simplified
state setting and reading in response to
initialize and terminate events and
these are all important behaviors for
development of electronic control units
or ECU's
now let's imagine that you have to
explicitly control the execution of your
model components before 17 be the only
option was to create an export function
model starting in 17 B we introduced the
ability to schedule rate based models
which you can do with something like a
stay flowchart schedule components give
you full control over how those
components in your models execute and
they give you the flexibility to easily
combine different modeling styles so
export functions rate based styles in
your models so--that's schedule
components you may be working on systems
with distributed architectures perhaps
you're integrating software components
using middleware and components in these
software compositions generate events
and data asynchronously so modeling and
generating code from that message based
communication can be a challenge so to
make that challenge easier we introduced
a new library in simulant called
messages and events and messages are
useful because they combine events with
data and there are blocks for sending
receiving and queueing messages and
other blocks like the sequence viewer to
visualize all event activity in a model
before stateflow and sim events were the
main ways to work with messages now you
can tackle even more complex use cases
with all these tools simav ents is a
great addition to handle things like
message routing and delays between
components and stateflow is great for
state management logic and handshaking
keep in mind that cogeneration is not
supported with sim events but you still
get all the value of simulation and
understanding how your system behaves
and there are many examples available
for this new library to help you get
started alright we've seen new ways to
model software compare
and new ways to simplify the integration
of those software components now let's
talk about visualization and control we
know that we can schedule components in
rate based models with a state flow
chart but what if you have to schedule a
hundred components or maybe 500
components that's where the schedule
editor is really valuable and that is
because it helps you manage that
scheduling process that means that you
can now visualize in a single interface
different model partitions and their
relationships for execution but more
importantly you can control and change
those relationships and the order and
this is true for both export function
modeling style and rate based modeling
style there is also a sequence viewer
block to help you visualize the messages
and events in your models so you see
that in the y-axis the sequence viewer
shows you time and in the x-axis what
you see is the sequence of events that
are happening in the model and you can
also see the data that is transmitted
through each one of these events I
mentioned that when you're modeling
runtime software you probably will end
up Auto generating code from your models
and in the past the code generators only
produced column-major C code now you
have the option to generate column-major
or row-major code and that's valuable
because depending on the algorithm
row-major can improve the performance
and make it easier to integrate with
external code or frameworks and as usual
there are examples to walk you through
how to do this and I will show you a
really simple case so you want to
generate code for this lookup table here
by default you would get column-major
code but we can change that with just a
few clicks so we definitely want to do
this efficiently the first thing is to
make sure
that the array layout setting matches
the algorithm setting in the
configuration parameters of the model so
under the interface pane we select row
major for the array layout under the
math and data type optimizations pane we
check algorithms optimized for row major
array layout then we build our model and
now you see that when we auto generate
code we get efficient code in row major
layout and that brings us to the end of
modeling runtime software see you in the
next video