xPC Target |
 |
Creating a Custom Graphical Interface
xPC Target provides Simulink interface blocks to connect graphical interface elements to your target application. The steps for creating your own custom graphical interface are listed below. For more information, see Interface with Dials & Gauges Blockset.
- In the Simulink target application model, decide which block parameters and block signals you want to have access to through graphical interface control devices and graphical interface display devices.
- Tag all block parameters in the Simulink model that you want to be connected to a control device. See Marking Block Parameters.
- Tag all signals in Simulink model that you want to be connected to a display device. See Marking Block Signals.
- In MATLAB, run the function
xpcsliface('
model_name
')
to create the user interface template model. This function generates a new Simulink model containing only the xPC Target interface blocks (To xPC Target and From xPC Target) defined by the tagged block parameters and block signals in the target application model. See Creating a User Interface Model.
- To the user interface template model, add Simulink interface blocks from add-on products (Dials & Gauges, Virtual Reality Toolbox, Altia Design). Connect these blocks to the xPC Target interface blocks (To PC Target and From xPC Target). The To xPC Target blocks on the left should be connected to control devices, and the From xPC Target blocks on the right should be connected to the display devices. You can position these blocks to your liking.
- Start both the xPC target application and the Simulink user interface model that represents the xPC Target application. See Running a Target Application with a User Interface Model.
| Simulink User Interface Model | | To xPC Target Block |  |