MATLAB XPC TARGET 4 - DEVICE DRIVERS User's Guide Page 46

  • Download
  • Add to my manuals
  • Print
  • Page
    / 111
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 45
4 Masking Drivers
This example returns a string to display on the block with the variable
port_label commands with which to label the input and output ports. The
number and content of the
port_label commands depend on the cha nnel
vector
that the u ser enters in the mask.
5 Select the Documentation tab. This tab contains three fields, Mask type,
Mask description,andMask help.
In the Mask type field, enter the type of driver. F or example:
addiamondmm32
In the Mask description field, enter a description for the driver. For
example:
MM-32
Diamond
Analog Input
In the Mask help field, if you are providing any online docume n ta t ion to
associate with the Help button, you can call that online documentation
from this field. See in the “W orking with Block Masks” chapter of Simulink
User’s Guide for details.
6 Click OK to save the mask.
After you create the block m ask, you can define an
InitFcn callback for the
block. A model calls this callback at the start of model simulation.
1 Right-clicktheblockandselectBlock Properties from the drop-down list.
2 Select the Callback tab from the dialog. From the list, select InitFcn.
Enter MATLAB code in the edit box.
Oneconventionistousethesamefunctionthatisusedatmask
initialization time (for example,
maddiamondmm32.m), but with a singl e
argument that indicates that this is being called at
InitFcn time.
maddiamondmm32(1)
4-10
Page view 45
1 2 ... 41 42 43 44 45 46 47 48 49 50 51 ... 110 111

Comments to this Manuals

No comments