Main Content

Root Inport Mapper

Import, visualize, and map signal and bus data to root-level inports

Description

The Root Inport Mapper lets you import, visualize, and map signal and bus data to root-level inports.

Root Input Mapper default

Open the Root Inport Mapper

  • Inport block: Open the block dialog box and click Connect Inputs.

  • Simulink® Editor:

    1. Click on the Inport block in a model. In the Simulink Editor toolstrip:

      1. Click the Root Inport tab.

      2. Click Connect Inputs.

  • Simulink Editor toolstrip:

    1. In the Prepare section of the Simulation tab, click the expander.

    2. Click Inputs & Parameter Tuning > Connect Inputs.

  • Simulink Editor toolstrip:

    1. In the Prepare section of the Simulation tab, click the expander.

    2. Click Configuration & Simulation > Model Settings.

    3. In the Data Import/Export pane,click the Input check box.

    4. Click Connect Inputs.

  • Simulink Editor canvas:

    1. Right-click the canvas.

    2. Select Model Configuration Parameters.

    3. In the Data Import/Export pane,click the Input check box.

    4. Click Connect Inputs.

Examples

expand all

The Root Inport Mapper uses these keyboard shortcuts.

ActionMenu ActionKeyboard Shortcut

Open file.

Open

Ctrl+O

Save file.

Save

Ctrl+S

Link from spreadsheet.

From Spreadsheet

Ctrl+Shift+X

Link from MAT-file.

From MAT-File

Ctrl+Shift+L

Link from workspace.

From Workspace

Ctrl+Shift+B

Create and edit new scenario in MAT-file.

Signals > New MAT-File

Ctrl+N

Edit scenario in MAT-file.

Signals > Edit MAT-File

Ctrl+E

Check readiness of all mapped scenario datasets.

Check Map Readiness > All Scenarios

Ctrl+Shift+A

Check readiness of the mapped datasets of the currently selected scenarios.

Check Map Readiness > Selected Scenarios

Ctrl+Shift+S

Check readiness of the mapped disconnected datasets.

Check Map Readiness > Unconnected Scenarios

Ctrl+Shift+U

Check readiness of the mapped datasets that previously failed a mapping.

Check Map Readiness > Failed Scenarios

Ctrl+Shift+F

Check readiness of the mapped datasets that previously caused warnings.

Check Map Readiness > Scenarios with Warnings

Ctrl+Shift+Y

Apply to model.

Apply to Model

Ctrl+M

Generate and open MATLAB® batch simulation file.

Generate Script

Ctrl+G

Unlink all scenarios.

Unlink all scenarios

Ctrl+U

Unlink selected scenarios.

Unlink selected scenarios

Ctrl+I

Follow this workflow to get started using the Root Inport Mapper.

Create signal data in the MATLAB workspace.

For a Simulink model, import the data from the workspace. You can visualize the data you import.

Map the data to root-level inports.

Simulate the model.

Save the Root Inport Mapper scenario.

To specify how you want the Root Inport Mapper tool to map the signal data to a model, select from these map modes in the Map Configuration section of the toolbar.

GoalMap Mode

Assign signals to ports according to the name of the root-inport block. If the name of a signal or bus element matches the name of a root-input port block, the data is mapped to the corresponding port.

Block Name

Assign signals to ports according to the block path of the root-input port block. If the block path of a signal matches the block path of a root-inport block, the data is mapped to the corresponding port.

Block Path

Assign signals to ports according to the name of the signal on the port. If the signal name of a data element matches the name of a signal at a port, the signal is mapped to the corresponding port.

Signal Name

Assign sequential port numbers to the imported data, starting at 1. Map signals to the corresponding input ports.

If there is more data than input ports, the remaining data is mapped to enable and then trigger input ports.

If the data is not in the form of a dataset, it is processed in the order in which it appears in the data file.

Port Order

Assign signals to ports according to the definitions in a custom file. To create a custom map mode, see Create and Use Custom Map Modes.

Custom

The Root Inport Mapper tool supports the MATLAB data types or formats described in the table for imported signal data. For each data type, you can use the map modes indicated in the table.

Data FormatsBlock NameBlock PathSignal NamePort OrderCustom

Simulink.SimulationData.Dataset

SupportedSupportedSupportedSupportedSupported

MATLAB timeseries

Supported SupportedSupportedSupported

MATLAB timetable

Supported   Supported Supported Supported

Simulink.SimulationData.Signal

SupportedSupportedSupportedSupportedSupported

Stateflow.SimulationData.State

SupportedSupportedSupportedSupportedSupported

Structure with time and structure without time

   Supported 

Data array

   Supported 

Array of buses

Supported SupportedSupportedSupported

Asynchronous function-call signal

Supported SupportedSupportedSupported

Related Examples

Parameters

expand all

File

Open an existing scenario from a previous Root Inport Mapper session. If you are working in another scenario, the Root Inport Mapper tool displays a message.

To...Click...

Open a new scenario. Remove the existing scenario without saving it.

No

Cancel opening a scenario.

Cancel

To save the existing scenario, click Yes. Then click the Open button again to open an existing scenario.

Yes

Save current Root Inport Mapper scenario to a .mldatx file.

Link

Import Simulink data from spreadsheet.

Import Simulink data from MAT-file.

Import Simulink data from base workspace.

Import Simulink data from a custom registered file type.

Edit

Start Signal Editor to edit signals from an existing scenario MAT-file or create a new MAT-file to contain new scenarios and signals.

Map Configuration

Select map mode according to the desired action.

GoalMap Mode

Assign signals to ports according to the name of the root-inport block. If the name of a signal or bus element matches the name of a root-input port block, the data is mapped to the corresponding port.

Block Name

Assign signals to ports according to the block path of the root-input port block. If the block path of a signal matches the block path of a root-inport block, the data is mapped to the corresponding port.

Block Path

Assign signals to ports according to the name of the signal on the port. If the signal name of a data element matches the name of a signal at a port, the signal is mapped to the corresponding port.

Signal Name

Assign sequential port numbers to the imported data, starting at 1. Map signals to the corresponding input ports.

If there is more data than input ports, the remaining data is mapped to enable and then trigger input ports.

If the data is not in the form of a dataset, it is processed in the order in which it appears in the data file.

Port Order

Assign signals to ports according to the definitions in a custom file. To create a custom map mode, see Create and Use Custom Map Modes.

Custom

Specify custom map mode file. For more information on custom map mode files. see Create and Use Custom Map Modes.

Select mapping options according to the desired action.

GoalOption

Update the model and review the data types of root-level input ports and imported data.

Update Model Automatically. Compare the signal data and input port parameters to the root-level port and display the results. If you do not select this option, the tool maps the imported data to the root-level input port but does not update the model.

Use strong data typing when mapping data from spreadsheets.

Use Strong Data Typing with Spreadsheets. Clear this check box to allow the Root Inport Mapper tool to automatically convert spreadsheet input signals to the data types of the corresponding root inports. The Root Inport Mapper tool can cast the spreadsheet data to only these data types: double, single, int8, uint8, int16, uint16, int32, and uint32. If you select this check box or if the root input port is not one of these data types, you may receive a data type mismatch error.

Import bus data that is only partially defined.

Allow Partial Specification of Buses. Confirm that any partially specified bus data you import maps properly to root-level input ports.

Identify unassigned root input ports and detect incomplete input data sets.

Notify of Missing Signals. Show inputs with missing signals.

Map to Model

Specify subset of scenarios to map according to the desired action.

GoalOption

Map all the scenario datasets (default).

All Scenarios ()

Map the datasets of the scenarios currently selected in the Scenario Dataset section.

Selected Scenarios ()

Map the disconnected datasets.

Unconnected Scenarios ()

Map datasets that previously failed a mapping.

Failed Scenarios ()

Map datasets that previously caused warnings.

Scenarios with Warnings ()

Apply data to model. Clicking this button selects the Input check box in the Data Import/Export pane in the model Configuration Parameters dialog box. It also sets the Input value to the imported data variables. The status of the application displays in the Status column of the Scenarios panel.

Script

Generate a batch simulation file to run the mappings that you have set up. You can then run the script in the MATLAB Editor.

More About

expand all

Version History

Introduced in R2012b

expand all

See Also

Blocks

Live Editor Tasks

Model Settings