{"id":14927,"date":"2023-08-08T10:18:48","date_gmt":"2023-08-08T14:18:48","guid":{"rendered":"https:\/\/blogs.mathworks.com\/simulink\/?p=14927"},"modified":"2023-08-08T10:37:41","modified_gmt":"2023-08-08T14:37:41","slug":"tips-for-working-with-simulink-libraries-and-data-dictionaries","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2023\/08\/08\/tips-for-working-with-simulink-libraries-and-data-dictionaries\/","title":{"rendered":"Tips for Working with Simulink Libraries and Data Dictionaries"},"content":{"rendered":"<div class=\"rtcContent\">\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I came across an interesting feature recently for Simulink\u00ae libraries that could be helpful when working with buses and other types associated with them.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">The Problem<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Let's say we have a library with multiple blocks that use a specific bus on their interfaces, for example, <span style=\"font-family: monospace;\">myBus<\/span>. When generating code for our models I recommend using non-virtual bus definitions so we can have strict control over how these buses appear in the code. This bus has 3 elements, a <span style=\"font-family: monospace;\">boolean<\/span>, <span style=\"font-family: monospace;\">sel<\/span>, and two <span style=\"font-family: monospace;\">uint32<\/span> values, a1 and <span style=\"font-family: monospace;\">a2<\/span>. As a specific example, one of the blocks from our library uses this bus for a selection operation.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 534px; height: 131px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_1-1.png\" alt=\"myLibBlock.png\" width=\"534\" height=\"131\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">When we want to use these library blocks in one of our models, we'll need to have <span style=\"font-family: monospace;\">myBus<\/span> defined somewhere in the scope of this model. This means that each model that uses blocks from this library must have a setup script or be associated with a Simulink data dictionary. Conceptually, our setup would look like this diagram:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 575px; height: 447px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_2-1.png\" alt=\"\" width=\"575\" height=\"447\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In the above figure, the yellow arrows indicate library block usage and the blue arrows show data dictionary links.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">The Desired Situation<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This setup works, but it would be better if we could have the definition of <span style=\"font-family: monospace;\">myBus<\/span> come along with the library instead. This would save our library users time and streamline their workflows. Conceptually, we want to follow the guiding principle that <span style=\"font-weight: bold;\">the interface for a reusable component is stored with that component<\/span>. With this in mind, our diagram should look like this:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 576px; height: 434px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_3-1.png\" alt=\"\" width=\"576\" height=\"434\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><span style=\"font-weight: bold;\">Here the dictionary containing <\/span><span style=\"font-weight: bold; font-family: monospace;\">myBus<\/span><span style=\"font-weight: bold;\"> will automatically be included in any model that uses blocks from the library.<\/span> We'll show how to do this in the following section.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Associating a Dictionary with a Library<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Let's start by creating the required bus definition in a data dictionary. From the Model Explorer, we choose <span style=\"font-weight: bold;\">File-&gt;New Data Dictionary<\/span> and provide a file name. We'll call it <span style=\"font-family: monospace;\">myLibDict.sldd<\/span>. Next, we'll select the Design Data section of the dictionary and choose <span style=\"font-weight: bold;\">Add-&gt;Simulink Bus<\/span>, and rename the bus to myBus.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We'll add the elements to this bus using the new <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/typeeditor.html\">Type Editor<\/a> interface:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 799px; height: 398px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_4-1.png\" alt=\"typeEditor.png\" width=\"799\" height=\"398\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">In this interface, we can set up the element names, data type, etc. for our bus elements. Once we're done, we can see the bus definition in the dictionary in the Model Explorer:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 890px; height: 506px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_5-1.png\" alt=\"myBusDef.png\" width=\"890\" height=\"506\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Now that we have this definition, we associate <span style=\"font-family: monospace;\">myLibDict.sldd <\/span>with <span style=\"font-family: monospace;\">myLib.slx<\/span>. Start by selecting myLib in the left panel of Model Explorer and choosing the External Data tab in the right panel. In the Data Dictionary Field, enter <span style=\"font-family: monospace;\">myLibDict.sldd<\/span> and press apply. Here I've cropped and zoomed in on the relevant panels.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 300px; height: 259px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_6-1.png\" alt=\"AssocLibLeft.png\" width=\"300\" height=\"259\" \/> <img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 566px; height: 256px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_7-1.png\" alt=\"AssocLibRight.png\" width=\"566\" height=\"256\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Once we've done this, we can see this association in the External Data field in the Model Explorer:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 890px; height: 506px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_8-1.png\" alt=\"myLibConf.png\" width=\"890\" height=\"506\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Any model that uses the library will now automatically have access the bus definition. Specifically, <span style=\"font-family: monospace;\">myModel.slx<\/span>, which uses the library block, can use the bus definition. In this case, the input is defined to be of type <span style=\"font-family: monospace;\">myBus<\/span>. This is clear when we update the diagram for <span style=\"font-family: monospace;\">myModel<\/span>.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 472px; height: 116px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_9-1.png\" alt=\"myModel.png\" width=\"472\" height=\"116\" \/><\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Housekeeping for Library Dictionaries<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Occasionally, we may need to restructure the files in a project or <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/matlab_prog\/share-projects.html\">share it via archive<\/a>. When we do this, the library dictionary dependencies will need to be recomputed because <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/simulink.librarydictionary.refresh.html#:~:text=Because%20performing%20this%20library%20dependency%20analysis%20can%20be%20an%20expensive%20operation%2C%20call%20the%20Simulink.LibraryDictionary.refresh%20function%20only%20when%20you%20have%20made%20changes%20to%20you%20library%20hierarchy%20and%20want%20to%20ensure%20that%20your%20library%20dictionary%20dependencies%20are%20current.\">they are cached on disk in the user preferences file<\/a> to increase performance during diagram updates. We'll show examples of how to handle these situations in this section.<\/div>\r\n<h4 style=\"margin: 10px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 15px; font-weight: bold; text-align: left;\">Example 1: Reorganizing our Files<\/h4>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Now let's say we want to reorganize our project and move our library to a directory called \"Libraries\". Initially the files are all in the root folder of the project:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 876px; height: 273px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_10-1.png\" alt=\"preMoveFolder.png\" width=\"876\" height=\"273\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">We create the directory \"Libraries\" and move <span style=\"font-family: monospace;\">myLib.slx<\/span> and <span style=\"font-family: monospace;\">myLibDict.sldd<\/span> to this directory and add it to our path:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 836px; height: 334px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_11-1.png\" alt=\"postMoveFolder.png\" width=\"836\" height=\"334\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">After this move, we get an error when we try to simulate our model:<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 784px; height: 357px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_12-1.png\" alt=\"simError.png\" width=\"784\" height=\"357\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">To fix this error, we need to close the dictionary with <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/simulink.data.dictionary.closeall.html\"><span style=\"font-family: monospace;\">Simulink.data.dictionary.closeAll()<\/span><\/a> and refresh the links with <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/simulink.librarydictionary.refresh.html\"><span style=\"font-family: monospace;\">Simulink.LibraryDictionary.refresh()<\/span><\/a>.<\/div>\r\n<div class=\"preformatted-matlab\" style=\"margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px;\">\r\n<div style=\"border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 12px; border: 0px none #212121;\"><span style=\"white-space: pre;\">Simulink.data.dictionary.closeAll()<\/span><\/div>\r\n<div style=\"border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: #212121; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 12px; border: 0px none #212121;\"><span style=\"white-space: pre;\">Simulink.LibraryDictionary.refresh(<span style=\"color: #a709f5;\">'.\/Libraries'<\/span>)<\/span><\/div>\r\n<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This will update the cached dictionary dependency analysis and allow us to simulate <span style=\"font-family: monospace;\">myModel<\/span>.<\/div>\r\n<h4 style=\"margin: 10px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 15px; font-weight: bold; text-align: left;\">Example 2: Sharing an Archive<\/h4>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">As a final example, let's say we want to share our project with a colleague via an archive, let's call it <span style=\"font-family: monospace;\">myProject.mlproj<\/span>. We can prevent the above error when our colleague opens this project and attempts to simulate <span style=\"font-family: monospace;\">myModel<\/span> by adding the following line to a project startup script. Here we can see the script <span style=\"font-family: monospace;\">myStartupScript.m<\/span> in our project and the code in the editor. Note that the Run At Startup icon is set in the Status column (circled in red). We get this by right-clicking on <span style=\"font-family: monospace;\">myStartupScript.m<\/span> in the project window and selecting <span style=\"font-weight: bold;\">Run At Startup<\/span> from the menu.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 676px; height: 413px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_13-1.png\" alt=\"StartupScript.png\" width=\"676\" height=\"413\" \/><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">This will allow our colleague to simulate and generate code from the model.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Now It's Your Turn<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">How do you store your buses and interfaces? Do you find this feature useful? Please let us know in the comments below.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><a href=\"https:\/\/matlab.mathworks.com\/open\/github\/v1?repo=simulink\/blog&amp;file=2023_08_08_LibraryDictionary\/library_dictionary_tips.mlx\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 136px; height: 21px;\" src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_14.png\" alt=\"\" width=\"136\" height=\"21\" \/><\/a><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\r\n<\/div>\r\n<script type=\"text\/javascript\">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/simulink\/files\/library_dictionary_tips_3-1.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>\r\nI came across an interesting feature recently for Simulink\u00ae libraries that could be helpful when working with buses and other types associated with them.\r\nThe Problem\r\nLet's say we have a library... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2023\/08\/08\/tips-for-working-with-simulink-libraries-and-data-dictionaries\/\">read more >><\/a><\/p>","protected":false},"author":197,"featured_media":14954,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,8],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/14927"}],"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\/197"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=14927"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/14927\/revisions"}],"predecessor-version":[{"id":14987,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/14927\/revisions\/14987"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media\/14954"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=14927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=14927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=14927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}