Herunterladen Inhalt Inhalt Diese Seite drucken

Siemens SIMATIC MV500 Serie Betriebsanleitung Seite 184

Vorschau ausblenden Andere Handbücher für SIMATIC MV500 Serie:
Inhaltsverzeichnis

Werbung

Prozessanbindung über ein Automatisierungssystem (PLC, PC)
9.8 Remote Client
Pseudocode-Beispiel
C# Pseudocode XML Backup
// Create new xml file
FileStream newXml = File.Open("C:\\mv400para.xml", FileMode.Create);
// Create http request
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("http://192.168.0.42/xml/backup.cg
i");
myRequest.Method = "GET";
myRequest.ContentLength = 0;
try
{
(HttpWebResponse)myRequest.GetResponse();
readBuffer.GetLength(0));
readBuffer.GetLength(0));
}
catch (System.Net.WebException we)
{
}
184
// Get response
HttpWebResponse myHttpWebResponse =
// Get response stream
Stream streamResponse = myHttpWebResponse.GetResponseStream();
// Read stream and write to file (stream == xml data)
byte[] readBuffer = new byte[256];
int count = streamResponse.Read(readBuffer, 0,
while (count > 0)
{
newXml.Write(readBuffer, 0, count);
count = streamResponse.Read(readBuffer, 0,
}
Console.WriteLine("XML backup succeeded.");
Console.WriteLine("NO PERMISSION FOR XML BACKUP!");
Betriebsanleitung, 08/2020, C79000-G8900-C494-04
SIMATIC MV500

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis