Herunterladen Inhalt Inhalt Diese Seite drucken

Siemens SIMATIC MV500 Serie Betriebsanleitung Seite 187

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

Werbung

Pseudocode-Beispiel
C# Pseudocode XML Restore
byte[] buffer;
Stream newStream;
string xmlDoc = File.ReadAllText("C:\\MV400_para.xml");
ASCIIEncoding encoding = new ASCIIEncoding();
// 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.c
gi");
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);
SIMATIC MV500
Betriebsanleitung, 08/2020, C79000-G8900-C494-04
Prozessanbindung über ein Automatisierungssystem (PLC, PC)
9.8 Remote Client
187

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis