| Customize Help
| Save Settings

MobjControl



Function Map
Synopsis
Control a MIL object's settings and associate information with a MIL object.
Syntax
void MobjControl(
MIL_ID ObjectId, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE ControlValue //in
)
Description

This function controls the settings of a MIL object. You can control the read/write properties of a remote MIL object and associate information with a MIL object. You can also control MIL message mailboxes and HTTP servers.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, MobjControl() internally calls the MIL_DOUBLE version of this function (MobjControlDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (MobjControlInt64()).
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
ObjectId

Specifies the identifier of the MIL object to control. The MIL object can be a MIL utility object (allocated using MobjAlloc()) or any other MIL object, except for MIL objects allocated using MfuncAlloc().

ControlType

Specifies the type of MIL object setting to control.

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

ControlValue

Specifies the MIL object setting's new value.

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

The following ControlType and corresponding ControlValue parameter settings are used to control the access of remote MIL objects.

function map For controlling the access of remote MIL objects
Click to summarizeControlType Description
ControlValue
Click to summarize M_DMIL_PUBLISH

Controls a MIL object's remote access rights. If you set a MIL object to M_READ_ONLY or M_READ_WRITE, a monitoring application will be able to access that MIL object once a connection has been established MappOpenConnection() between the monitoring and publishing applications.

Note that the access rights of all MIL objects in a given publishing application cannot be greater than that application's permission level specified in MappControl() with M_DMIL_CONNECTION. INQ

(summarize)
Click to summarize M_NO

Specifies that the MIL object will not be visible.

This is the default value.

(summarize)
Click to summarize M_READ_ONLY

Specifies that the MIL object can only be used as a source or to be inquired.

A MIL object can only be set to M_READ_ONLY if M_DMIL_CONNECTION is set to either M_DMIL_CONTROL or M_DMIL_MONITOR.

(summarize)
Click to summarize M_READ_WRITE

Specifies that the MIL object can be used as a destination or can be controlled by MIL functions.

A MIL object can only be set to M_READ_WRITE if M_DMIL_CONNECTION is set to M_DMIL_CONTROL.

(summarize)

The following ControlType and corresponding ControlValue parameter settings are used to control whether the object is accessible using MILweb.

function map For controlling the access of MILweb objects
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_WEB_PUBLISH

Sets whether the object is accessible using MILweb.

This setting is only supported for message mailboxes and MILweb displays (allocated using MdispAlloc() with M_WEB). It is not supported for objects allocated on a DMIL remote system.

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

(summarize)
Click to summarize M_NO

Specifies that the object is not accessible using MILweb.

This is the default value.

(summarize)
Click to summarize M_READ_ONLY

Specifies that the object can be read from by a MILweb client application.

A MIL object can only be set to M_READ_ONLY if M_WEB_CONNECTION is set to M_ENABLE.

(summarize)
Click to summarize M_READ_WRITE

Specifies that the object can be read from and written to by a MILweb client application.

A MIL object can only be set to M_READ_WRITE if M_WEB_CONNECTION is set to M_ENABLE.

(summarize)

The following ControlType and corresponding ControlValue parameter settings are used to associate information to a MIL object.

function map For associating a MIL object with information
Click to summarizeControlType Description
ControlValue
Click to summarize M_OBJECT_NAME

Sets the name to associate with a MIL object. INQ

(summarize)
Click to summarize
M_PTR_TO_DOUBLE(
MIL_CONST_TEXT_PTR String
)

Casts the address of the string identifying the specified object's name, from a MIL_CONST_TEXT_PTR to a MIL_DOUBLE.

(summarize)
Parameters

Specifies the string whose address to cast.

MIL_TEXT("ObjectName") 1

Specifies the name to associate with the MIL object.

Click to summarize M_OBJECT_USER_DATA_PTR

Sets the address of the user data to associate with a MIL object. This is useful, for example, to associate specific data to the different buffers passed to MdigProcess(). When used with DMIL, the user data pointer is stored locally in the process doing MobjControl. INQ

(summarize)
Click to summarize

Casts the address of the specified user data, from a void * to a MIL_DOUBLE.

(summarize)
Parameters

Specifies the address of the user data.

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

The following ControlType and corresponding ControlValue parameter settings are used to control message mailbox objects allocated using MobjAlloc() with M_MESSAGE_MAILBOX.

function map For controlling message mailboxes
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_QUEUE_FULL_MODE

Sets the behavior of the queue when the message limit is attained. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_WRITE_TIMEOUT.

Click to summarize M_ERROR

Specifies that a MIL error is generated when the message limit is attained.

Click to summarize M_WRITE_TIMEOUT

Specifies to wait for the write timeout to elapse.

Click to summarize M_QUEUE_SIZE

Sets the number of messages the queue can hold. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 100 messages.

Click to summarize Value > 0

Specifies the number of messages the queue can hold.

Click to summarize M_READ_TIMEOUT

Sets the amount of time to wait for a read operation. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_INFINITE.

Click to summarize M_INFINITE

Specifies that the read operation waits indefinitely.

Click to summarize Value > 0

Specifies the amount of time to wait, in msecs.

Click to summarize M_RESET

Resets the message mailbox by removing all messages.

(summarize)
Click to summarize M_DEFAULT

Specifies the default behavior.

Click to summarize M_WRITE_TIMEOUT

Sets the amount of time to wait for a write operation. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_INFINITE.

Click to summarize M_INFINITE

Specifies that the write operation waits indefinitely.

Click to summarize Value > 0

Specifies the amount of time to wait, in msecs.

The following ControlType and corresponding ControlValue parameter settings are used to control MIL HTTP server objects allocated using MobjAlloc() with M_HTTP_SERVER.

function map For controlling HTTP servers
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_HTTP_ADDRESS

Sets the web address (URL) with which the MIL HTTP server can be accessed in a web browser.

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

(summarize)
Click to summarize
M_PTR_TO_DOUBLE(
MIL_CONST_TEXT_PTR String
)

Casts the address of the string identifying the specified object's name, from a MIL_CONST_TEXT_PTR to a MIL_DOUBLE.

(summarize)
Parameters

Specifies the string whose address to cast.

MIL_TEXT("http://server:port") 1

Specifies the web address (URL). This must consist of http://, followed by the domain name or local static IP address of the local computer (for example, http://192.168.1.58 or http://VisionController42).

Optionally, you can specify the port number in the address; this must be the same as the port specified by M_HTTP_PORT. Typically, specifying the port is only useful if you have multiple HTTP server processes running on the same computer. Note that this includes third-party HTTP server software.

The default URL is "http://localhost". This web address is only accessible from a web browser running on the local computer.

Click to summarize M_HTTP_PORT

Sets the port on which the MIL HTTP server listens for incoming connections.

If you specified a port number using M_HTTP_ADDRESS, this must be the same port.

For increased security, you should ensure that remote computers on the internet cannot access this port of the local computer.

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

(summarize)
Click to summarize 0 <= Value <=66535

Specifies the port number.

This port must not be used by any other application (including third-party applications) running on the local computer.

The default value is 8080.

(summarize)
Click to summarize M_HTTP_ROOT_DIRECTORY

Sets the path of the folder on the local computer in which the files hosted by the MIL HTTP server are stored (for example, HTML and JavaScript files). All files in this folder (and its subfolders) are made available to connected computers when the HTTP server is enabled (using M_HTTP_START).

You should typically ensure that there are no sensitive files in this folder (or its subfolders).

There is no default directory; you must manually set a directory before enabling the HTTP server.

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

(summarize)
Click to summarize
M_PTR_TO_DOUBLE(
MIL_CONST_TEXT_PTR String
)

Casts the address of the string identifying the specified object's name, from a MIL_CONST_TEXT_PTR to a MIL_DOUBLE.

(summarize)
Parameters

Specifies the string whose address to cast.

MIL_TEXT("DirectoryName") 1

Specifies the drive and path of the folder (for example, "C:\mydirectory").

Click to summarize M_HTTP_START

Enables the MIL HTTP server.

MIL HTTP servers are intended to be run on a segmented LAN that has no internet/WAN access; MIL HTTP servers offer no internal security mechanisms. When a MIL HTTP server is enabled, you should typically ensure that your network administrator configures your network to prevent incoming connections from the internet to the computer running your MIL application (and from any other devices on your network that do not need access). If this is not possible, at a minimum, you should block incoming connections from the internet to the listening port of the HTTP server. You can inquire which port is used for this purpose, using MobjInquire() with M_HTTP_PORT.

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

(summarize)
Click to summarize M_HTTP_STOP

Disables the MIL HTTP server.

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

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

Type-specific versions of the function when using a C compiler under 64-bit
void MobjControlDouble (MIL_ID ObjectId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue)
Parameters

ObjectId

See ObjectId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

void MobjControlInt64 (MIL_ID ObjectId, MIL_INT64 ControlType, MIL_INT64 ControlValue)
Parameters

ObjectId

See ObjectId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DMIL PUBLISH NO READ ONLY READ WRITE WEB PUBLISH NO READ ONLY READ WRITE OBJECT NAME OBJECT USER DATA PTR QUEUE FULL MODE DEFAULT ERROR WRITE TIMEOUT QUEUE SIZE DEFAULT READ TIMEOUT DEFAULT INFINITE RESET DEFAULT WRITE TIMEOUT DEFAULT INFINITE HTTP ADDRESS HTTP PORT HTTP ROOT DIRECTORY HTTP START HTTP STOP WEB