Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from...
Transcript of Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from...
![Page 1: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/1.jpg)
1© 2015 The MathWorks, Inc.
Simulink for Teams:
High-Productivity Workflows
Gavin Walker, Development Manager
![Page 2: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/2.jpg)
2
Who am I?
Read engineering at Cambridge University,
specializing in systems & control
PhD & post-doc also in CU Engineering Dept
– Achievable Responses of Vehicle Suspension Systems
– Consultancy for F1 team on suspension systems
– Part of team that developed the “inerter”
– Been using Simulink since 1994
MathWorks
– 7 years as a consultant, working on complex simulation
problems, control & model management systems
– 10+ years heading a development team, focussed on
enabling Model-Based Design in Teams
First used MATLAB
First used Simulink
![Page 3: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/3.jpg)
3
Vision
Create tools that make it easy for teams
to collaborate on Model-Based Design
IntegrateCollaborate Analyse
![Page 4: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/4.jpg)
4
Overview
Creating solid foundations for Model-Based Design in a team
Ways to share information around a team
Components. How, where, when.
Automation. Automation. And more automation.
![Page 5: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/5.jpg)
5
Getting started with a legacy project
![Page 6: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/6.jpg)
6
Familiar?
![Page 7: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/7.jpg)
7
Experienced users might try…
Group by type in MATLAB
Look for largest model?
Load all the data files you can find
Keep pressing “run” until something works
Not an ideal process…
![Page 8: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/8.jpg)
8
Instead: create a Simulink Project from those files
![Page 9: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/9.jpg)
10
What did we see?
First, a Simulink Project: what’s that?
Dependency analysis
Shortcuts being created
![Page 10: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/10.jpg)
11
Simulink Project
Foundation technology supporting efficient
Model-Based Design in teams
– Enables sharing of work
– Ensure a project is complete (files, data)
– Consistent environment across a team (MATLAB
path, data, slprj location, …)
– Support different entry points & sharing best practice
via shortcuts
– Sharable meta-data about project contents via labels
– Part of Simulink (first shipped in R2011b)
Supports advanced users
– Impact analysis: what’s the impact of a change?
– Rich APIs to script & customize
![Page 11: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/11.jpg)
12
What did we see?
First, a Simulink Project: what’s that?
Dependency analysis
Shortcuts being created
![Page 12: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/12.jpg)
13
What is dependency analysis?
![Page 13: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/13.jpg)
14
What is dependency analysis?
Static analysis of all the files in your current project
Provide information on how the different files depend upon each other
What type of dependency
– Model Reference, Library link, model/block callback, Data Dictionary, MATLAB code
dependencies, C-code header files, …
– Long & ever growing list
Static analysis:
Models & code do not need to “work”
(do not need to simulate, run)
![Page 14: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/14.jpg)
15
What is dependency analysis?
Show model structure
List products required
Highlight issues
![Page 15: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/15.jpg)
16
What did we see?
First, a Simulink Project: what’s that?
Dependency analysis
Shortcuts being created
![Page 16: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/16.jpg)
17
Simulink Project Shortcuts
![Page 17: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/17.jpg)
18
Simulink Projects Shortcuts
Make it easy for any engineer (not just engineer who
created the project) to:
– Find important files
– Find & execute important or common operations
Make the top-level model in the project a shortcut
– All debuggable
Optionally set shortcuts to run at project startup or shutdown
– Provides formal mechanism for running initialization scripts
– Makes it easier to ensure the symmetric shutdown scripts are called
![Page 18: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/18.jpg)
19
Demo
1. Automate loading of data when the project opens using shortcuts
2. Explore the existing utilities in the project that are not instantly accessible
![Page 19: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/19.jpg)
20
Using Simulink Projects to Create a Consistent Cross-
Team Environment
We saw Project Shortcuts being used to
– Check MATLAB version, compiler version, etc.
– Set (and re-set) the MATLAB path
– Make available (the right version of) company utilities
– Load data
– Highlight entry points into the Project
Benefits:
– Everyone on the team has the same environment
– New team members can get started more quickly
– Less wasted time debugging discrepancies
![Page 20: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/20.jpg)
21
Simulink Project: A Foundation Technology
Set up the MATLAB
Path for this project
Set default model template
No more issues with
unexpected
shadowed models
Set team preferencesSet “slprj”
location
Shortcuts to key
functionality
![Page 21: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/21.jpg)
22
Simulink Project: A Foundation Technology
Robustly configure the
team environment.
For everyone.
Automatically.
![Page 22: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/22.jpg)
23
Integration with Source Control
![Page 23: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/23.jpg)
24
Managing versions of files
Short aside…
![Page 24: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/24.jpg)
25
How do people share & manage projects?
Q: “How do you manage the files and data
within your projects?”
1. Named folders (“project_v1”, “project_v2”, etc.)
2. Source Control tool
3. Application Lifecycle Management (ALM) tool
At an SAE webinar on “Model-Based Engineering”, asked:
![Page 25: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/25.jpg)
26
How do people share & manage projects?
Majority use COTS tools for managing
work & sharing information
Source control
Application Lifecycle Management
(ALM)
Surprise was number just using the file
system
Doesn’t scale well
Doesn't support team work
So why were they doing it?
© SAE International Source: SAE survey of participants
of “Model-Based Engineering” webinar, April 2014
15%
32%
53%
ALM Named
Folders
Source
Control
![Page 26: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/26.jpg)
27
Source Control Integrations
Published Java API
+ SDK for integration
with other tools
Published API
Other
source
control
tools
Custom
Integration
Simulink Project
(R2011b) &
MATLAB Current
Folder Tool
(R2014b)
![Page 27: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/27.jpg)
28
Source Control Integrations
Web search for “p4sl”
Supports R2014a onwards
![Page 28: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/28.jpg)
29
Source Control Integrations
Microsoft Team Foundation
Server (TFS) integration
available now from
MathWorks File Exchange
And more…
Supports
R2014a
onwards
![Page 29: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/29.jpg)
30
Demo: Add our project to Source Control
Just press a button, browse to repo and done.
Can see revision info
Best: get a new view of the project: Modified Files
![Page 30: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/30.jpg)
31
Working out what has changed;
getting it peer reviewed
![Page 31: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/31.jpg)
32
Support for team source control workflows
Part of Simulink Report Generator
![Page 32: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/32.jpg)
34
Simulink File Comparison & Merge
Requires Simulink Report Generator
Merge desired changes back into
main development branch
– High level: bring in entire subsystems &
Stateflow charts
– Fine grained: individual blocks &
parameters
![Page 33: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/33.jpg)
35
Simulink File Comparison & Merge
Requires Simulink Report Generator
Create detailed report of changes
– Word doc editable for peer review workflows
![Page 34: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/34.jpg)
36
Source Control integration is not Essential… Just useful
Can continue to manage your files using your source control tool directly
All information about the project is stored in simple XML files
Just check them in together with your design files
Get all the benefits of a project apart from the Modified Files view
![Page 35: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/35.jpg)
37
Quick recap of what we’ve seen so far…
Simulink project: foundation for efficient team work
– Dependency analysis
– Shortcuts
Integration with source control
– Support for peer review of changes
– Diff & merge support
![Page 36: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/36.jpg)
38
Organizing files in a large project
![Page 37: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/37.jpg)
39
Pick a folder structure that works for your team
Creating a folder structure helps partition files into logical areas
Helps keep the project maintainable
My recommendations
– Few/no files in the root folder
If something needs to be found easily, just make it a shortcut
– Group by component, not task
![Page 38: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/38.jpg)
42
Allows for separation of tests from models/data
Easy to ensure test code and models are not
being relied upon by your design
But…
– If it’s not working, just change it!
![Page 39: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/39.jpg)
43
Making your workflows mistake-proof
“I don’t want to ever have to write code
to configure the MATLAB environment
for my project”Customer quote from 2014
![Page 40: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/40.jpg)
44
Code to set the MATLAB Path
(Only the code using the project root folder is recommended!)
![Page 41: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/41.jpg)
45
Simulink Project: MATLAB Search Path Management
No longer need to write MATLAB code
run as startup shortcuts to manage
MATLAB’s search path
Project path folders automatically
– Added to MATLAB search path on
project start
– Removed from the MATLAB search path
on project close.
Path is added in an OS neutral way
Automatically manage your MATLAB
search path with your projects.
» sldemo_slproject_airframe
Icon shows folders
managed via Simulink
Project
Path management via
new Path Manager UI
![Page 42: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/42.jpg)
47
Mistake-proofing within a project: Refactoring
One of the models in my project has
the wrong name
– “lift_door.slx” should be
“lift_doors.slx”
What’s the impact of fixing this on
– This Simulink file
– Models that use it
– MATLAB scripts & callbacks that use it
– The source control repository
– ?
![Page 43: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/43.jpg)
48
Impact analysis supports refactoring
Three other files
required modification2 Source control
rename (add/remove)4
Add new file to project;
remove old file3
Renamed “lift_door”1
![Page 44: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/44.jpg)
49
Creating Simulink Components
![Page 45: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/45.jpg)
50
Simulink Architectural Components
Virtual subsystem
– Graphical component – The contents are flattened to the level of the
parent system during execution.
Atomic subsystem
– Simulink executes all blocks as a unit before executing the next
block
– Context dependent so inherits properties such as dimensions and
data types from the parent model
Model block
– Executed as a unit
– Context independent so doesn’t inherit properties from parent model
![Page 46: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/46.jpg)
51
Component selection strategy
Virtual and Atomic Subsystems
– When scalability is not an issue
– When the atomic subsystem boundary is acceptable
– During early development of the system
Model Reference
– When scalability is needed
– When hard interfaces are critical
– To enable concurrent teamwork and unit testing
Library Components
– Reused utility functions
![Page 47: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/47.jpg)
52
Some “Project Level” requirements for handling large models
Many engineers must work on different aspects of the same model
simultaneously
– Combine (& recombine) different engineers’ work
– Ensure testing is performed consistently
– Ensure a good audit trail is kept
Projects often have a (very) long life-span
– Control bug-fixes and updates
– Reuse components from Project X on Project Z?
Plus many other company-specific requirements
![Page 48: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/48.jpg)
53
Component-Based Modelling
Picking the right size for components is key:
– Large enough to
Contain enough to be useful
Be likely to be re-used
– Small enough to
Be worked on by just one engineer at a time
Be likely to be checked out for editing for relatively short periods of time
Getting this right can reduce the effort of merging the work of many engineers
– Combining updated components is easier than merging Simulink models
Refer back to the physical system where possible
– A model with inputs of a measured current and an absolute force might not be right…
![Page 49: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/49.jpg)
54
This subsystem has same
name as parent model
Probably not the best name
What is it..?
![Page 50: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/50.jpg)
55
Demo
Refactor into a new Model Reference
Advisor helps automate/mistake proof the process
Dependency analysis helps ensure we don’t “lose” this new component
Refactoring support for the rename
Find dependencies helps work out why there are some other components
with poorly chosen names (like “lift_intertia”)
![Page 51: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/51.jpg)
56
Enhance “New Simulink Model”…
W
![Page 52: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/52.jpg)
57
Model Templates
Use shipped templates to get started with
building models or create custom templates to
from a Simulink model
– Avoid problem of corrupting original file
when creating a new model
Avoid repetitive tasks when starting out to
build a new model
Enforce a standard process for building
models for the entire team or organization
Build models using design patterns that
serve as starting points to solve common
problems
![Page 53: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/53.jpg)
58
Create templates relevant to the current project
Templates registered via the MATLAB path
Straightforward to add a template relevant to
the current project
– And remove it later when the project is closed
(or path removed)
Common uses for templates
– Specific configuration set (e.g. fixed step,
hardware set up, etc)
– Company copywrite
![Page 54: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/54.jpg)
59
Managing Parametric Data
![Page 55: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/55.jpg)
60
Handling model design data
How can I tackle these challenges of using the MATLAB workspace?
Mixed with other MATLAB data
Lack of organization: hierarchy, componentisation
Ease of change detection
What was the source of the data?
Data conflict – multiple files writing to same variable name
![Page 56: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/56.jpg)
61
Data Dictionary provides:
Clarity of base workspace
Avoids risk of running with incorrect data, or data clash
Organised data hierarchy
Ease of data re-use
Integrated change management
Simulink
SLX
FileSLX
File
Model 1
Model 2
Model 3
SLX
File
SLDD
FileSLDD
FileSLDD
FileGlobal Data
![Page 57: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/57.jpg)
62
Data Dictionary API
Automate the creation and editing of data dictionaries
with MATLAB scripts
Migrate models to use data dictionaries
Import & export data
Create, delete, and reassign data
Save or discard changes to entire dictionaries or individual
entries
![Page 58: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/58.jpg)
63
Demo
Start to migrate data out of base workspace to Data Dictionaries
Model Properties > Data
![Page 59: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/59.jpg)
64
Other types of component
![Page 60: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/60.jpg)
65
Projects can reference other projects
Develop reusable components using
projects
Flexible referencing:
– Relative
– Absolute
Extract folders to referenced projects
Deep hierarchies are supported
Componentize large modelling projects
» sldemo_slproject_airframe_references
![Page 61: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/61.jpg)
66
Simulink Protected Model
Requires Simulink® Coder™
Sometimes you don’t want to share all your IP
– Supplier, customer
Sometimes it’s useful to not expose internals of models
– Robust transfer between different groups
Simulink Protected model can help here
![Page 62: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/62.jpg)
67
Encryption
Simulink Protected Model
Simulation binary Generated code
c
Model Web view
mex
01100111
11101010
01011001
SLXP
Export
SLX
Requires Simulink® Coder™
![Page 63: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/63.jpg)
68
Creating Protected Model
![Page 64: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/64.jpg)
69
Add Model block that points to SLXP
Using Protected Models
![Page 65: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/65.jpg)
70
Using labels to share & store
information
![Page 66: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/66.jpg)
71
Using Labels to Add Information to the project
Done lots of work to understand what the different parts are
Wouldn’t it be nice to record that so others don’t have to repeat this?
What are labels?
Apply some labels to the project
![Page 67: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/67.jpg)
72
Simulink Project Labels
Easily see and edit label data for all labels
attached to a file.
Use drag and drop to add labels.
Easily switch between single-valued labels.
Easily add, modify and view labels
attached to a file.
![Page 68: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/68.jpg)
73
Note on Metadata
What do we mean by metadata?
Wikipedia: “Data about data”
MathWorks: “Data about files”
Data that is about the file, not (necessarily) part of it. For example:
FuelType = Gas, Diesel
ReleaseStatus = Research, Prototype, Production, Sunset
SecurityClassification = Unclassified, Protected, Restricted, Confidential
FileClassification = Design, Derived, Artefact
TestedWith = R2010b, R2011a, R2011b, ...
Coverage Metric = 84%
Metadata can change without the file it relates to having to change.
Metadata
![Page 69: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/69.jpg)
74
Labels + Dependency analysis = Impact Analysis
“What is the impact of
changing the supervisory
control model?”
“What tests do I need to run
to verify those changes?”
All accessible from
command-line API for full
automation
![Page 70: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/70.jpg)
75
More options for automation
![Page 71: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/71.jpg)
76
Why Automate?
Automated Processes Get Done
– Regularly (if needed)
– Repeatably
– Can be done by anyone
Corollaries
– Manual processes are often infrequently done
– Can be subject to variation
– Perhaps only one person can do them
![Page 72: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/72.jpg)
77
How can Automation in Simulink Project help?
Now anyone can rebuild the S-Functions
– (or run the tests; generate code; publish the reports; import & validate test data; …)
– Even at 8:34pm on a Friday night; on a testing trip; …
Groups help provide structure
– Group by type; or by job function (project manager group; testing group)
![Page 73: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/73.jpg)
78
Automation Options in Simulink Projects
Build-in “best practice” support
– Project Checks
– Growing list of our own “gotchas”
![Page 74: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/74.jpg)
79
Batch Operations on Project Files
Execute a MATLAB function on some or all
of the files in
a project from the GUI for automation tasks
Filtering supports selection
of files
Results are displayed in the Batch Job View
Execute project-wide operations
authored in MATLAB on batches of files
» sldemo_slproject_batchjobs
![Page 75: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/75.jpg)
80
Some Example Batch Jobs
Very small amount of code
required
Common patterns
– Is this a file of type X?
– Does this file have a label
from category X with value Y?
![Page 76: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/76.jpg)
81
Some Example Batch Jobs
1. Run MATLAB code checker on all my .m and .mlx files
2. Check the company copyright is added to all my files
3. Position all my Simulink models so they fit on the screen of my laptop
4. Export all my Simulink files to an earlier release of MathWorks tools
5. Generate a Bill of Materials
6. …
Email [email protected] if you want any of these
![Page 77: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/77.jpg)
82
Simulink Project API
Easily access information form the project
Add, remove, inspect files & labels
If under source control,
See source control information for files
Get the list of modified files
New in R2016a:
Source control information
![Page 78: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/78.jpg)
83
More options for sharing
![Page 79: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/79.jpg)
84
Most Common Challenge in Sharing Work
“It works on my computer, just not on yours…”
Common causes:
Incomplete set of files
Different environment
– (software versions, MATLAB path, …)
Wrong data loaded
What do I do to get started?
?
![Page 80: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/80.jpg)
85
Sharing work outside source control
Simulink Project has built in capabilities for sharing
GitHub
– Collaborative sharing
– Expect to make changes together
Archive file
– Fast sharing of “what I’m doing now”
– “Delivery” workflows:
Send a package of work
Work independently
Receive a package of work back
![Page 81: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/81.jpg)
86
How much to share?
Typically don’t want to share all my project with a
supplier or customer
Reduce to the minimum to
– Avoid sharing IP I want to keep in-house
– Keep it simple
Create “Export Profiles” to manage which
files are exported from project
– Uses project labels to set up exclusion rules
– Set up many profiles for different workflows
Sharing to supplier (share only what is needed)
Share to customer (shield my IP)
Share to HIL rig (no tests, doc, requirements)
Etc.
![Page 82: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/82.jpg)
87
Bringing it all together
![Page 83: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/83.jpg)
88
We have seen
Simulink Projects
– Foundation technology for model-based design in a team
– Allows creation & sharing of a consistent team environment
– Supports automation of common (& uncommon) tasks
Links to source control
– Tools for efficient peer reviews of changes
– Add source control information to your process via the project API
Options for components
– Model Reference, libraries, Data Dictionaries
– Templates for sharing team settings
![Page 84: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/84.jpg)
89
Thank you!
![Page 85: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/85.jpg)
90
Back-up Slides
![Page 86: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/86.jpg)
91© 2011 The MathWorks, Inc.CONFIDENTIAL
Settings for Robust File Management
![Page 87: Simulink for Teams: EXPO 2016 · – Added to MATLAB search path on project start – Removed from the MATLAB search path on project close. Path is added in an OS neutral way Automatically](https://reader033.fdocuments.us/reader033/viewer/2022041416/5e1bc19843686a5ca41587ca/html5/thumbnails/87.jpg)
92
Setting up Simulink Preferences for Teamwork
• Use start-up scripts to confirm the project environment
• Ensure Simulink Preferences are set appropriately
• Recommend settings shown below
1. Turn on change notification
2. Turn on auto-save
3. Turn on cross-version backup file
4. Notify when opening old models
5. Refuse to load models from a
future version