EasyManua.ls Logo

Siemens SIMATIC S7 - Iprofinetdevice Methods; Refreshstatus 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.7 The IProfinetDevice interface
SIMATIC Automation Tool V2.1 user guide
Manual, V2.1.1 07/2016, A5E33042676-AC
87
6.7.2
IProfinetDevice methods
6.7.2.1
RefreshStatus method
Return type
Method name
Result
RefreshStatus
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
When the IProfinetDeviceCollection collection is created by calling the
ScanNetworkDevices method, only a minimal amount of information is learned about each
device. In order to get all the available information for the device, it is necessary to call the
RefreshStatus method. This method makes a connection to the device, queries for various
information, and then disconnects from the device.
The following code will call
RefreshStatus for each device on the network.
IProfinetDeviceCollection scannedDevices = new IProfinetDeviceCollection();
Result retVal = myNetwork.ScanNetworkDevices(out scannedDevices);
if (retVal.Succeeded)
{
foreach (IProfinetDevice dev in scannedDevices)
{
Result retVal = networkDevice.RefreshStatus(new EncryptedString(""));
if (retVal.Succeeded)
{
//--------------------------------------------------
// Operation successful and the data can be trusted.
//--------------------------------------------------
}
}
}
The
RefreshStatus method connects to the device to read information. The device may be
password-protected against such access. Therefore, this method (and all methods that
internally connect with the device) requires a password parameter. The example above
passes an empty password to the method. This would only be appropriate for a device with
no password protection. The example shows the
EncryptedString class. This class is
provided by the API to correctly encrypt a plain-text password before using it to legitimize the
connection with the device.
See also
The EncryptedString class (Page 71)

Table of Contents

Other manuals for Siemens SIMATIC S7

Related product manuals