Products & Services Solutions Academia Support User Community Company

Learn more about xPC Target   

Microsoft Visual Basic 6.0 Demo

Introduction

The Microsoft Visual Basic 6.0 sf_car_xpc demo illustrates how to create a custom GUI that connects to a target PC. The files for this demo are located in

C:\matlabroot\toolbox\rtw\targets\xpc\api\VisualBasic\Models\sf_car_xpc*

This application interfaces with the xPC Target application sf_car_xpc.dlm, built from the Simulink model sf_car_xpc.mdl. This model simulates an automatic transmission control system composed of modules that represent the engine, transmission, and vehicle, with an additional logic block to control the transmission ratio. User inputs to the model are in the form of throttle (%) and brake torque (ft-lb).

This demo illustrates how you can use the COM API to create a GUI that

Before Starting

To use the sf_car_xpc project, you need

The xPC Target product ships with an executable version of the sf_car_xpc project. If you want to rebuild the sf_car_xpc project, you need Microsoft Visual Basic 6.0 Professional installed on the host PC. If you want to view or edit the model, you need to have the Stateflow® product installed on the host PC.

Accessing the sf_car_xpc Project

To access the sf_car_xpc project,

  1. Copy the contents of the VisualBasic directory to a writable directory of your choice.

  2. Change directory to the one that contains your copy of the sf_car_xpc project.

  3. Double-click the Visual Basic project. For example, double-click sf_car_xpc_COM.vbp.

    The Microsoft Visual Basic application starts.

  4. In the right Project pane, expand the Forms folder.

  5. Double-click the form you want to look at.

    The form is displayed. You can inspect the layout of it.

  6. To inspect the form code, select the View menu Code option.

    The Visual Basic code for the form is displayed.

Rebuilding the sf_car_xpc Project

To rebuild the sf_car_xpc project,

  1. Double-click the Visual Basic project. For example, double-click sf_car_xpc_COM.vbp.

    The Microsoft Visual Basic application starts.

  2. Select the File menu Make sf_car_xpc.exe.

Using the sf_car_xpc Executable

To use the sf_car_xpc project executable,

  1. Change directory to the one that contains your copy of the sf_car_xpc project.

  2. Change directory to the bin directory.

  3. Double-click sf_car_xpc.exe.

    The GUI is displayed.

  


Related Products & Applications

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