|Download Help (Windows Only)|
The block diagram code of the host VI contains mappings that connect LabVIEW controls to model parameters and LabVIEW indicators to model signals. You can create mappings using the SIT Connection Manager dialog box. To access this dialog box, launch LabVIEW and select Tools�SIT Connection Manager.
When you map a control directly to a model parameter, the parameter itself is updated with the value of the control. When you map a control to a workspace variable, the variable is updated, as well as all parameters that are dependent on it. Thus, one workspace variable can effectively tune multiple model parameters. For a given model, you can choose to map to either model parameters or workspace variables. To use workspace variables, you must inline the model parameters, and then specify which workspace variables you want to use.
Complete the following steps to inline model parameters:
|Tip�� Click the Help button in the Simulation Parameters or Configuration Parameters dialog box to launch the MATLAB� help and find additional information about this process.|
|Note��When you build a model into a DLL using the The MathWorks, Inc. Real-Time Workshop�, some types of expressions may not be tunable. Refer to the Tunable Expression Limitations section in The MathWorks, Inc. Real-Time Workshop� documentation for more information.|
You can create mappings using a one-to-one relationship or a one-to-many relationship. The following figure shows a one-to-one relationship, mapping to model parameters:
In the previous figure, the Sine Wave Amplitude control of the host VI manipulates the amplitude parameter of the Sine Wave block in the model. The same relationship applies to the rest of the controls and parameters. You also can map one host VI control to multiple parameters and one indicator to multiple signals. The following figure shows this one-to-many relationship, mapping from model signals:
In the previous figure, All My Signals displays all the signals in the model. To define a one-to-many relationship, press the Ctrl key while clicking on multiple parameters or signals.
You can map controls to workspace variables to update all the model parameters which are dependent on them:
If the host VI is not running, you can use the SIT Connection Manager dialog box to modify mappings and generate new block diagram code. If the host VI is running, you must use the Remap Controls and Indicators dialog box to modify mappings.
The following list describes the front panel controls and indicators you can use in a host VI and the valid mappings you can make to each control or indicator.
|Note��By default, the LabVIEW Simulation Interface Toolkit does not automatically adjust the scale range of knobs and sliders. LabVIEW Simulation Interface Toolkit can automatically adjust the scale range based on the initial value of the parameter in the Simulink application software. You can enable this autoscaling by placing a checkmark in the Autoscale Controls checkbox on the Mappings tab of the SIT Connection Manager dialog box.|
|Note��The Simulation Interface Toolkit converts Express XY graphs into regular XY graphs.|
The Simulation Interface Toolkit does not support mappings to parameters or signals that have three or more dimensions.
Mappings typically become invalid if the Simulation Interface Toolkit cannot communicate with a model parameter or signal correctly. Additionally, certain simulation options you set in the Simulink application software can cause mappings to become invalid. The following sections provide information about fixing invalid mappings.
If you create a mapping, generate block diagram code for the host VI, and change the model or front panel in a way that breaks the mapping, the block diagram code of the host VI still references the mapping. To avoid errors, you must launch the SIT Connection Manager dialog box, remove or change any erroneous mappings, and generate new block diagram code.
Mappings might appear invalid if the model uses either Signal Storage Reuse or Block Reduction Optimization. These items are options you can set in the Simulink application software to reduce the memory footprint of the model. Disabling these options for the entire model makes all signals available for probing but increases the memory footprint of the model. You can mark individual signals as test points to maintain a reduced memory footprint while keeping certain signals available for probing. To make this change, load the model in the Simulink application software and perform the following actions:
For The MathWorks, Inc. MATLAB� application software release 13, right-click a signal and select Signal properties from the shortcut menu. Place a checkmark in the SimulinkGlobal(Test Point) checkbox and click the OK button to save changes.
For the MATLAB application software release 14 and later, right-click a signal and select Signal properties from the shortcut menu. Click the Logging and accessibility tab, place a checkmark in the Test point checkbox, and click the OK button to save changes.
|Note��If you previously converted this model to a model DLL, you must convert the model to a model DLL again after marking signals as test points.|
Similarly, you might not be able to probe signals from Virtual Blocks such as Mux, Demux, Bus Selector, and so on. Marking signals from these blocks as test points makes the signals available for probing.
Refer to the Simulink documentation for information about Signal Storage Reuse, Block Reduction Optimization, Virtual Blocks, and test points.
You might not be able to manipulate model parameters if that model uses the Inline parameters option in the Simulink application software. This option writes a constant value to each model parameter. You must launch the Simulink application software and disable this option so the Simulation Interface Toolkit can manipulate the model parameters. Alternatively, you can mark the variables as tunable as described in the Parameters and Workspace Variables section above.
Refer to the Simulink documentation for information about inline parameters.
You can create mappings to parameters and signals of masked subsystems. However, if a subsystem is linked, or linked and masked, any mappings to parameters and signals of that subsystem appear invalid. Refer to the Simulink documentation for information about linked and masked subsystems.
If a model contains a subsystem that does not have any parameters or signals, that subsystem appears in the model tree when you create mappings. However, you cannot create mappings to/from that subsystem.