Echelon i.LON SmartServer 2.0 Manuel d'utilisateur Page 426

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 443
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 425
i.LON SmartServer 2.0 Programmer’s Reference
22-21
logFormat_LonString.setLonFormat("UCPTlogFormat");
myDataLogger.setUCPTlogFormat(logFormat_LonString);
//specify two data points to be logged by new Data Logger
UFPTdataLoggerDpRef dataPointRef1 = new UFPTdataLoggerDpRef();
dataPointRef1.setUCPTname("Net/LON/iLON App/Digital Output 1/nviClaValue_1");
dataPointRef1.setUCPTformatDescription ("0000000000000000[0].SNVT_switch");
dataPointRef1.setUCPTpollRate(60);
dataPointRef1.setDpType("Input");
UFPTdataLoggerDpRef dataPointRef2 = new UFPTdataLoggerDpRef();
dataPointRef2.setUCPTname("Net/LON/iLON App/Digital Output 2/nviClaValue_2");
dataPointRef2.setUCPTformatDescription ("0000000000000000[0].SNVT_switch");
dataPointRef2.setUCPTpollRate(60);
dataPointRef2.setDpType("Input");
//add the two data points to the Data Logger
myDataLogger.getDataPoint().add(dataPointRef1);
myDataLogger.getDataPoint().add(dataPointRef2);
//call Set function
ItemCfgColl itemCfgColl_DataLogger_Set = new ItemCfgColl();
itemCfgColl_DataLogger_Set.getItem().add(myDataLogger);
ItemColl itemColl_Set_DataLogger_Return = SmartServer.set(itemCfgColl_DataLogger_Set);
if (itemColl_Set_DataLogger_Return.getUCPTfaultCount() > 0)
{
System.out.println("Set-Response contains " +
itemColl_Set_DataLogger_Return.getUCPTfaultCount() + "faults");
}
else
{
//Check whether Data Logger was created
Item newDataLogger = itemColl_Set_DataLogger_Return.getItem().get(0);
System.out.println("Successfully created the following UFPT Data Logger = " +
newDataLogger.getUCPTname());
}
//*/
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}
catch (Exception e) {
System.out.println(e.getMessage());
}
finally {
iLon100 = null;
SmartServer = null;
}
}
}
22.3.2.2 Reading a Data Logger
The following Java example reads and prints out the last 10 entries for one of the two data points
recorded by the new data logger you created in the previous section,
Creating a Data Logger. For
more information on the data logger properties used in this example, see
section 5.3.4, Using the Read
Function on a Data Logger.
package com.echelon.sample.client.ilon;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.DpData;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.EXSelect;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.ItemColl;
import com.echelon.wsdl.web_services_ns.ilon100.v4_0.message.ItemDataColl;
Vue de la page 425
1 2 ... 421 422 423 424 425 426 427 428 429 430 431 ... 442 443

Commentaires sur ces manuels

Pas de commentaire