User`s guide

Driver Mask Guidelines
Driver Mask Guidelines
This top ic lists guidel in es you sh ould follow when cre ati ng a ma sk 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 w ith the driver, which in turn
interacts w ith the device.
Create an S-Function block for the driver.
Decide on the set of parameters the user will need to provide to the d river.
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 Fo r a finite list of choice s
Yourmaskcanalsobedynamic,wherethe 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 h elp i nform ation to the mask Help button, see 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:
4-3