xPC Target | ![]() ![]() |
Control with MATLAB Commands
You run your target application in real time to observe the behavior of your model with generated code.
After xPC Target downloads your target application to the target PC, you can run the target application. This procedure uses the Simulink model xpc_osc3.mdl
as an example, and assumes you have created and downloaded the target application for that model. The default name of the target object is tg
.
On the target PC screen, the Simulation line changes from stopped to running and the AverageTET line periodically updates with a new value.
xPC Target allows you to change many properties and parameters without rebuilding your target application. Two of these properties are StopTime
and SampleTime
.
Although you can change the sample time in between different runs, you can only change the sample time without rebuilding the target application under certain circumstances.
If you choose a sample time that is too small, a CPU overload can occur. If a CPU overload occurs, the target object property CPUOverload
changes to detected
. In that case, change the Fixed step size in the Solver pane to a larger value and rebuild the model.
![]() | Control with xPC Target Remote Control Tool | Control with Simulink External Mode | ![]() |