XPC Overview

From Mech
Jump to navigationJump to search

Interacting with your Model

There are two ways to interact with your model once it is running on the Target PC, and they are desribed below:

  • External Simulink Mode
Once you build and download your model, you can switch your Simulink model on the Host PC to "External" mode (located right next to the simulation time). Then you have to connect to the Target PC by clicking the little button to the left. At this point you can start and stop your model and change basic parameters (gains, amplitudes, frequencies, etc.) If you change anything significant in your simulink model, it will request that you rebuild before reconnecting.
Use this mode for simple parameter tuning and testing
  • Through a Matlab M-File
Communicating through a Matlab M-file allows you to perform exactly the same actions in exeternal mode, except you can update parameters and record signals much faster. This is accomplished by writing a script that directly accesses the functions that the the simulink blocks would call in external mode. You can read more about these functions in xPC M-file Communication.
Use this mode for "real-time" interaction with your model (keyboard input, data display, host calculations, etc. )