Echelon i.LON SmartServer Technical Information Page 428

  • Download
  • Add to my manuals
  • Print
  • Page
    / 443
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 427
i.LON SmartServer 2.0 Programmer’s Reference
22-23
// print out error and exit
System.out.println("An error occurred:");
for (int j = 0; j <itemColl.getItem().size(); j++)
{
System.out.println("Item: " + itemColl.getItem().get(j).getUCPTname() + ",
fault code: " + itemColl.getItem().get(j).getFault().getFaultcode() + ",
fault string: " + itemColl.getItem().get(j).getFault().getFaultstring());
}
}
else
{
// success
System.out.println("\r\n" + "Write is successful");
for (int j = 0; j <itemColl.getItem().size(); j++)
{
System.out.print(((DpData)(itemDataColl.getItem().get(j))).getUCPTname()+ " = ");
System.out.print(((DpData)(itemDataColl.getItem().get(j))).
getUCPTvalue().get(0).getValue()+ "(Value Written)" + "\r\n");
}
}
}
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}
catch (Exception e) {
System.out.println(e.getMessage());
}
finally {
iLon100 = null;
SmartServer = null;
}
}
}
22.3.3
Creating and Installing a LONWORKS Device in Java
This Java example creates two LONWORKS devices, and then it commissions the devices, starts the
devices’ applications, and gets the devices’ templates (to display the devices’ functional blocks and
data points in the SmartServer Web interface). The example then prints out the names and statuses of
the devices that have been installed. Note that you need to replace the values of the <UCPTname>,
<UCPTuniqueID>, <UCPTprogramID>, and <UCPTurlTemplate> properties provided in this example
with those of the devices you are creating and installing.
You can execute this code after you have setup the Java programming environment as described in
section 22.1, and created the Web service client as described in section 22.2. You must also upload the
device interface (XIF) files of the devices you are creating to the root/LonWorks/import folder on the
SmartServer flash disk.
For more information on the L
ONWORKS device properties set in this example, see section 14.3.2,
Using the Get Function on a LonWorks Device. For more information on the network management
commands issues in this example, see
section 14.3.3.1, Issuing Network Management Commands.
package com.echelon.sample.client.ilon;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.ELonString;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.ItemCfgColl;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.ItemColl;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.LONDeviceCfg;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.LONDeviceECommand;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.wsdl.ILON100;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.wsdl.ILON100PortType;
public class Client_LonDevice {
Page view 427
1 2 ... 423 424 425 426 427 428 429 430 431 432 433 ... 442 443

Comments to this Manuals

No comments