Main Content

Upgrading Systems with Enabled Library Links, Model References, and Subsystem References

You can use the hydraulicToIsothermalLiquid tool to convert any type of a block diagram system, such as a model, subsystem, or library. When you convert your model, the tool appends _converted to the name of the original file to avoid overriding original files and to allow you to compare the original and converted files. However, when you convert models that contain hydraulic blocks from custom Simulink® libraries, or referenced models or subsystems with hydraulic blocks, the renamed model may not preserve the links between the files. To preserve the links, you must convert the libraries, model references, and subsystems together with the model, by supplying either a list of files or a top folder containing these files as an input argument to the hydraulicToIsothermalLiquid conversion tool.

To convert the model and its libraries, model references, and subsystems together:

  1. Supply either a list of files or a top folder containing these files as an input argument to the hydraulicToIsothermalLiquid conversion tool:

    • convertedFiles = hydraulicToIsothermalLiquid(oldfiles) — Convert all files in the oldfiles list and return the names of converted files in convertedFiles. oldfiles is a cell array of file names, such as {'file1';'file2';'file3'}. If a file in the list does not contain hydraulic blocks and does not refer to a file listed in oldfiles that contains hydraulic blocks, the tool does not convert it.

    • convertedFiles = hydraulicToIsothermalLiquid(topfolder) — Convert all files in topfolder and its subfolders that are on the MATLAB® path, if the files contain hydraulic blocks. If a file does not contain hydraulic blocks and does not refer to a file under topfolder that contains hydraulic blocks, the tool does not convert it. topfolder is the path name of the top folder that contains the block diagram systems to convert, specified as a character vector or string scalar, such as "MyLibraries". convertedFiles returns the names of converted files as a cell array of character vectors.

  2. In the HTML conversion report , review the Broken Connections section for broken links. Broken connections might indicate that you forgot to include a reference model or library in the conversion. In this case, either repair the link manually or rerun the conversion process with the expanded list of files.

  3. Compare the simulation results of the converted models to the original models to ensure that the results are as expected. In the conversion report, investigate the messages in the Removed Blocks and Parameter Warnings sections. The messages in these sections indicate whether behavior changes are expected and suggest appropriate actions.

  4. If the converted systems behave as expected, change the system names to the original ones by entering:

    finalFiles = hydraulicToIsothermalLiquidPostProcess(convertedFiles)
    

    This function overwrites the original files by removing the _converted suffix from the file names and the links between the files. For more information, see hydraulicToIsothermalLiquidPostProcess.

Alternatively, you can convert the block diagram systems by using the Interface (H-IL) block to connect the converted parts of the block diagram to any unconverted libraries or subsystems. Convert and verify each of the libraries, referenced models, and referenced subsystems, then remove _converted from each name, remove the Interface (H-IL) blocks, and restore the broken connections.

See Also

| |

Related Topics