LabVIEW 2018 Control Design and Simulation Module Help
»View Product Info
Requires: Control Design and Simulation Module
Select Tools»Control Design and Simulation»Simulation Model Converter to launch this dialog box.
Use this dialog box to convert your model (.mdl or .slx) file, developed in The MathWorks, Inc. Simulink® simulation environment, into a LabVIEW VI that contains a simulation diagram. As part of the conversion process, the Simulation Model Converter uses The MathWorks, Inc. MATLAB® application software and the Simulink application software to compile your model file and execute any of your .m files that you specify in the dialog box. If the MATLAB software or the Simulink software is not installed on the same computer as the LabVIEW Control Design and Simulation Module, the results of the conversion might be less accurate.
This dialog box includes the following components:
- Source File or Directory to Convert—Select the path to your model (.mdl or .slx) file or directory of files you want to convert into LabVIEW block diagram code. If you select a directory, the Simulation Model Converter converts all of your model files in that directory. Make sure you have permission to convert the model file(s) if you are not the owner.
|Note If the selected directory contains multiple model files with the same name at the same folder level, the Simulation Model Converter converts only the model file with the .slx extension. For example, if the directory contains model files A.mdl and A.slx at the same folder level, the Simulation Model Converter converts only A.slx.|
- Include Subdirectories—If you enable this option and select a path to a directory in the Source File or Directory to Convert control, the Simulation Model Converter converts all of your model (.mdl or .slx) files in the directory and all of its subdirectories. This option is enabled by default.
- Output Directory—Select the directory in which to save all the LabVIEW VIs the Simulation Model Converter creates. If the Simulation Model Converter converts model (.mdl or .slx) files from subdirectories, the Simulation Model Converter saves the resulting VIs in the same relative directory structure as the Source File or Directory to Convert directory.
- Save CGD File(s)—Enable this option to save the Common Graph Description (CGD) file the Simulation Model Converter creates for each of your model (.mdl or .slx) files it converts. The Simulation Model Converter parses and stores each system, subsystem, block, and line in the CGD file, which the Simulation Model Converter then uses to generate a LabVIEW simulation subsystem for each subsystem in order. LabVIEW saves the CGD file with an .xml file extension and with the same filename as your original model file. LabVIEW saves this file in the same directory in which it saves the generated VI. If you have trouble converting a model, contact National Instruments technical support and provide the CGD file you save.
- Show Created VI(s)—Enable this option to open automatically the top-level VI for each converted model (.mdl or .slx) file after the conversion is complete.
- Show Errors—Enable this option to display information about any warnings or errors the Simulation Model Converter encountered during the conversion. The Simulation Model Converter does not convert other model (.mdl or .slx) files until you close the error dialog box. Disable this option when you convert many model files at once. This option is enabled by default.
- Log Errors—Enable this option to write a log file containing information about any warnings or errors the Simulation Model Converter encountered during the conversion of each model (.mdl or .slx) file. LabVIEW writes the log file in the Output Directory. The log file has the same name as the source file and uses a .log extension. Enable this option when you convert many model files at once. This option is enabled by default.
- Ignore Libraries—Enable this option to force the Simulation Model Converter to ignore any subsystems that are defined in libraries external to the source files. If you previously have converted the external library or defined it manually for the LabVIEW platform, enable this option and place the previously created VIs in the Output Directory so the Simulation Model Converter can use them correctly.
- Currently Converting—Displays the path to the model (.mdl or .slx) file the Simulation Model Converter currently is converting.
- Initialization scripts—List any of your .m files to execute prior to the conversion process. .m files initialize variables and can provide other information needed in your model (.mdl or .slx) file. .m files can be executed only if the MATLAB application software is installed. If you have a licensed copy of the MATLAB software version 5.0 or later installed on your computer, the Simulation Model Converter causes the MATLAB software to automatically execute any of your .m files you specify.
- Add—Click the Add button to add an m-script to the list of scripts to execute prior to conversion.
- Delete—Click the Delete button to delete an m-script from the list of scripts to execute prior to conversion.
- Load Errors—Click the Load Errors button to load a previously saved error log file. LabVIEW prompts you to locate the error log file on the computer or network.
- Convert—Click the Convert button to convert your selected model(s) into LabVIEW code.
The Simulation Model Converter does not support some Simulink blocks.