Siemens SIMATIC S7/HMI Guia Del Usuario página 214

Ocultar thumbs Ver también para SIMATIC S7/HMI:
Tabla de contenido

Publicidad

API de la SIMATIC Automation Tool para .NET framework
7.13 Interfaz ICPU
El ejemplo siguiente muestra cómo establecer la ruta del archivo de copia de seguridad:
Network myNetwork = new Network();
ulong targetMACAddress = 0x112233445566; // 11:22:33:44:55:66
IProfinetDeviceCollection scannedDevices;
IScanErrorCollection scanResult = myNetwork.ScanNetworkDevices(out scannedDevices);
if (!scanResult.Succeeded)
{
cpu.NewRestoreNameIsSafety == true)
214
ICPU cpu = scannedDevices.FindDeviceByMAC(targetMACAddress) as ICPU;
if (cpu != null && cpu.RestoreAllowed == true)
{
// Seleccionar CPU a actualizar
cpu.Selected = true;
retVal = cpu.SetBackupFile(@"C:\MyFolder\Backup.s7pbkp");
if (retVal.Error == ErrorCode.ProgramPasswordNeeded)
{
retVal = cpu.SetBackupFilePassword(new EncryptedString("Password"));
if (retVal.Failed == true)
return;
}
if (retVal.Failed == true)
return;
// ¿Dirección IP unívoca?
if (cpu.DuplicateIP == true)
return;
// ¿Se soporta el dispositivo?
if (cpu.Supported == false)
return;
// ¿Está inicializado el dispositivo?
if (cpu.Initialized == false)
return;
// ¿El dispositivo es de seguridad?
if (cpu.Failsafe == true)
{
ConfirmationType type =
cpu.DetermineConfirmationMessage(FailsafeOperation.RestoreOperation);
// Verificar tipo y confirmar
cpu.SelectedConfirmed = true;
// Comprobar para asegurarse de que la actualización es posible
if (cpu.HasSafetyProgram == true || cpu.Protected == true ||
{
// ¿El dispositivo está protegido por contraseña?
Guía del usuario de SIMATIC Automation Tool V3.1 SP2
Manual de producto, V3.1 SP2, 11/2018, A5E45044281-AA

Publicidad

Tabla de contenido
loading

Tabla de contenido