| Customize Help
| Save Settings

McomControl



Function Map
Synopsis
Control an Industrial Communication context setting.
Syntax
void McomControl(
MIL_ID ComId, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE ControlValue //in
)
Description

This function changes a setting of an Industrial Communication context.

This function is only available if you have the MIL Industrial Communication package, or another relevant update installed.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, McomControl() internally calls the MIL_DOUBLE version of this function (McomControlDouble()). If you need to pass text values, call the MIL_CONST_TEXT_PTR version of this function (McomControlText()).
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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ComId

Specifies the identifier of the Industrial Communication context.

ControlType

Specifies the Industrial Communication setting to control.

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

ControlValue

Specifies the setting's new value.

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

The tables below list possible values for the ControlType and ControlValue parameters.

The following ControlType and ControlValue parameter settings can be specified for any type of Industrial Communication context:

function map For any type of Industrial Communication context
Click to summarizeControlType Description MIL system-specific
tooltip (‡)
ControlValue
Click to summarize M_COM_TIMEOUT

Sets the maximum amount of time to wait for a receiving function (for example, McomRead() or McomWaitPositionRequest()) to finish its execution. INQ

(summarize)
a t
U28
w
U53
Click to summarize Value

Specifies the maximum amount of time to wait, in msecs.

a t
U28
w
U53

The following ControlType and ControlValue parameter settings can be specified for an Industrial Communication context used to communicate with a robot controller:

function map For an Industrial Communication context for use with a robot controller
Click to summarize
ControlType
Description MIL system-specific
tooltip (‡)
ControlValue
Click to summarize M_COM_REMOTE_ADDRESS

Sets the IP address of a robot controller.

If an IP address was specified upon context allocation (using McomAlloc() with "IPOrName:Port"), setting this control type will overwrite that address.

Changing the value of this control type will have no effect until you call McomControl() with M_COM_ROBOT_CONNECT. If the Industrial Communication context was previously connected to a robot controller, you must first disconnect it from the robot controller using McomControl() with M_COM_ROBOT_DISCONNECT. INQ

(summarize)
a t
U28
w
U53
Click to summarize
M_PTR_TO_DOUBLE(
MIL_CONST_TEXT_PTR String
)

Casts the address of the string identifying the remote address, from a MIL_CONST_TEXT_PTR to a MIL_DOUBLE.

(summarize)
a t
U28
w
U53
Parameters

This parameter specifies the string whose address to cast.

"n.n.n.n"

Specifies the IP address of the robot controller. Express the address as a string in dotted decimal notation, where each dotted decimal value (n) is a number between 0 and 255.

a t
U28
w
U53
Click to summarize M_COM_REMOTE_PORT

Sets the port on the robot controller to use to communicate with it.

If a port number was specified upon context allocation (using McomAlloc() with "IPOrName:Port"), setting this control type will overwrite that port number.

Changing the value of this control type will have no effect until you call McomControl() with M_COM_ROBOT_CONNECT. If the Industrial Communication context was previously connected to a robot controller, you must first disconnect it from the robot controller using McomControl() with M_COM_ROBOT_DISCONNECT. INQ

(summarize)
a t
U28
w
U53
Click to summarize Value > 0

Specifies the port on the robot controller.

a t
U28
w
U53
Click to summarize M_COM_ROBOT_CONNECT

Connects to the robot controller.

(summarize)
a t
U28
w
U53
Click to summarize M_DEFAULT

Specifies the default behavior.

a t
U28
w
U53
Click to summarize M_COM_ROBOT_CONNECT_RETRY

Sets the maximum number of times to attempt to reconnect to the robot controller. INQ

(summarize)
a t
U28
w
U53
Click to summarize Value

Specifies the maximum number of times to attempt to reconnect.

a t
U28
w
U53
Click to summarize M_COM_ROBOT_CONNECT_RETRY_WAIT

Sets the amount of time to wait between attempts to connect to the robot controller. INQ

(summarize)
a t
U28
w
U53
Click to summarize Value

Specifies the amount of time to wait, in msecs.

a t
U28
w
U53
Click to summarize M_COM_ROBOT_DISCONNECT

Disconnects from the robot controller.

(summarize)
a t
U28
w
U53
Click to summarize M_DEFAULT

Specifies the default behavior.

a t
U28
w
U53
Type-specific versions of the function when using a C compiler under 64-bit
void McomControlText (MIL_ID ComId, MIL_INT64 ControlType, MIL_CONST_TEXT_PTR ControlValue)
Parameters

ComId

See ComId 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 McomControlDouble (MIL_ID ComId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue)
Parameters

ComId

See ComId 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; milcom.lib.
DLL Requires mil.dll; milcom.dll.
COM TIMEOUT COM REMOTE ADDRESS COM REMOTE PORT COM ROBOT CONNECT DEFAULT COM ROBOT CONNECT RETRY COM ROBOT CONNECT RETRY WAIT COM ROBOT DISCONNECT DEFAULT COM PROTOCOL PROFINET COM PROTOCOL ETHERNETIP COM PROTOCOL MODBUS COM PROTOCOL CCLINK