| Customize Help
| Save Settings

MobjAlloc



Function Map
Synopsis
Allocate a MIL utility object for network communications using DMIL, MILweb, or HTTP.
Syntax
MIL_ID MobjAlloc(
MIL_ID SysId, //in
MIL_INT64 ObjectType, //in
MIL_INT64 InitFlag, //in
MIL_ID *ObjIdPtr //out
)
Description

This function allocates a MIL utility object (for example, a message mailbox or HTTP server) for network communication with remote computers using DMIL, MILweb, or HTTP. You can control and inquire a MIL utility object using MobjControl() and MobjInquire(), respectively. When the MIL utility object is no longer required, release it, using MobjFree().

Note, to allocate all other MIL objects that this module can manipulate, use the allocation function of the object's corresponding MIL module (for example, to allocate an image buffer, use MbufAlloc...()).

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
SysId

Specifies the system on which to allocate the MIL utility object. This parameter should be set to one of the following values:

function map For specifying the system
Click to summarizeValue Description
Click to summarize M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Click to summarize MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

ObjectType

Specifies the type of MIL utility object to allocate.

See the Parameter associations section for possible values that can be specified.

InitFlag INQ

Specifies the initialization of the MIL utility object.

Set this parameter to M_DEFAULT if not used.

See the Parameter associations section for possible values that can be specified.

ObjIdPtr

Specifies the address in which to return the identifier of the allocated MIL utility object. Since MobjAlloc() also returns the identifier, you can set this parameter to M_NULL.

The table below lists possible values for the ObjectType and InitFlag parameters.

function map For specifying the type of MIL utility object to allocate
Click to summarizeObjectType Description
InitFlag
Click to summarize M_HTTP_SERVER

Creates an HTTP server.

Once configured, the HTTP server hosts files on the local computer, for read-only access by remote computers. You configure the server using MobjControl(). You must set the directory on the local computer that contains the files to host (using M_HTTP_ROOT_DIRECTORY) and enable the HTTP server (using M_HTTP_START).

This setting requires MIL driver update 47 (or later).

(summarize)
Click to summarize M_MESSAGE_MAILBOX

Creates a message mailbox.

You can read from a message mailbox using MobjMessageRead() and write to a message mailbox using MobjMessageWrite().

(summarize)
Click to summarize M_DEFAULT

Same as M_QUEUE.

Click to summarize M_OVERWRITE

Specifies that only one message can be kept in the mailbox and is replaced at each write. The message is kept after a read operation.

(summarize)
Click to summarize M_QUEUE

Specifies that multiple messages can be queued in the mailbox. Messages are read on a FIFO basis. Upon a read operation, a message is removed from the queued message mailbox by default. To keep a message in the queued message mailbox after a read operation, call MobjMessageRead() with M_KEEP_IN_QUEUE.

(summarize)
Return value
The returned value is the MIL utility object identifier 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 HOST HTTP SERVER MESSAGE MAILBOX DEFAULT OVERWRITE QUEUE