SIMATIC Automation Tool API for .NET framework
6.9 The ICPU interface
SIMATIC Automation Tool V2.1 user guide
104 Manual, V2.1.1 07/2016, A5E33042676-AC
The DiagnosticsItem class
The GetDiagnosticsBuffer method returns a collection of DiagnosticsItem objects.
This class defines the following members:
Time the diagnostic event was logged.
Ingoing/Outgoing
This method returns an OperatingState.
OperatingState enumeration (Page 118)
Note
Unlike other methods on the
ICPU interface, GetOperatingState
does not require a legitimized
connection to the C
PU. Therefore, no password is needed.
The following example queries for the current operating state for all CPUs on the industrial
network. If any CPU is not in RUN, an error is shown.
IProfinetDeviceCollection devices = new IProfinetDeviceCollection();
Result retVal = myNetwork.ScanNetworkDevices(out devices);
if (retVal.Succeeded)
{
foreach (IProfinetDevice dev in devices)
{
ICPU devAsCpu = dev as ICPU;
if (devAsCpu != null)
{
if (devAsCpu.GetOperatingState() != OperatingState.Run)
{
// DisplayError!
}
}
}
}