EasyManua.ls Logo

Siemens SIMATIC S7 - Finding a Specific Device in the Collection; Finddevicebyip Method

Siemens SIMATIC S7
134 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SIMATIC Automation Tool API for .NET framework
6.6 The IProfinetDeviceCollection class
SIMATIC Automation Tool V2.1 user guide
80 Manual, V2.1.1 07/2016, A5E33042676-AC
6.6.3
Finding a specific device in the collection
6.6.3.1
FindDeviceByIP method
You can search for a specific device in the collection. The following method support this
workflow.
Two versions of this method are provided, one allows the IP address to be represented as a
string, and the other accepts the IP address as an unsigned integer value.
Return type
Method name
IProfinetDevice
FindDeviceByIP
Parameters
Name
Data type
Parameter type
Description
ip
uint
In
The IP address to search for
ipString
string
In
The IP address to search for
The following example shows searching for a device at a specified IP address. If the device
is not found in the collection, a NULL reference is returned.
uint targetIPAddress = 0xC0A80001; // 192.168.0.1
retVal = myNetwork.ScanNetworkDevices(out scannedDevices);
if (!retVal.Succeeded)
return;
IProfinetDevice dev = scannedDevices.FindDeviceByIP(targetIPAddress);
if (dev != null)
{
// Found it!
}

Table of Contents

Other manuals for Siemens SIMATIC S7

Related product manuals