SIMATIC Automation Tool API for .NET framework
6.9 The ICPU interface
SIMATIC Automation Tool V2.1 user guide
112 Manual, V2.1.1 07/2016, A5E33042676-AC
RemoteInterfaces properties
6.9.4.1
Decentralized I/O modules
Each CPU may support multiple decentralized I/O interfaces. Information about the devices
attached on these remote interfaces is available through the
RemoteInterfaces property.
To access information about decentralized IO, it is first necessary to call the
RefreshStatus
method on the CPU. This opens a legitimized connection with the CPU, reads the relevant
information, and closes the connection.
The following example shows how to access this information for all the CPUs on a network.
retVal = myNetwork.ScanNetworkDevices(out devices);
if (retVal.Succeeded)
{
foreach (IProfinetDevice dev in devices)
{
ICPU devAsCpu = dev as ICPU;
//----------------------------------------------------------
// A call to RefreshStatus() is needed to gather information
// about decentral network(s)
//----------------------------------------------------------
retVal = devAsCpu.RefreshStatus(new EncryptedString(""));
if (!retVal.Succeeded)
return;
List<IRemoteInterface> decentalNets = devAsCpu.RemoteInterfaces;
foreach (IRemoteInterface net in decentalNets)
{
//-----------------------------
// Inspect the remote interface
//-----------------------------
}
}
}