| 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 sf_car_xpc Project |
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
Connects to the target PC via an RS-232 or TCP/IP connection
Loads the sf_car_xpc.dlm target application to the target PC
Starts and starts the target application engine
Edits the stop time of the target application
Edits the sample time of the target application
Displays the speed, RPM, and gear of the target application engine
Note For detailed information on the project, see the readme.txt files located in C:\matlabroot\toolbox\rtw\targets\xpc\api\VisualBasic\Models\sf_car_xpc*. |
To use the sf_car_xpc project, you need
A target PC running a current xPC Target kernel
A host PC running the MATLABinterface, connected to the target PC via RS-232 or TCP/IP
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.
Note The xPC Target environment 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 license. If you do not have the xPC Target Embedded Option license and would like to deploy your GUI application, contact your MATLAB representative. |
To access the sf_car_xpc project,
Copy the contents of the VisualBasic directory to a writable directory of your choice.
Change directory to the one that contains your copy of the sf_car_xpc project.
Double-click the Visual Basic project. For example, double-click sf_car_xpc_COM.vbp.
The Microsoft Visual Basic application starts.
Double-click the form you want to look at.
The form is displayed. You can inspect the layout of it.
To inspect the form code, select the View menu Code option.
The Visual Basic code for the form is displayed.
To rebuild the sf_car_xpc project,
Double-click the Visual Basic project. For example, double-click sf_car_xpc_COM.vbp.
The Microsoft Visual Basic application starts.
To use the sf_car_xpc project executable,
![]() | Microsoft Visual Basic 7.1 (.NET 2003) Demo | Tcl/Tk Scripts | ![]() |

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 |