Siemens SIMATIC S7/HMI Guía De Usuario página 139

Ocultar thumbs Ver también para SIMATIC S7/HMI:
Tabla de contenido
En el siguiente ejemplo se busca en la
dirección IP específica. Cuando la encuentra, la información de diagnóstico se lee desde la
CPU (en texto en alemán).
uint targetIPAddress = 0xC0A80001; // 192.168.0.1
List<DiagnosticsItem> aLogs = new List<DiagnosticsItem>();
IProfinetDeviceCollection devices = new IProfinetDeviceCollection();
Result retVal = myNetwork.ScanNetworkDevices(out devices);
if (retVal.Succeeded)
{
}
Guía de usuario de SIMATIC Automation Tool V3.0
Manual de producto, V3.0, 06/2017, A5E41848985-AA
foreach (IProfinetDevice dev in devices)
{
ICPU devAsCpu = dev as ICPU;
if ((devAsCpu != null) && (devAsCpu.IP == targetIPAddress))
{
retVal = devAsCpu.GetDiagnosticsBuffer(new EncryptedString(""),
if (retVal.Succeeded)
{
for (int idxLog = 0; idxLog < aLogs.Count; idxLog++)
{
string descr = aLogs[idxLog].Description1;
}
}
}
}
API de la SIMATIC Automation Tool para .NET framework
IProfinetDeviceCollection
out aLogs,
Language.German);
7.9 Interfaz ICPU
una CPU en una
139
Tabla de contenido
loading

Tabla de contenido