EasyManua.ls Logo

Siemens SIMATIC S7 - Setcurrentdatetime Method

Siemens SIMATIC S7
134 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SIMATIC Automation Tool API for .NET framework
6.9 The ICPU interface
SIMATIC Automation Tool V2.1 user guide
110 Manual, V2.1.1 07/2016, A5E33042676-AC
6.9.3.11
SetCurrentDateTime method
Return type
Method name
Result
SetCurrentDateTime
Parameters
Name
Data type
Parameter type
Description
password
EncryptedString
In This method opens a legitimized connec-
tion to the device. Therefore, a password
may be required
time
System.DateTime
In
New value for the CPU current time.
This method sets the current time for the CPU. The configured time transformation rules are
not affected by this action. Therefore, the specified DateTime value is based on UTC time,
not the local time.
The following example traverses the entire industrial network and sets the current time for
each CPU device to the current time of the PG/PC.
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)
{
retVal = devAsCpu.SetCurrentDateTime(new EncryptedString(""),
DateTime.UtcNow);
}
}
}

Table of Contents

Other manuals for Siemens SIMATIC S7

Related product manuals