The MxSuite installer places a set of sample projects on your system. Before using sample projects, select Help‑>Copy Samples from the main menu to copy the projects to a folder of your choice. This is required by Windows security so you can make changes in the sample project folder.

The default destination is \MxSuiteSamples under your user directory. The Copy Samples command deletes any sample files already in the Destination Folder. If you modify a sample project and wish to protect it from being deleted, copy or rename its project folder.

Sample projects can also be downloaded from GitHub:

https://github.com/DanlawMxTeam/Samples

To view the sample files, navigate to the folder you specified. To open a project, use the File‑>Open‑>Project command on the main menu.

Below is a brief synopsis of the installed sample projects:

Sample Project

Description

Invert

The simplest example of SIL testing

It has one Boolean Input Signal and one Boolean Output Signal.

The source code is provided so that you can make changes to and rebuild the SUT.

There is an Invert Sample section in this help file designed to demonstrate how SIL works, and show some basic scenario and test case capabilities.

TurnDoorSample

A comprehensive example of a SIL test environment for a body control module

All types of Signals (discrete, continuous, message, image)

CAN communication

Auto message transmission

Some sample Interactive Test Panels

Image signals

VMC

For more information, see TurnDoorSample Project.

Automation

Click here to download the sample: https://github.com/DanlawMxTeam/Samples/raw/master/Automation.rar

This is a collection of samples that demonstrate various types of automation.

Automation.vbs: The Automation.vbs script demonstrates Automated (scripted) testing. It creates an MxVDev project and TestCases based on Excel (.csv) files, and executes a Scenario. To use it, open Automation.vbs in the sample folder. See MxVDev COM Automation API.

AutomationCreateProject.vbs is a sample Visual Basic Script that programmatically creates a MxVDev project. See MxVDev COM Automation API.

C Sharp: A sample Visual Studio solution, COMSample.sln, is installed in the Samples\Automation\CSharp folder. It demonstrates using a C# program to run the same tests. See MxVDev COM Automation. Requires Visual Studio.

GetSetSample: A sample Visual Studio solution, Automation.sln, is installed in the Samples\Automation\GetSetSample folder. It demonstrates using a C# program to read and change a property of a Transform.  Requires Visual Studio.

MxTransIt: See MxTransIt Automation Samples.

AUTOSAR Cruise Control

This demonstration provides files you can use to automatically harness AUTOSAR software components.

C# Test Creation

This project demonstrates the use of C# code to create Scenarios and TestCases. See Creating Tests with a C# Program.

CAN Transmit Driver (CANTxDrvSample)

This project demonstrates how to use the CAN Transmit Driver Transform to put Signals on a CAN bus. One Signal is spontaneous; the other is periodic.

CANTxRxSample

This project demonstrates the use of CAN Transmit and Receive Driver Transforms. The CAN bus is defined entirely in MxTransIt; MxVDev Network Configuration is not used.

Two message-based Signals, MsgHazard·Value1 and MsgHazard·Value2, are transmitted from the TestCase to the CAN Transmit Driver. The Transmit Driver puts the message onto the CAN_A bus. The SIL Easy Transform adds the two values and puts the sum into VehSpeedRPM·EngineRPM. The CAN Receive Driver reads the message from the bus and separates the fields into Signals so the VehSpeedRPM·EngineRPM can be viewed in the TestCase.

The Harness also includes a Virtual Bus Transform, which enables you to view the traffic on the CAN bus with the Virtual Bus Monitor.

CANLogSample

This project includes a sample Vector CAN Log file, event.log, that you can import to create a TestCase. The TestCase import_event_bus_1_all message.mxc shows the result of a successful import. See Importing Vector CAN Log Files. This project is not intended to run.

Custom Transforms

This project contains code used in creating Custom Transforms. The Custom Transition Editor code shows how to display a custom dialog when creating or modifying transitions. The code is located in the \CustomTransforms\CustomTransitionEditor\Transforms\MyTransform subfolder in the samples folder. For more information, see Example Code–Custom Transition Editor. This project is not designed to pass.

A supported version of Visual Studio is required.

Diagnostics

Two different projects, \DiagnosticsSample and \Sil\DiagSample, show a couple of the many approaches that can be taken when testing CAN diagnostic features.

DiagnosticsSample uses a quick and easy method by setting up Transport Protocol messages directly from Signal Dictionary to send/receive diagnostic messages.

Sil\DiagSample shows a more comprehensive approach by creating separate signals for different Diagnostic Functions and using the SIL Easy Transform to re-use C code for Seed/Key Security Algorithm functionality. For more details, see Diagnostic Testing–DiagSample.

dSPACE

This project is used to demonstrate use of the dSPACE Connector Transform.  See dSPACE.

Requirements:

MxSuite 3.41 or higher

A supported version of dSPACE hardware

HIL

A collection of sample projects demonstrating HIL testing. Projects are provided for interfacing with:

BCS Ideas RP00003232N

Data Translations DT9812

XCP

IP Network

This project demonstrates use of TCP Transforms as a server and client. In the sample, the server echoes messages back to the client.

LIN SIL Sample

Demonstrates how to use LIN buses in a SIL environment.

Multi LIN Cache

Demonstrates use of the LIN Cache Transform.

Multi-VMC

This project shows a Test Harness with multiple Virtual MicroControllers and a CAN bus.

The project includes the following:

Three VMCs: Invert, Motor, and Controller

A Pass-Thru Transform that transmits MxV Module Reset, SUT Init, and SUT Tick Signals from a single TestCase to all three VMCs

A CAN bus with three nodes: Controller, Motor, and MxVDev

Two CAN messages: MotorDirection (input) and MotorPosition (output)

A Z-1 Delay Transform connects the Motor and Controller Transforms as required

The Invert VMC functions the same as in the Invert Sample Project. The Motor and Controller VMCs simulate a motorized part such as a power window that moves up and down.

You can use the Virtual Bus Monitor to view the CAN messages on the bus as the test runs.

You may need to use the MSVS conversion wizard and rebuild the three solutions to run the sample.

MxDrive sample

The MxDrive Simulator project

MxTransItAutomation

These samples demonstrate various ways to use MxTransIt programmatically. With the API provided, you can create an application that interacts with any device or system that can connect to MxTransIt. See MxTransIt Automation Samples.

OSEK

This project demonstrates use of an OSEK interface.  See OSEK Library.

PIL Sample

Simulator or debugger (hardware)

PLT

This project performs self tests for all MxPLT hardware components, which include relays, DAQ, Voltage source, Current Source, CAN bus, LVT VBS, and scope channels. See MxPLT Self Tests.

OEM-specific sample projects are available for download to MxPLT customers.

Reactive Variants

This project demonstrates the use of Reactive Scenarios and Variant DataBlocks.

The Reactive Scenario Test uses this branching logic: If TestCaseA passes, run TestCaseB. If TestCaseA fails, run TestCaseC.

The Active Variant and Any Variant Scenarios demonstrate the two pass-fail options available for Variant DataBlocks.

Regression Suite

This project is part of the MxSuite Regression Test Suite.  It includes many stressful TestCases which demonstrate a particular capability in the product.  It is included because it has several interesting pass/fail judgment tests.  Note that not all scenarios are designed to pass. In fact, the ones that fail are just as important as the ones that pass. It may be necessary to rebuild the SUT before running tests.

Review some of the interesting Pass/Fail TestCases

Use the MxDiff tool to show how two regression runs with many failures can be easily compared

Scenario Generator

This project includes a variety of TestCases and behavior specs that can be used to generate new Scenarios.

SIL

Several projects demonstrating the capabilities of the SIL Easy Transform:

Sil/Sample1 uses a single SIL Easy Transform to perform simple signal processing. Sil/Sample2 shows three interconnected SIL Easy Transforms.

The Sil\DiagSample project shows a SIL Easy Transform used in a more complex Harness. It demonstrates using SIL Easy for a security algorithm, using Transport Protocol (TP) Transforms, Diagnostic Transforms, and routing data to a virtual ECU. See Diagnostics Testing.

SIL Easy Cruise Control

This project simulates Cruise Control using a SIL Easy Transform and an MxVMC. It also demonstrates the use of  Z-1 Delay Transforms in a closed-loop system.

This project includes examples of Reactive TestCases and Reactive Scenarios. The CruiseModeParameter Scenario demonstrates parameterized TestCases. The CruiseModeReactive Scenario performs a similar test using Tags and Calibration groups.

You may need to rebuild the MSVS solutions to run the sample.

SIL-MIL Sample

Demonstrates simultaneous testing of SIL and MIL SUTs.

SIL-MIL-PIL

Demonstrates testing with SIL (Visual Studio or GCC), MIL (Simulink), and PIL (ARM and PPC). For more information, see CruiseControl Demo.

Simple SUT

This project demonstrates a SUT consisting of only Transforms.

Simulink Samples

There are 9 projects included in the Simulink samples:

S-Function - This is the simplest sample. It uses an S-Function to wrap a model with one input and one output.

ArraySample 1 and 2 - These projects provide examples of harnessing and using 1 and 2-dimensional array ports and various Signal Classifications.

Bus Demo - This project provides an example of nested busses.

Multi S-Function - This project provides an example of two connected-models.

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.

StringSample

This project provides examples of using Transforms to convert and display strings. A C# Snippet Transform produces strings using a variety of text encodings. Sample ArrayToMessage Transforms convert an array to messages using Little Endian and Big Endian (BE) ordering.

TurnDoorSample AutoTick

This demonstrates using an MxVMC with Auto Ticking. See Port Registration.

Click here to download: https://github.com/DanlawMxTeam/Samples/raw/master/TurnDoorSampleAutoTick.rar

VMCPortDefinitions

This project includes sample code that shows how to define various types of ports on an MxVMC.

XCP

XCP Transforms can be used for data acquisition and flash programming a SUT over a CAN bus. This sample shows how to use XCP ports and Signals. Normally XCP is used with a hardware SUT, but for purposes of this sample, the SUT is simulated by MxVMC Transforms.

Related Topic:

Exercises and Examples