Echelon i.LON SmartServer Technical Information Page 431

  • Download
  • Add to my manuals
  • Print
  • Page
    / 443
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 430
i.LON SmartServer 2.0 Programmer’s Reference
22-26
LONDeviceCfg.Command getTemplate_my_LON_Device2 = new LONDeviceCfg.Command();
getTemplate_my_LON_Device2.setUCPTcommand(LONDeviceECommand.GET_TEMPLATE);
ELonString my_LON_Device2_templateStatus = new ELonString();
my_LON_Device2_templateStatus.setLonFormat("UCPTstatus");
my_LON_Device2_templateStatus.setValue("STATUS_REQUEST");
getTemplate_my_LON_Device2.setUCPTstatus(my_LON_Device2_templateStatus);
my_LON_Device2.getCommand().add(getTemplate_my_LON_Device2);
//Call the Set() function
ItemColl Device_Return_ItemColl = SmartServer.set(itemCfgColl);
Device_Return_ItemColl.setXSelect("//Item[@xsi:type=\"LON_Device_Cfg\"]");
if (Device_Return_ItemColl.getUCPTfaultCount() > 0)
{
// print out error and exit
System.out.println("An error occurred:");
for (int j = 0; j < Device_Return_ItemColl.getItem().size(); j++)
{
if (Device_Return_ItemColl.getItem().get(j).getFault() != null)
{
System.out.println("Item: " +
Device_Return_ItemColl.getItem().get(j).getUCPTname() + ", fault code: " +
Device_Return_ItemColl.getItem().get(j).getFault().getFaultcode() +
", fault string: " +
Device_Return_ItemColl.getItem().get(j).getFault().getFaultstring());
}
}
}
else
{
itemCfgColl = SmartServer.get(Device_Return_ItemColl);
for (int j = 0; j < itemCfgColl.getItem().size(); j++)
{
LONDeviceCfg newDevice = (LONDeviceCfg)itemCfgColl.getItem().get(j);
System.out.println("New Device Created = " + newDevice.getUCPTname() +
".Status = " + newDevice.getUCPTcommissionStatus().getValue()+ " and " +
newDevice.getUCPTapplicationStatus().getValue() + ".\r");
}
}
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}
catch (Exception e) {
System.out.println(e.getMessage());
}
finally {
iLon100 = null;
SmartServer = null;
}
}
}
22.3.4
Discovering and Installing External Devices in JAVA
This Java example scans a LONWORKS network for uncommissioned devices, processes the Neuron ID
and program ID data of the discovered devices, and then 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.
Page view 430
1 2 ... 426 427 428 429 430 431 432 433 434 435 436 ... 442 443

Comments to this Manuals

No comments