Documentation Center

  • 評価版
  • 製品アップデート

slvnvmergeharness

Combine test data from harness models

Syntax

status = slvnvmergeharness(name, models, initialization_commands)

Description

status = slvnvmergeharness(name, models, initialization_commands) collects the test data and initialization commands from each test harness model in models. slvnvharnessmerge saves the data and initialization commands in name, which is a handle to the new model.

initialization_commands is a cell array of strings the same length as models. It defines parameter settings for the test cases of each test harness model.

If name does not exist, slvnvmergeharness creates it as a copy of the first model in models. slvnvmergeharness then merges data from other models listed in models into this model. If you create name from a previous slvnvmergeharness run, subsequent runs of slvnvmergeharness for name maintain the structure and initialization from the earlier run. If name matches an existing Simulink® model, slvnvmergeharness merges the test data from models into name.

slvnvmergeharness assumes that name and the rest of the models in models have only one Signal Builder block on the top level. If a model in models does not meet this restriction or its top-level Signal Builder block does not have the same number of signals as the top-level Signal Builder block in name, slvnvmergeharness does not merge that model's test data into name.

Input Arguments

name

Name of the new harness model, to be stored in the default MATLAB® folder

models

A cell array of strings that represent harness model names

initialization_commands

A cell array of strings the same length as models. initialization_commands defines parameter settings for the test cases of each test harness model.

Output Arguments

status

If the function saves the data and initialization commands in name, slvnvmergeharness returns a status of 1. Otherwise, it returns 0.

Examples

Log the input signals to the three Model blocks in the sldemo_mdlref_basic example model that each reference the same model. Make three test harnesses using the logged signals and merge the three test harnesses:

open_system('sldemo_mdlref_basic');
data1 = slvnvlogsignals('sldemo_mdlref_basic/CounterA');
data2 = slvnvlogsignals('sldemo_mdlref_basic/CounterB');
data3 = slvnvlogsignals('sldemo_mdlref_basic/CounterC');
open_system('sldemo_mdlref_counter');
harness1FilePath = slvnvmakeharness('sldemo_mdlref_counter', data1);
harness2FilePath = slvnvmakeharness('sldemo_mdlref_counter', data2);
harness3FilePath = slvnvmakeharness('sldemo_mdlref_counter', data3)
[~, harness1] = fileparts(harness1FilePath);
[~, harness2] = fileparts(harness2FilePath);
[~, harness3] = fileparts(harness3FilePath);
slvnvmergeharness('new_harness_model',{harness1, harness2, harness3});

See Also

|

Was this topic helpful?