Click here to download the project: https://github.com/DanlawMxTeam/Samples/raw/master/Multi-Vmc.rar
•MxSuite 3.40 or later
•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
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.
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.
The 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.
The 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 (). This project is designed to pass.
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.
CAN Sub-System (VMC)