
Process interfacing via an automation system (PLC, PC)
9.8 Remote client
SIMATIC MV500
Operating Instructions, 03/2021, C79000-G8976-C494-05
213
Pseudocode example
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" +
"\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
Страница 10: ...Preface SIMATIC MV500 10 Operating Instructions 03 2021 C79000 G8976 C494 05 ...
Страница 16: ......
Страница 28: ......
Страница 32: ......
Страница 92: ......
Страница 114: ......
Страница 148: ......
Страница 244: ......
Страница 254: ......
Страница 260: ......
Страница 292: ......
Страница 294: ...Service Support SIMATIC MV500 294 Operating Instructions 03 2021 C79000 G8976 C494 05 ...