There are 7 projects included in the Simulink samples:
•ArraySample and ArraySample2 - These projects demonstrate interchanging array (vector) data between MxVDev and Simulink. Simple test cases and a trivial model are included to demonstrate using input and output Signals that are defined as arrays. See S-Function Connector to Simulink.
•Multi S-Function - This project provides an example of two connected-models in one Harness.
•Multi Rate - This project provides an example of a multirate model.
•Replace Block - This project provides an example of two models attached using the Replace method.
•S-Function Workspace Command - This project provides an example using the MxV Matlab Workspace command port.
•Test Data Store - This project tests a Simulink Data Store.
These projects have been deprecated:
S-Function, Bus Sample
Applies to: •MxSuite 3.40 or later Other Requirements: •A licensed and supported version of Matlab Simulink is required. •The user should have an understanding of Simulink, MxSuite Scenarios, TestCases, and Transforms. |
Use this link to download all the sample projects: • https://github.com/DanlawMxTeam/Samples/raw/master/Simulink.rar
|
This project is deprecated. This project was created using the Mathworks Simulink (via S-Function) Connector Transform. This is the simplest sample. It uses an S-Function to wrap a model with one input and one output. See S-Function Connector to Simulink. This example is designed to fail.
|
These projects demonstrate interchanging array (vector) data between MxVDev and Simulink. Simple test cases are included to demonstrate using input and output Signals that are defined as arrays. See S-Function Connector to Simulink. This project is designed to pass. This project includes 3 Simulink models named: •Simulink •SimulinkWrapTopLevel •SimulinkTopHarness There are 6 TestCases to initialize and test the models. The TestCase named TestCase tests the first model. It shows how the model responds to reset Signals. The Array1Test, Array2Test, and Array3Test TestCases demonstrate how transitions on array Signals change the array elements. The TestCases execute concurrently, but each TestCase tests a different model. To run the project, open the TestScenario Scenario and wait for all 3 models to load. Run the Scenario. This Scenario is designed to pass. |
This project demonstrates interchanging array (vector) data between MxVDev and Simulink. Simple test cases and a trivial model are included to demonstrate using input and output Signals that are defined as arrays. See S-Function Connector to Simulink. This project includes one Simulink model There are 8 TestCases to initialize and test the model. The TestCases show how array Signals and array elements of different types are transmitted, received, and displayed. To run the project, open and run the Default Scenario. This Scenario is designed to pass. |
This project provides an example of nested busses. This sample is deprecated. ![]() Bus Sample Harness
![]() Bus Sample Simulink Model The project includes two Simulink models and four TestCases. After the Init TestCase complete, the other three TestCases run concurrently. To run the project, open and run the Test Bus Harness Scenario. This Scenario is designed to pass. |
This project provides an example of two connected-models in one Harness. ![]() Multi S-Function Sample Harness This project includes two Simulink models. There are 6 TestCases to initialize and test the models. The TestCases show how the models respond to various inputs. To run the project, open the TestScenario Scenario and wait for both models to load. Run the Scenario. This Scenario is designed to pass. |
This project provides an example of a multirate model. To display the legend box, in Simulink, select Display->Sample Time->All from the menu. ![]() Multirate Simulink model with legend To run the project, open and run the Default Scenario. This Scenario is designed to pass. |
![]() | Replace Block Sample |
This project provides an example of two models, testmodel and testmodel2. Both models are attached to MxTransit using the Replace method. The first testmodel has a Subsystem at the top level: ![]() Test Model Top Level with Subsystem Selected Double-click on the Subsystem block to open it. The Subsystem Block inside the top-level Subsystem is replaced:
In testmodel2, the Subsystem at the top-level is replaced:
To run the project, open the Default Scenario and wait for both models to load. Run the Scenario. This Scenario is designed to pass. |
This project provides an example using the MxV Matlab Workspace command port. In this sample Workspace commands are transmitted from the TestCase (Job 3). You can see the commands in the Transition List. Commands must be transmitted before the time when they are executed. See Sending Commands to the Matlab Workspace. For example, the command transmitted at 3.199999 seconds is executed at 3.2 seconds. When an invalid command is issued (at 14s), it causes the model to terminate and MxNet to disconnect. 2,Transform,Transform Harness/MxV/Simulink,Model terminated unexpectedly while waiting for receive. To run the project, open the Default Scenario and wait for both models to load. Run the Scenario. This Scenario is designed to fail. |
This project tests Simulink Data Stores, A and B. Data Store A is contained in a Simulink Subsystem block. The model generates data and stores it in the Data Stores. The CurrentDataRead Signal shows the data as it changes in the format [x, y, value]. Because the CurrentDataRead array is 8 x 1, the y coordinate is always zero. See Array Edit Mode. In the ReintDataStore TestCase, the MxV MATLAB Workspace Command changes the contents of the Data Stores. To run the project, open the Default Scenario and wait for the model to load. Run the Scenario. This Scenario is designed to pass. |