Build the Windows test apps

USB Library ›› Device ››
… visits
Parent Previous Next

The CDC and HID demos are small Windows programs you can build and change. Use them first to check communication with a working PIC example. Later, replace the test buttons and text display with the controls your own project needs.


WPF is the Windows window-and-controls system used by these apps. The program code is Visual Basic (.NET). You do not need to create a new project or choose a new window template: open the supplied one.

1. Install Visual Studio

Use Visual Studio Community 2026 on Windows. Community is free for individual developers; Microsoft lists its usage terms on the Community page.

  1. Download Community from Microsoft's Visual Studio downloads.
  2. In Visual Studio Installer, select .NET desktop development. This is the workload for Visual Basic and WPF.
  3. Include the .NET Framework 4.8 targeting pack and the workload's .NET build tools.
  4. Finish installation. If Visual Studio is already installed, open its Installer and choose Modify to add missing components.

Keep these projects on .NET Framework 4.8. Installing a newer .NET SDK does not mean you should change the app's target to .NET 8 or .NET 10. The supplied desktop projects already select the intended framework.

Microsoft's workload list identifies the desktop tools. If Visual Studio reports missing framework reference files, add the 4.8 Developer Pack or targeting pack.

2. Open the supplied project

Extract the complete USB download first. Work on a copy of the app source so you can return to the original example.

App you want

Source folder

Open in Visual Studio

CDC serial test

CDC Data → PC Host App

CDC_Data_VS_WPF.sln

HID data test

HID Data → PC Host App

The supplied solution, or HID_Data_VS_WPF.vbproj

Choose File → Open → Project/Solution, then select the file. Let Visual Studio finish loading the project and restoring any build dependencies it requests. Keep the supporting source files in place.


The Windows app is separate from your Positron .bas program. Visual Studio builds the PC app; Positron compiles the PIC firmware. Building one does not program the other.

3. Build and start it

  1. Select Release in Visual Studio's build-configuration list. Keep the supplied platform and framework settings for the first build.
  2. Choose Build → Build Solution.
  3. If the solution contains more than one project, make the WPF app the Startup Project. The separate automated test project is not the demo window.
  4. Choose Debug → Start Without Debugging to open the app.
  5. For later use, open the app's bin\Release\net48 folder and run the generated .exe. Keep that folder's normal output files together.

The built apps need the .NET Framework runtime on the Windows PC. Visual Studio is needed to edit and build the source, not to run a completed app. The CDC README specifies Windows 10 or 11 with .NET Framework 4.8.

4. Match it to the PIC

Use the corresponding working firmware example from Framework as your first test. Check its PIC and clock settings before programming your board.

A green connection panel means the PC opened the connection. Send one known command and check the expected reply to prove that both programs understand each other.

5. Make a small change of your own

Start with one label or button, rebuild, and check it. Then add one new command with a matching action in the PIC program.

File

What you normally change

MainWindow.xaml

Labels, buttons and window layout

MainWindow.xaml.vb

Device/port defaults, button actions and received-data handling

Styles.xaml

Colours and shared appearance

The supporting communication files can normally stay as supplied. Keep the window's connection and closing code intact while learning. The separate README_CDC.md and README_HID.md explain the optional functions when you need more than this first test.

If the build does not start

See also

Created with the Personal Edition of HelpNDoc: Free help authoring environment