| Customize Help
| Save Settings

McomAlloc



Function Map
Synopsis
Allocate an Industrial Communication context.
Syntax
MIL_ID McomAlloc(
MIL_ID SysId, //in
MIL_INT64 ProtocolType, //in
MIL_CONST_TEXT_PTR DeviceDescription, //in
MIL_INT64 InitFlag, //in
MIL_INT64 InitValue, //in
MIL_ID *ComIdPtr //out
)
Description

This function allocates an Industrial Communication context on the specified system. An Industrial Communication context allows you to communicate with a robot controller, with a generic controller that uses the specified industrial protocol (PROFINET, Modbus, EtherNet/IP, or CC-Link IE Field Basic), or with a slave Modbus automation device.

For a context allocated to communicate using the PROFINET, Modbus, EtherNet/IP, or CC-Link IE Field Basic protocol, a connection with the controller (or device) is established upon allocation of the context. As such, the protocol service must have been enabled and configured in MILConfig prior to allocating the context.

For a context allocated to communicate with a robot controller, you can choose to set the InitFlag parameter to M_COM_NO_CONNECT so that you do not connect automatically upon allocation. If this option is chosen, you must use McomControl() with M_COM_ROBOT_CONNECT to manually establish the connection with the robot controller.

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

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
SysId INQ

Specifies the system on which to allocate the Industrial Communication context. This parameter should be set to one of the following values:

function map For specifying the system
Click to summarizeValue Description MIL system-specific
tooltip (‡)
Click to summarize M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

a t
U28
w
U53
Click to summarize MIL system identifier

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

a t
U28
w
U53
ProtocolType INQ

Specifies the type of protocol to use.

function map For specifying the type of protocol
Click to summarizeValue Description MIL system-specific
tooltip (‡)
Click to summarize M_COM_PROTOCOL_ABB

Specifies an ABB robot controller protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_CCLINK

Specifies a CC-Link IE Field Basic protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_DENSO

Specifies a DENSO robot controller protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_EPSON

Specifies an Epson robot controller protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_ETHERNETIP

Specifies an Ethernet/IP protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_FANUC

Specifies a Fanuc robot controller protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_KUKA

Specifies a KUKA robot controller protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_MODBUS

Specifies a Modbus protocol.

a t
U28
w
U53
Click to summarize M_COM_PROTOCOL_PROFINET

Specifies a PROFINET protocol.

(summarize)
a t
U28
w
U53
MIL system specific

Note that the Host system is only supported on the Matrox 4Sight GPm and EV6 platforms. Support for the Matrox 4Sight EV6 platform requires driver update 93.

a
Click to summarize M_COM_PROTOCOL_STAUBLI

Specifies a Staubli robot controller protocol.

a t
U28
w
U53
DeviceDescription INQ

Specifies the description of the device with which to communicate. This parameter must be set to the following:

function map For describing the device
Click to summarizeValue Description MIL system-specific
tooltip (‡)
Click to summarize MIL_TEXT("M_DEFAULT") 1

Specifies to communicate with the default device described in MILConfig that uses the specified protocol. If the protocol selected in the ProtocolType parameter is not enabled in the MILConfig utility (for the non-robot controller types of Industrial Communication contexts), an error is returned.

(summarize)
a t
U28
w
U53
Click to summarize MIL_TEXT("IPOrName:Port") 1

Specifies the IP address and port on the robot controller to use to communicate with it. The MIL Industrial Communication module supports IPv4 addresses. A typical IPv4 string has the format n.n.n.n, where n is a number between 0 and 255.

INQ(summarize)
a t
U28
w
U53

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

InitFlag INQ

Specifies how to initialize the Industrial Communication context.

function map For specifying the type of initialization
Click to summarizeValue Description MIL system-specific
tooltip (‡)
Click to summarize M_DEFAULT

Specifies the default behavior.

This is the only possible setting when allocating a context to communicate with a non-robot controller device.

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

Specifies not to automatically connect to the robot controller.

a t
U28
w
U53
InitValue

Reserved for future expansion and must be set to M_DEFAULT.

ComIdPtr

Specifies the address in which to return the identifier of the Industrial Communication context. Since McomAlloc() also returns the identifier, you can set this parameter to M_NULL.

Return value
The returned value is the Industrial Communication context identifier if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib; milcom.lib.
DLL Requires mil.dll; milcom.dll.
DEFAULT HOST COM PROTOCOL ABB COM PROTOCOL CCLINK COM PROTOCOL DENSO COM PROTOCOL EPSON COM PROTOCOL ETHERNETIP COM PROTOCOL FANUC COM PROTOCOL KUKA COM PROTOCOL MODBUS COM PROTOCOL PROFINET COM PROTOCOL STAUBLI DEFAULT" DEFAULT COM NO CONNECT