NMX_DeviceIPv4Open_1

<< Click to Display Table of Contents >>

Navigation:  NmxDLL Reference Guide > API (programming interface) > Connecting / Disconnecting >

NMX_DeviceIPv4Open_1

This function is used to establish a connection to a device (measurement system) via IPV4.

See also the HowTo-Guide.

 

Definition


NMX_STATUS NMX_DeviceIPv4Open_1(

 unsigned char ucIp3,

 unsigned char ucIp2,

 unsigned char ucIp1,

 unsigned char ucIp0,

 unsigned short usPortCmd,

 unsigned short usPortData,

 NMX_PHANDLE *ppHandle);

 

Parameter


ucIp3, ucIp2, ucIp1, ucIp0

IP-Address of the device. The factory default address is 192.168.3.99. For using this address, the parameters are as follows:
ucIp3 = 192;
ucIp2 = 168;
ucIp1 = 3;
ucIp0 = 99;

usPortCmd

Port number for the DLLs communication channel, which is used for exchanging commands. Use 22517.

usPortData

Port number for the DLLs communication channel, which is used for exchanging data. Use 22516.

ppHandle

If the connection has been established successfully, a connection handle will be returned via this pointer. Otherwise the handle remains unchanged.

 

Typical function call (C example)


NMX_DeviceIPv4Open_1(192, 168, 3, 99, 22517, 22516, &pHandle);

 

.Net DLL specific implementation


NMX_MSTATUS DeviceIPv4Open_1(

                 System::Byte ucIp3,

                 System::Byte ucIp2,

                 System::Byte ucIp1,

                 System::Byte ucIp0,

                 System::UInt16 usPortCmd,

                 System::UInt16 usPortData,

                 System::IntPtr %ppHandle);

 

Comments


NMX_PHANDLE is a pointer to a handle (type void*). It is required for all subsequent connection calls.

It is strongly recommended to read the IP-Address and the Port-Numbers from an INI-File, XML-File, Registry or something similar. Do not hard code these.

If the connection is not established after having integrated this function into your application, first check the network connection to the device (e.g. by calling its WebServer or via ping).

Before closing your application, always ensure that this connection is closed before via NMX_DeviceClose_1.

Multiple connections can be established to different devices. In this case a separate handle is provided for each connection. However, this is very rarely required. Please read also the chapter about limitations.