SIMATIC Automation Tool API for .NET framework
6.9 The ICPU interface
SIMATIC Automation Tool V2.1 user guide
108 Manual, V2.1.1 07/2016, A5E33042676-AC
In This method opens a legitimized connec-
tion to the device. Therefore, a password
In A fully-qualified path to the folder contain-
ing the program card contents.
This method is used to restore the information from a previous backup of the CPU. Not all
CPUs support the backup/restore feature. The property
RestoreAllowed can be checked to
ensure that the current CPU supports this feature.
The following example searches the
IProfinetDeviceCollection for a CPU at a specific IP
address. When found it checks that the CPU supports the restore feature, then calls the
Restore method.
uint targetIPAddress = 0xC0A80001; // 192.168.0.1
string bkFile = @"C:\MyCPUBackupFile.s7pbkp";
IProfinetDeviceCollection devices = new IProfinetDeviceCollection();
Result retVal = myNetwork.ScanNetworkDevices(out devices);
if (retVal.Succeeded)
{
IProfinetDevice dev = devices.FindDeviceByIP(targetIPAddress);
if (dev != null)
{
ICPU devAsCpu = dev as ICPU;
if ((devAsCpu != null) &&
(devAsCpu.RestoreAllowed == FeatureSupport.RestoreAllowed)
)
{
retVal = devAsCpu.Restore(new EncryptedString(""), bkFile);
}
}
}
Restore method is not allowed for an S7 fail-safe CPU. The SIMATIC Automation Tool
API will block this operation for a fail
-safe CPU. When the software determines that this
method was called for a fail
-safe CPU, a specific error
(ErrorCode.FailsafeAccessNotAllowed
) is returned.