| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
| On this page… |
|---|
Accessing the Demo Project Solution |
To help you better understand and quickly begin to use COM API functions to create custom GUI applications, the xPC Target environment provides a number of API demos and scripts in the C:\matlabroot\toolbox\rtw\targets\xpc\api directory. This topic briefly describes those demos and scripts.
The Microsoft Visual Basic .NET 2003 demo illustrates how to create a custom GUI that connects to a target PC with a downloaded target application. The solution file for this demo is located in
C:\matlabroot\toolbox\rtw\targets\xpc\api\VBNET\SigsAndParamsDemo
bin — Contains the executable for the demo project and the xpcapi.dll file
Demo.sln — Contains a solution file for the Demo project
The Demo.sln file contains all the Visual Basic .NET 2003 files to run the windows form application. This demo is a functional application that you can use as a template to create your own custom GUIs.
The COM API example from Example Visual Basic GUI Using COM Objects is a simple GUI that illustrates some basic concepts for creating a GUI with the COM API. The Demo solution is a more advanced example that illustrates how to create a GUI similar to the xPC Target Explorer. The Demo solution is fully commented.
This demo illustrates how you can use the COM API to create a GUI that
Connects to the target PC via an RS-232 or TCP/IP connection
Starts and stops the target application loaded on the target PC
Retrieves and lists all the signals in the target application
Displays the value of a selected signal
Retrieves and lists all the parameters in the target application
Change the values of the parameters
To use the Demo solution, you need
A target PC running a current xPC Target kernel
A host PC running the MATLAB software interface, connected to the target PC via RS-232 or TCP/IP
A target application loaded on the target PC
The xPC Target product ships with an executable version of the demo. If you want to rebuild the Demo solution, of if you want to write your own custom GUIs like this one, you need Microsoft Visual Basic .NET 2003 installed on the host PC.
Note The xPC Target software allows you to create applications, such as GUIs, to interact with a target PC with COM API functions. xPC Target COM API describes this in detail. To deploy a GUI application to other host PC systems that do not have your licensed copy of the xPC Target product, you need the xPC Target Embedded Option™. If you do not have the xPC Target Embedded Option and would like to deploy your GUI application, contact your MathWorks™ representative. |
To access the Demo solution,
Copy the contents of the VBNET directory to a writable directory of your choice.
Change directory to the one that contains your copy of the Demo solution.
The Microsoft Development Environment for Visual Basic application starts.
In the Solution Explorer pane, double-click Form1.vb to display the Demo solution form.
The form is displayed. You can inspect the layout of the demo.
To inspect the form code, select the View menu Code option.
The Visual Basic code for the form is displayed.
To rebuild the Demo solution,
The Microsoft Development Environment for Visual Basic application starts.
To use the Demo solution executable,
![]() | xPC Target COM API Demos and Scripts | Microsoft Visual Basic 6.0 Demo | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |