LabVIEW 2012 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) 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 .mdl 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 .mdl 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 .mdl files in that directory. Make sure you have permission to convert the .mdl file(s) if you are not the owner.
- 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 .mdl 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 .mdl 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 .mdl 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 .mdl 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 .mdl 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 .mdl files until you close the error dialog box. Disable this option when you convert many .mdl 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 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 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 .mdl 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.