{"id":109,"date":"2010-11-19T21:24:17","date_gmt":"2010-11-19T21:24:17","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/2010\/11\/19\/bus-signals-past-present-and-future\/"},"modified":"2010-11-19T21:24:17","modified_gmt":"2010-11-19T21:24:17","slug":"bus-signals-past-present-and-future","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2010\/11\/19\/bus-signals-past-present-and-future\/","title":{"rendered":"Bus Signals: Past, Present and Future"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/guy_rouleau_small.png\" alt=\"Blogger, Guy Rouleau\" style=\"float: left; margin-right: 1em;\">By <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/31651\">Guy Rouleau<\/a><br><br>\r\n\r\nThe first time I used buses in Simulink, it was version 3.0 (R11). Bus signals and the way we use them in Simulink have evolved over time.  In this post I want to give you a historical tour of how the bus has changed since R11.  To start, in R11 I'm not even sure I should call it a bus. Why? Let's look at the Signal & Systems section of the R11 Simulink Library Browser:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2010Q3\/R11_Library_Browser.png\" alt=\"Simulink Library Browser - MATLAB R11, notice, it doesn't have a Bus Creator.\" \/><\/p>\r\n\r\n<p>If you have good eyes, you probably noticed there is a <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/busselector.html\">Bus Selector<\/a> block in R11, but no <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/buscreator.html\">Bus Creator<\/a> block. At that time, the way to create a bus was using the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/mux.html\">Mux<\/a> block.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2010Q3\/R11_buses_model.png\" alt=\"Creating a bus in Simulink 3.0 (R11)\" \/><\/p>\r\n\r\n<p>Since that time, buses and muxes are slowly moving away from each other. To illustrate this, I went through the <a href=\"https:\/\/www.mathworks.com\/help\/doc-archives.html\">Archived MathWorks Documentation<\/a>.<\/p>\r\n\r\n<p><strong>R13sp2<\/strong><br>\r\n\r\nThis is the oldest documentation available in the archive. The <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R13sp2\/toolbox\/simulink\/slref\/buscreator.html\">Bus Creator<\/a> is now available.<\/p>\r\n\r\n<p><strong>R14sp2<\/strong><br>\r\n\r\nA new diagnostic is introduced: <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/gui\/bq8t6s8.html#bq8t67c-1\">Mux blocks used to create bus signals<\/a>. Setting this diagnostic to error enforces what is called <em>strict bus behavior<\/em>. To help users receiving errors when enabling this diagnostic, a <a href = \"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/bq6d4aa-1.html\">Model Advisor check<\/a> and the function <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R14sp2\/toolbox\/simulink\/slref\/slreplace_mux.html\">slreplace_mux<\/a> is introduced.<\/p>\r\n\r\n<p><strong>R2007a<\/strong><br>\r\n\r\nNow the differences become more significant:\r\n\r\n<ul>\r\n\t<li>A documentation section titled <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2007a\/toolbox\/simulink\/index.html?\/help\/releases\/R2007a\/toolbox\/simulink\/ug\/bq4jp6i.html\">Intermixing Composite Signal Types<\/a> is created.<\/li>\r\n\r\n\t<li>A new diagnostic is introduced: <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/gui\/bq8t6s8.html#bq8t66m-1\">Bus signal treated as vector<\/a>.<\/li>\r\n\r\n\t<li>A paragraph titled <a href = \"https:\/\/www.mathworks.com\/help\/releases\/R2007a\/toolbox\/simulink\/index.html?\/help\/releases\/R2007a\/toolbox\/simulink\/ug\/f11-35866.html\">Avoiding Mixed Composite Signals When Developing Models<\/a> states the following:<br><br>\r\n\r\n<p><em>\"The MathWorks discourages the use of mixed composite signals, and may cease to support them at some future time. The MathWorks therefore recommends upgrading existing models to eliminate any mixed composite signals, and permanently setting Mux blocks used to create bus signals and Bus signal treated as vector to error in all new models and all existing models that may undergo further development.\"<\/em><\/p><\/li><\/ul>\r\n\r\n<p><strong>R2008b<\/strong><br>\r\n\r\nThe documentation page titled <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2007a\/toolbox\/simulink\/index.html?\/help\/releases\/R2007a\/toolbox\/simulink\/ug\/bq4jp6i.html\">Intermixing Composite Signal Types<\/a> is renamed <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2008b\/toolbox\/simulink\/index.html?\/help\/releases\/R2008b\/toolbox\/simulink\/ug\/bq4jp6i.htm\">Avoiding Mux\/Bus Mixtures<\/a>. Can it be clearer?<\/p>\r\n\r\n<p><strong>R2010a<\/strong><br>\r\n\r\nOne more diagnostic is introduced to help avoiding Bus\/Mux mixture: <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/gui\/bq8t6s8.html#bsdiq7d-1\">Non-bus signals treated as bus signals<\/a><\/p>\r\n\r\n<p><strong>R2010b<\/strong><br>\r\n\r\nStarting in R2010b, the diagnostics <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/gui\/bq8t6s8.html#bq8t67c-1\">Mux blocks used to create bus signals<\/a> is set to error by default when creating a new model. This is one more step toward the deprecation of mixed composite signals.<\/p>\r\n\r\n<p><strong>The Future<\/strong><br>\r\n\r\nI cannot really predict the future, but I know that when implementing new features, Simulink developers now take into account that Mux blocks will not be used to create buses.  This is why many new features require the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/gui\/bq8t6s8.html#bq8t67c-1\">Mux blocks used to create bus signals<\/a> diagnostics being set to error. These features include for example:<\/p>\r\n\r\n<ul>\r\n\t<li><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/ug\/bsocrb0.html\">Array of buses<\/a><\/li>\r\n\r\n\t<li><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/ug\/bsff8zh.html\">Specifying Initial Conditions for Buses<\/a><\/li>\r\n\r\n\t<li><a href = \"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/constant.html#bslokor\">Support of bus object data type for Constant blocks<\/a> <\/li>\r\n\r\n\t<li><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/ug\/f4-141943.html\">Converting a Subsystem to a Referenced Model<\/a><\/li>\r\n\r\n\t<li><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/ug\/bq4h5ej-1.html#bshrkah\">Getting information about type and hierarchy of a bus<\/a> using the <tt>CompiledBusType<\/tt> and <tt>SignalHierarchy<\/tt> properties.<\/li>\r\n\r\n\t<li>Bus Support in <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/signalspecification.html\">Signal Specification<\/a> block<\/li>\r\n\r\n\t\r\n\t<li><a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/gui\/bq8t6qh.html#brphwdw-1\">Simplified detection of underspecified initialization<\/a><\/li>\r\n\r\n\t<li>More robust and consistent behavior for the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/toolbox\/simulink\/slref\/discretetimeintegrator.html\">Discrete-Time Integrator<\/a> block.<\/li>\r\n\r\n<\/ul>\r\n\r\n<p>The number of features in this list increases every release, so if you don't avoid mux\/bus mixture in your models, you will miss a lot of cool stuff!<\/p>\r\n\r\n<p><strong>Conclusion<\/strong><br>\r\n\r\nThe settings we recommend are:\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2010Q4\/BusDiagnostics.png\" alt=\"Recommended settings for Buses\" \/><\/p>\r\n\r\n<\/p>\r\n\r\n<p><strong>Now it's your turn<\/strong><\/p>\r\n\r\n<p>Have you already converted to strict bus mode? If not, let us know why by posting a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=109&amp;#comment\">comment here<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>By Guy Rouleau\r\n\r\nThe first time I used buses in Simulink, it was version 3.0 (R11). Bus signals and the way we use them in Simulink have evolved over time.  In this post I want to give you a... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2010\/11\/19\/bus-signals-past-present-and-future\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[24,11,33],"tags":[162,167],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/109"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}