Herunterladen Inhalt Inhalt Diese Seite drucken

Pseudocode-Beispiel - Siemens SIMATIC MV420 Betriebsanleitung

Vorschau ausblenden Andere Handbücher für SIMATIC MV420:
Inhaltsverzeichnis

Werbung

Prozessanbindung über ein Automatisierungssystem (SPS, PC)
10.7 Remote Client

Pseudocode-Beispiel

C# Pseudocode XML Backup
// Create new xml file
FileStream
// Create http request
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://192.168.0.42/xml/backup.cgi");
myRequest.Method = "GET";
myRequest.ContentLength = 0;
try
{
// Get response
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myRequest.GetResponse();
// Get response stream
Stream
// Read stream and write to file (stream == xml data)
byte[] readBuffer =
int
while
{
}
Console.WriteLine("XML backup
}
catch
{
Console.WriteLine("NO PERMISSION FOR XML
}
314
newXml = File.Open("C:\\mv400para.xml", FileMode.Create);
streamResponse = myHttpWebResponse.GetResponseStream();
new
byte[256];
count = streamResponse.Read(readBuffer, 0, readBuffer.GetLength(0));
(count > 0)
newXml.Write(readBuffer, 0, count);
count = streamResponse.Read(readBuffer, 0, readBuffer.GetLength(0));
(System.Net.WebException we)
succeeded.");
BACKUP!");
SIMATIC MV420 / SIMATIC MV440
Betriebsanleitung, 10/2012, A5E02371038-05

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Simatic identSimatic mv440

Inhaltsverzeichnis