Echelon i.LON SmartServer 2.0 User Manual

Page 297

Advertising
background image

i.LON SmartServer 2.0 Programmer’s Reference

18-2

<xSelect>//*[@xsi:type="FileSystem"][UCPTname="/eventlog.txt"][UCPTfileFormat="text"]</xSelect>

</iLonItem>
</Read>

Request (return the data in a Data Logger)

<Read xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
<iLonItem>

<xSelect>//*[@xsi:type="FileSystem"][UCPTname="/root/data/Net/LON/iLON App/Data
Logger[1].csv"][UCPTfileFormat="text"]</xSelect>

</iLonItem>
</Read>

Response

<Read xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
<iLonItem>
<Item

xsi:type="FileSystem_Data">

<UCPTname>/root/data/Net/LON/iLON

App/Data

Logger[1].csv</UCPTname>

<UCPTlastUpdate>2008-02-27T21:41:56Z</UCPTlastUpdate>
<UCPTdescription

/>

<UCPTfileFormat

LonFormat="UCPTfileFormat">text</UCPTfileFormat>

<UCPTfileSize>98052</UCPTfileSize>

<Value>
"UCPTlogTime","UCPTpointName","UCPTaliasName","Reserved","UCPTpointStatus","UCPTvalueDef","UC
PTvalue","UCPTunit","UCPTpriority"

2008-02-27T13:41:57.440-08:00,"Net/LON/iLON App/Digital Input
2/nvoClsValue_2","NVL_nvoClsValue_2","","AL_NO_CONDITION","OFF","0.0 0","","255"

2008-02-27T13:45:00.000-08:00,"Net/LON/iLON App/Digital Input
2/nvoClsValue_2","NVL_nvoClsValue_2","","AL_NO_CONDITION","OFF","0.0 0","","255"

2008-02-27T14:00:00.040-08:00,"Net/LON/iLON App/Digital Input
2/nvoClsValue_2","NVL_nvoClsValue_2","","AL_NO_CONDITION","OFF","0.0 0","","255"

</Value>

</iLonItem>
<Read>

The following C# sample code demonstrates how to read a file in hex mode:

ilonWebRef.Item_Coll itemColl = new ilonWebRef.Item_Coll();

itemColl.xSelect =
"//*[@xsi:type=\"FileSystem\"][UCPTname=\"/root/data/myfile.txt\"][UCPTfileFormat=\"hex\"]";

ilonWebRef.Item_DataColl readResp = ilon.Read(itemColl);

if (readResp.UCPTfaultCount > 0)
MessageBox.Show(readResp.fault.faultstring);
else
String str = (readResp.Item[0] as ilonWebRef.FileSystem_Data).Value;

Note: You can read and write file system data that includes new line characters. For example, using
the Read function on the following file system data:

<Read xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">

<iLonItem>

<Item xsi:type="FileSystem_Data">

<UCPTname>/data/writetest.txt</UCPTname>

<UCPTfileFormat>text</UCPTfileFormat>

<Value>

Hello

World
!

</Value>

</Item>

</iLonItem>

<Read>

Advertising