Herunterladen Inhalt Inhalt Diese Seite drucken

Siemens SIMATIC MV420 Betriebsanleitung Seite 319

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

Werbung

Pseudocode-Beispiel
C# Pseudocode XML Restore
Stream
newStream;
string
xmlDoc = File.ReadAllText("C:\\mv400para.xml");
ASCIIEncoding
encoding =
// Prepare POST data
string
postData =
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data; name=\"xmlfile\"\r\nContent-Type: text/xml\r\n\r\n"
xmlDoc +
"\r\n"
+
// remove next line if TCP settings shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data; name=\"importtcp\"\r\n\r\non\r\n"
// remove next line if PROFINET settings shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data; name=\"importdp\"\r\n\r\non\r\n"
// remote next line if security settings shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data; name=\"importsec\"\r\n\r\non\r\n"
// remote next line if codes shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data; name=\"importcodes\"\r\n\r\non\r\n"
"[REMOTEXMLUPLOADPARA]\r\n";
buffer = encoding.GetBytes(postData);
// Create http request
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://192.168.0.42/xml/restore.cgi");
myRequest.Method = "POST";
myRequest.ContentType =
myRequest.ContentLength = buffer.Length;
// Send the data.
newStream = myRequest.GetRequestStream();
newStream.Write(buffer, 0, buffer.Length);
try
{
// Get response
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myRequest.GetResponse();
// Get response data
int
response = myHttpWebResponse.GetResponseStream().ReadByte();
if
(response != -1)
{
Char
value = (Char)response;
if
(value.Equals('1'))
Console.WriteLine("XML restore succeeded, device is
else if
(value.Equals('2'))
Console.WriteLine("XML restore succeeded only partially, not all codes could be imported.
else
Console.WriteLine("XML restore failed. More information via graphical user
}
}
catch
(System.Net.WebException we)
{
Console.WriteLine("NO PERMISSION FOR XML
}
SIMATIC MV420 / SIMATIC MV440
Betriebsanleitung, 10/2012, A5E02371038-05
new
ASCIIEncoding();
"multipart/form-data;
boundary=[REMOTEXMLUPLOADPARA]\r\n";
Device is restarting. More information via graphical user
RESTORE!");
Prozessanbindung über ein Automatisierungssystem (SPS, PC)
restarting...");
10.7 Remote Client
+
+
+
+
+
interface.");
interface.");
317

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Simatic identSimatic mv440

Inhaltsverzeichnis