Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating Mappings (Simulation Interface Toolkit)

LabVIEW Simulation Interface Toolkit 4.0 Help
August 2007

NI Part Number:
371504C-01

»View Product Info

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.

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:

In the previous figure, Knob Control 1 of the host VI manipulates Parameter 1 of the model, Knob Control 2 manipulates Parameter 2 of the model, and Waveform Graph Indicator displays the result of Signal 1.

You also can map one control to multiple parameters and one indicator to multiple signals. The following figure shows this one-to-many relationship:

In the previous figure, Knob Control 1 of the host VI manipulates Parameter 1 and Parameter 2 simultaneously. Waveform Graph Indicator displays the results of Signal 1 and Signal 2 simultaneously. To define a one-to-many relationship, press the <Ctrl> key while clicking on multiple parameters or signals.

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.

Valid 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.

  • Array—You can map array objects to any vector or matrix value in The MathWorks, Inc. Simulink® application software. The objects in the array must be a supported object from this list.
  • Boolean—You can map Boolean objects to any scalar value in the Simulink application software. Boolean controls encode FALSE as 0 and TRUE as 1. Boolean indicators display 0 as FALSE and any nonzero value as TRUE.
  • String—You can map string objects to any Simulink data type. A Simulink vector or matrix appears as a tab-delimited string.
  • Numeric, Enum, Ring, Combo Box, Color Box, Radio Buttons Control—You can map these objects to any scalar value in the Simulink application software.
  • Knob, Dial, Meter, Gauge—You can map these objects to any scalar value in the Simulink application software. If you enable multiple needles on an object, you can map the object to a vector.
  • Slider, Tank, Thermometer—You can map these objects to any scalar value in the Simulink application software. If you enable multiple sliders on an object, you can map the object to a vector.
    Note  By default, the LabVIEW Simulation Interface Toolkit automatically adjusts the scale range of knobs and sliders based on the initial value of the parameter in the Simulink application software. You can disable this autoscaling by closing LabVIEW, entering LVSITNumScaleUnchanged=True on a separate line of the labview.ini file, and launching LabVIEW again. The labview.ini file is located in the labview\ directory. If you disable autoscaling, you still can adjust scale ranges manually; for waveform charts, you also can specify autoscaling behavior for one or both axes.
  • Intensity Chart, Intensity Graph—You can map these objects only to a two-dimensional matrix in the Simulink application software.
  • Waveform Graph—You can map waveform graphs only to a one-dimensional vector or two-dimensional matrix in the Simulink application software.
  • XY Graph—You can map XY graphs to any two scalar values in the Simulink application software. When you create the mapping, click the signal you want to associate with the x value. Then press the <Ctrl> key and click the signal you want to associate with the y value.
    Note  The Simulation Interface Toolkit converts Express XY graphs into regular XY graphs.
  • Waveform Chart—You can map waveform charts to any scalar, vector, or matrix signal in the Simulink application software.

The Simulation Interface Toolkit does not support mappings to parameters or signals that have three or more dimensions.

Note  If a model created in the Simulink application software uses a complex number, you can use the Simulation Interface Toolkit to manipulate and/or probe only the real part of that complex number.

Fixing Invalid Mappings

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.

Models or Host VIs with Broken 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.

Models Using Signal Storage Reuse, Block Reduction Optimization, or Virtual Blocks

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.

Models Using Inline Parameters

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.

Refer to the Simulink documentation for information about inline parameters.

Models Containing Linked or Masked Subsystems

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.

Subsystems without Parameters or Signals

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.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit