Use this procedure to demonstrate creating a VMC, building it, and creating ports with Guided Harnessing.

Applies to:

MxSuite 3.42 or higher

Other Requirements:

A supported version of Visual Studio. See Compatibility—Visual Studio.

The user should have an understanding of Visual Studio, MxTransit, MxSuite Signal Classifications, and the MxVMC.


This procedure is designed for Danlaw Marketing to demonstrate the Guided Harnessing feature. It may also be used as an exercise for users learning how to use Guided Harnessing.

This demonstration shows a specific case of harnessing SIL. For more general information, see Guided Harnessing.

1.In MxVDev, select Help->Copy Samples from the MxVDev main menu.

2.Select CruiseControlDemo from the list of samples, then click Copy and Close.

3.Create a new MxVDev project.

a.Create a new folder, GuidedDemo.

b.Select SIL. Do not check the boxes to include a sample project or start MxTransit.


c.Click Finish.

4.Disconnect the Harness.

5.Start MxTransit.

6.Click on the VMC Transform to select it, then in the VMC Properties box (above the Launch Project verb), set the Auto Export Signals property to True.

7.Click the Launch Project verb (link) to open Visual Studio.


8.If a Retarget dialog similar to this is displayed, click OK, then ensure the Solution is selected in the Solution Explorer and click the Save button. See Retargeting a Visual Studio Solution.
Important: Click Save, not Save All.


9.In Windows Explorer, browse to MxSuiteSamples\CruiseControlDemo\VMC. This is the sample you copied in step 1.


10.Copy the Source folder (and its contents) to the \SUT subfolder in the GuidedDemo folder you created in step 3. This is the folder that contains the solution (.sln) file. After copying the path should be: \GuidedDemo\SUT\Source

11.The source code of the SIL must be added to the Visual Studio solution. In Visual Studio, right-click on Source and select Add->Existing Item...


12.Add the following files from the SUT\Source folder:






13.The SIL code must provide an initialization function. Add the following code to appif_sutfuncs.h before void SUT_Init(void):

#include "../Source/CruiseControl.h"

extern void TargetInit(void);

14.In the same file, inside SUT_Init, add:




This is the function that is called during initialization.

15.The cyclic loop (main loop) of the SIL must include a cyclic function or a tick function. Inside SUT_Tick(), add the following code:


After entering the code, the appif_sutfuncs.h file should look like this:


16.Build the solution.
The solution must build successfully before you can proceed. If the build has errors, see Using VMCs—Troubleshooting.

17.In MxTransit, click the Guided Harness verb in the VMC Transform's Properties box.

Note: If there is an error, see the GenerateAppIf.buildlog.txt file in the SUT folder.  If the below error or similar is in the file, Retarget the solution again. See: Visual Studio and MxVDev–Retargeting

error MSB8020: The builds tools for v141 (Platform Toolset = 'v141') cannot be found


18.Add the ports and select the appropriate properties as shown in the table below.


Adding and Defining Ports

Use the Add button to add the following ports and select their properties:




Mode/AutoTick Rate or




Call Automatically, 50




0, 0, 1. Use defaults for Start Bit and Bit Count.



Continuous Floating Point

0, 0, 120



Continuous Floating Point

0, 0, 100

This image shows the dialog after the Signals above are selected and also shows the Properties fields for a Discrete Signal:


Task Signals

Task Signals are organized in a tree structure under the Functions node as shown below. The Mode option controls how the task is called. If Call From TestCase is selected, the task is controlled by a Event Signal in a TestCase. If Call Automatically is selected, you must also select the AutoTick Rate. The method (task) is invoked periodically at that rate while the test is running.


After you have selected the ports to harnessed and exported:

1.Click OK and wait for the rebuild to finish.

2.Save the Harness.

3.In MxVDev, connect the Harness.

4.You can use the Signals to create TestCases in MxVDev.


Related Topics:

Using VMCs

MxVMC - The Virtual MicroController

Visual Studio and MxVDev