User`s guide
2 Automa tion Interface
Managing Custom Data Types with the Data Type Manager
Using custom data types, called typedefs (using the C keyword typedef), is
one of the complications you encounter when yo u u se hardware-in-the-loop
(HIL) to run a function in your project from MATLAB. Because MATLAB
does not r ecognize custom type definitions you use in your projects, it cannot
interpret data that you define in your project code with the
typedef keyword,
or use as arguments in your function prototype (declaration).
To allow you to use functions that include custom type definitions in function
calls, Embedded IDE Link CC offers the Data Type Manager (DTM), a tool
for defining custom type d efinitions to MATLAB. Using options in the D TM,
you define one o r more custom data types for a project and use them in the
project. Or you define your custom data types and save them to use in many
projects. This second feature is particularly useful when you use th e same
custom data types in many projects. Rather than redefining your custom
types for each new project or function, you reload the types from an earlier
project t o use them again.
As programmers , usually you use typedefs for one or more of a few reasons:
• Make your code more a ccessible by provid ing more inform a tion about the
variable(s)
• Create a Boolean data type that C does not provide
• Define structures in your programs
• Define nonstandard data types
The DTM lets you define all of these things in the M ATLAB context so your
C function that uses typedefs works with your MATLAB command line
functions. For reference information about the DTM, go to
datatypemanager.
Entering
datatypemanager(cc)
2-58