This project shows a Test Harness with multiple Virtual MicroControllers (VMCs) and a CAN bus.
Click here to download the project: https://github.com/DanlawMxTeam/Samples/raw/master/Multi-Vmc.rar
Applies to: •MxSuite 3.40 or later Other Requirements: •A supported version of Visual Studio is required. •The user should have an understanding of MxSuite Scenarios, TestCases, and Transforms. |
This sample includes examples of the following features: •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 •Three CAN messages: MotorDirection (input), MotorPosition (output), and MotorSpeed •A Z-1 Delay Transform connects the Motor and Controller Transforms as required
![]() Multi VMC Harness
|
You may need to use the MSVS conversion wizard and convert the solution to run the sample. See Retargeting a Visual Studio solution. The Motor and Controller VMCs simulate the operation of a power window. Invert VMC The Invert VMC is a very simple example. The main.c method sets the value of the Out port to the inverse of the In port. The In and Out Signals are exported to the TestCase. Motor VMCThe Motor VMC calculates the position of a motor based on the speed and direction. It reads the Speed from the MotorSpeed message on the CAN bus. The Direction comes from the Direction port on the Controller. Controller VMCThe Controller VMC reads the motor position from its Position inport, which is connected to the outport on the Motor VMC. It sets its Direction outport to MotorDirectionStop when the motor reaches its limit. |
To run the Demo Scenario, click the run button ( The In Signal is connected to the Invert VMC, which inverts it and returns the Out Signal. Speed is an input to the Controller VMC. MotorDirection·Direction is a component Signal transmitted to the CAN bus. MotorDirection is the CAN message. Direction is a field within the message. MotorPosition·Position is a component Signal read from the CAN bus. The position goes up until it reaches its limit (window closed). When the Direction changes do down, the position goes down until the Direction changes to Stop.
|
MxVMC - The Virtual MicroController
CAN Sub-System (VMC)