| 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 |
This topic lists guidelines you should follow when creating a mask for your xPC Target driver. You should already know how to create masked blocks. See the Working with Block Masks chapter in Simulink User's Guide for further information.
Users access the masked block to interact with the driver, which in turn interacts with the device.
Create an S-Function block for the driver.
Decide on the set of parameters the user will need to provide to the driver. You should have already programmed this into the driver C code itself.
Select appropriate descriptive names for these parameters.
For each parameter, decide if the parameter can accept a finite number of possible input values. If yes, consider using one of the following widgets:
Check box — For yes/no or 1/0 inputs
Drop-down list — For a finite list of choices
Your mask can also be dynamic, where the dialog changes according to user selections.
Choose readable and appropriate variable names.
As necessary and appropriate, configure the library block so that the block mask modifies its label according to user input. For example, a check box might cause the dialog to change.
Ensure that the title beneath the driver block terminates with a blank space. This is because if a model contains more than one block of any given type, Simulink appends a number to the title under the block. Adding a blank space to the end of the label ensures readability.
Name the block appropriately so that it indicates the purpose of the driver.
If you want to link help information to the mask Help button, see Defining Mask Documentation in the Working with Block Masks chapter of Simulink User's Guide for details.
From within the mask, you can call a custom file to perform a number of operations, including the following:
Range checking for all parameters. For example, if you expect input values from 1 to 10, do not allow users to enter negative values, or values greater than 10.
Cross-block checking (see Cross-Block Checking).
![]() | Creating Driver Subsystem Masks | Cross-Block Checking | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2010- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |