Siemens SIMATIC MV500 Operating Instructions Manual page 210

Hide thumbs Also See for SIMATIC MV500:
Table of Contents

Advertisement

Process interfacing via an automation system (PLC, PC)
9.8 Remote client
Pseudocode example
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)
{
}
210
// 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!");
Operating Instructions, 03/2021, C79000-G8976-C494-05
SIMATIC MV500

Advertisement

Table of Contents
loading

Table of Contents