Siemens SIMATIC MV440 Operating Instructions Manual page 331

Simatic ident code reader system
Hide thumbs Also See for SIMATIC MV440:
Table of Contents

Advertisement

Pseudocode example
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
Operating Instructions, 04/2013, A5E02371045-06
new
ASCIIEncoding();
"multipart/form-data;
boundary=[REMOTEXMLUPLOADPARA]\r\n";
Device is restarting. More information via graphical user
RESTORE!");
Process interfacing via an automation system (PLC, PC)
restarting...");
10.8 Remote client
+
+
+
+
+
interface.");
interface.");
329

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic mv420

Table of Contents