3 using the write function on file system data, Using the write function on file system data -3, Using the write function on file system data – Echelon i.LON SmartServer 2.0 User Manual
Page 298

i.LON SmartServer 2.0 Programmer’s Reference
18-3
returns the following data:
Hello
World
!
18.3
Using the Write Function on File System Data
You can use the Write function to upload a new alarm log, data log, or other user-defined file to the
SmartServer or to overwrite an existing file.
The Write function takes an
the format (text or hex) of the file in the
stored in the file must be included within the
The Write response message includes a
bytes.
Request (create a new user-defined file on the SmartServer)
xsi:type="FileSystem_Data"> i.LON SmartServer
Response
xsi:type="FileSystem_Data"> /> LonFormat="UCPTfileFormat">text Hello i.LON SmartServer
Note: You can write to a file in hex mode, and store the data in ASCII printable characters (text) and
control characters (e.g., new line). To do this, you enter a space-separated ascii hex string in the
“ABC” and the second is “DEF”) by passing in the following ascii hex string in the
The following C# sample code demonstrates how to write to a file in hex mode using the previous
example:
ilonWebRef.Item_DataColl itemDataColl = new ilonWebRef.Item_DataColl();
itemDataColl.Item = new ilonWebRef.Item_Data[1];
ilonWebRef.FileSystem_Data fsData = new ilonWebRef.FileSystem_Data();
itemDataColl.Item[0] = fsData;
fsData.UCPTname = "/data/myfile.txt";
fsData.UCPTfileFormat = new ilonWebRef.E_LonString();
fsData.UCPTfileFormat.Value = "hex";
fsData.Value = “41 42 43 0D 0A 44 45 46”;