Echelon i.LON SmartServer 2.0 Manual de usuario Pagina 424

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 443
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 423
i.LON SmartServer 2.0 Programmer’s Reference
22-19
}
ItemColl writeResponse = SmartServer.write(itemDataColl);
if(writeResponse.getUCPTfaultCount()> 0)
{
// 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.2
Creating and Reading a Data Logger in Java
The following Java example creates a data logger and then reads the data recorded by it. 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.
22.3.2.1 Creating a Data Logger
The following Java example creates a new data logger from an existing uninstantiated (hidden) data
logger on the SmartServer, specifies the type, format, and size of the new data logger, and then
specifies that the data logger record both of the SmartServer’s digital relay outputs every minute (the
Net/LON/iLON App/Digital Output 1/nviClaValue_1 and Net/LON/iLON App/Digital Output
2/nviClaValue_2 data points).
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.EXSelect;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.Item;
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.LONFbCfg;
Vista de pagina 423
1 2 ... 419 420 421 422 423 424 425 426 427 428 429 ... 442 443

Comentarios a estos manuales

Sin comentarios