Herunterladen Inhalt Inhalt Diese Seite drucken

Siemens SIMATIC MV420 Betriebsanleitung Seite 375

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

Werbung

// Prepare POST data: Restore everything except the Remote Client's IP
string postData =
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"xmlfile\"\r\nContent-Type: text/xml\r\n\r\n" + xmlDoc + "\r\n" +
// set value to off if TCP settings shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"importtcp\"\r\n\r\non\r\n" +
// set value to off if PROFINET settings shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"importdp\"\r\n\r\non\r\n" +
// set value to off if serial communication settings shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"importserial\"\r\n\r\non\r\n" +
// set value to off if security settings shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"importsec\"\r\n\r\non\r\n" +
// set value to off if programs, calibrations, fonts and models shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"importcodes\"\r\n\r\non\r\n" +
// set value to off if Custom GUI shall not be imported
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"importcustomgui\"\r\n\r\non\r\n" +
// set value to on if the Remote Client's IP shall be imported (off recommended)
"[REMOTEXMLUPLOADPARA]\r\nContent-Disposition: form-data;
name=\"importremoteclientip\"\r\n\r\noff\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 = "multipart/form-data; boundary=[REMOTEXMLUPLOADPARA]\r\n";
myRequest.ContentLength = buffer.Length;
// Send the data.
newStream = myRequest.GetRequestStream();
newStream.Write(buffer, 0, buffer.Length);
// Close stream
newStream.Close();
try
{
SIMATIC MV420 / SIMATIC MV440
Betriebsanleitung, 10/2015, C79000-G8900-C334-03
// 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 restarting...");
else if (value.Equals('2'))
Prozessanbindung über ein Automatisierungssystem (SPS, PC)
9.8 Remote Client
375

Quicklinks ausblenden:

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Simatic mv440

Inhaltsverzeichnis