| Customize Help
| Save Settings

MappOpenConnection



Function Map
Synopsis
Connect to a Distributed MIL publishing application.
Syntax
void MappOpenConnection(
MIL_CONST_TEXT_PTR ConnectionDescriptor, //in
MIL_INT64 InitFlag, //in
MIL_INT64 ControlFlag, //in
MIL_ID *RemoteContextAppIdPtr //out
)
Description

This function opens a connection to a local or remote computer that is running a publishing application, through the listening port of the publishing application. This function should be run from the monitoring application and it gives access to the MIL objects that the publishing application publishes (read-only or read/write). Once it opens the connection, this function returns the MIL application context identifier of the publishing application.

You must specify the monitoring application's connection port if the default connection port, set with the MILConfig utility, is different from the publishing application's listening port. Furthermore, if you have set up a passkey for publishing applications on the remote computer (using the MILConfig utility on the remote computer), you must specify the remote computer's passkey when establishing a connection from the monitoring application. A passkey permits a secure connection between the publishing and monitoring applications. The passkey is a case-sensitive alphanumeric string of up to 16 characters in length.

Note that the publishing application must have called MappControl() with M_DMIL_CONNECTION set to either M_DMIL_CONTROL or M_DMIL_MONITOR before the connection can take place.

Prior to connecting to a Distributed MIL publishing application, certain conditions must be met. For more information, see Chapter 48: Distributed MIL.

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
ConnectionDescriptor

Specifies the computer to which to connect, and if necessary the listening port of the publishing application. A publishing application must have already enabled publishing using M_DMIL_CONNECTION.

function map For specifying the remote application
Click to summarizeValue Description
Click to summarize MIL_TEXT("dmilpcie://[Passkey:]RemoteComputerName[:Port]") 1
[This is only applicable to Matrox Supersight platform]

Opens a connection to a remote Matrox Supersight SHB. The connection uses the DMIL PCIe protocol. To connect to a remote Matrox Supersight SHB, that SHB must have a valid MIL installation and be in the same Matrox Supersight as the SHB running the monitoring application.

When specifying the string that indicates the remote SHB:

  • If required, replace [Passkey] with the passkey for publishing applications on the remote SHB. The passkey is an alphanumeric string of up to 16 characters in length. If a passkey was set up for publishing applications on the remote SHB, you must specify the passkey when establishing a connection from the monitoring application to the publishing application. If a passkey was not set for publishing applications on the remote SHB, omit the passkey and the ":" that follows it.

  • Replace RemoteComputerName with the remote SHB's name.

    The DMIL PCIe protocol does not support connections to "localhost" or to IP addresses.

  • If required, enter the port that the monitoring application should access on the remote SHB to initiate a new connection, unless the default connection port is the listening port of the publishing application; in which case, omit the port number and the ":" that follows it.

(summarize)
Click to summarize MIL_TEXT("dmilshm://[Passkey:]localhost[:Port]") 1

Opens a connection to a Distributed MIL publishing application on the local computer using the DMIL SHM protocol. To connect to a publishing application on the local computer using the DMIL SHM protocol, the local computer must have a valid MIL installation.

When specifying the string that indicates local computer:

  • If required, replace [Passkey] with the passkey for publishing applications on the local computer. The passkey is an alphanumeric string of up to 16 characters in length. If a passkey was set up for the publishing application, you must specify the passkey when establishing a connection from the monitoring application to the publishing application. If a passkey was not set for publishing applications on the local computer, omit the passkey and the ":" that follows it.

  • Following "localhost:", enter the port that the monitoring application should access to initiate a new connection with the publishing application, unless the default connection port is the listening port of the publishing application; in which case, omit the port number and the ":" that follows it.

The DMIL SHM protocol only supports connections to localhost.

(summarize)
Click to summarize MIL_TEXT("dmiltcp://[Passkey:]RemoteComputerName[:Port]") 1

Opens a connection to a Distributed MIL publishing application on a remote or local computer. To connect to a Distributed MIL remote or local computer, that computer must have a valid MIL installation.

When specifying the string that indicates the remote computer (or local computer for a publishing application also running locally):

  • If required, replace [Passkey] with the passkey for publishing applications on the remote computer. The passkey is an alphanumeric string of up to 16 characters in length. If a passkey was set up for publishing applications on the remote computer, you must specify the passkey when establishing a connection from the monitoring application to the publishing application. If a passkey was not set for publishing applications on the remote computer, omit the passkey and the ":" that follows it. If you are attempting to connect to a local computer, specify the passkey for publishing applications on the local computer.

  • Replace RemoteComputerName with the remote computer's name or IP address; MIL supports both IPv4 and IPv6 addresses. A typical IPv4 string has the format n.n.n.n, where n is a number between 0 and 255. A typical IPv6 string has the format x:x:x:x:x:x:x:x, where x is a hexadecimal number between 0000 and FFFF. If you are supplying an IPv6 address, you must use square brackets to separate the address from the port. If you are attempting to connect to a local computer, set this to localhost.

  • If required, enter the port that the monitoring application should access on the remote computer to initiate a new connection, unless the default connection port is the listening port of the publishing application on the remote computer; in which case, omit the port number and the ":" that follows it. If you are attempting to connect to a local computer, specify the listening port of the publishing application on the local computer.

(summarize)

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

InitFlag

Reserved for future expansion. Set to M_DEFAULT.

ControlFlag

Reserved for future expansion. Set to M_DEFAULT.

RemoteContextAppIdPtr

Specifies the address in which to write the remote application identifier returned by this function.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.