| MIL 10 Reference
| Customize Help
| Save Settings

MfuncAllocId



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Associate a MIL identifier with a user-defined object.
Syntax
MIL_ID MfuncAllocId(
MIL_ID ContextFuncId, //in
MIL_INT64 MilObjectType, //in
void *UserObjectPtr //in
)
Description

This function allows you to associate a MIL identifier with a user-defined object (such as, a structure or an array). You can associate a MIL identifier with a user object so that it is recognized by MIL and treated as a standard MIL object during tracing or error handling. Once the object is associated with an identifier, the object is known as a user-defined MIL object.

The parameters passed to MfuncAllocId() do not allow you to specify whether the user-defined object is allocated on the Host or on a system with an on-board processor. For information on creating user-defined objects on systems with on-board processors and associating these object with MIL identifiers, see the Associating a MIL identifier with a user-defined object section of Chapter 33: The MIL function development module.

You must also specify a MIL type for your object (MilObjectType parameter). MIL allows up to 32 different user-defined MIL object types.

Use the MIL identifier to refer to the user-defined MIL object. To refer to the actual data grouped into this user-defined object, use the pointer to the object (UserObjectPtr parameter).

To inquire about the type of this object, or the pointer to it, use the MfuncInquire() function.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextFuncId

Specifies a MIL function identifier. This parameter can be set to the following values:

function map For a MIL function identifier
CollapseValue Description
Collapse M_DEFAULT

Specifies the default MIL function identifier. Use this value to create user-defined MIL objects outside of a user-defined MIL function.

(summarize)
Collapse MIL function identifier

Specifies the identifier of a user-defined MIL function.

MilObjectType

Specifies the MIL type of the user-defined object to be associated with a MIL identifier. To specify the type, you must specify one of the groups listed in the table below and combine it with an offset. The two object groups allow you to distinguish between custom created objects, especially when the created objects are to be used in different MIL modules.

function map For specifying the MIL type of user-defined object
CollapseValue Description
Collapse M_USER_OBJECT_1 +

Specifies that the user object falls under the first group of user object types.


You must specify a combination value from the following table:
(summarize)
Collapse M_USER_OBJECT_2 +

Specifies that the user object falls under the second group of user object types.


You must specify a combination value from the following table:
(summarize)
Combination constant for any of the possible values of the MilObjectType parameter.

You must add the following value to the above-mentioned values to set the offset.

The offset allows you to distinguish between the different object types of the same group (for example, M_USER_OBJECT_1 + 0x0001).

function map For distinguishing between the different object types
CollapseCombination value Description
Collapse Value

Specifies the offset within the selected object type group. The value must have only one of its 16 least significant bits set.

(summarize)
UserObjectPtr

Specifies the address of the user-defined object that is to be associated with a MIL identifier. Note that user-defined objects stored in the memory of an on-board processor are not accessible from Host, and vice versa.

This object can be a structure, an array, or any other data type.

Return value
The returned value is the MIL identifier associated with the object if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT USER OBJECT 1 USER OBJECT 2