trandData



 Users can obtain the data by using readData and readDataOnTime. readData obtains the history data as a list. readDataOnTime obtains the history data at a specified time. The information about the obtained history data is as follows.


        ㆍ The value of points

        ㆍ The time when saved.




Methods




Return Type

Method

Description

datetime

time()

Obtain the time information of history data.

  float

value( name )

Obtain the value of points in history data.

  list[float]

values()

Obtain a list of the value of all trend groups in history data.


  float value( name:Point name )

 

  value obtains the data of points in history data.


        ㆍ When entering the name of points to name, it returns the information of that point.

        ㆍ Users enter the name of trend groups in which acquired history data to name



  Example)

   


       import datetime      

       tm = datetime.datetime(2014, 1, 1, 1, 0, 1)

       dataset = logTrand.readDataOnTime('Trand data set 1', tm )


       val = dataset.value('Station1.Point12')

       << When entering the name of points using the value method on the dataset, the value of points at the obtained time is saved on val.


   



  list[float] values()

 

  values obtains the data list of points in history data. The order of the list is the same as the order of points inside the trend group.



  Example)

   


       import datetime      

       tm = datetime.datetime(2014, 1, 1, 1, 0, 1)

       dataset = logTrand.readDataOnTime('Trend data set 1', tm )


       # Users enter the value of that time zone in order of the point list of Trend data set 1 to val_list.

       # There are four points as below.

       

       val_list = dataset.values()

       Enter the value of day to val_list[0].

       Enter the value of weekdays to val_list[1].

       Enter the value of hours to val_list[2].

       Enter the value of minutes to val_list[3].


   


                               



  datetime time()

 

  time returns the time information of history data. The trend group which is saved regularly returns the time value.


        ㆍ The case of historical data achieved by readDataOnTime, the acquired time using time() is the same as the time users entered.

        ㆍ The case of history data list achieved by readData, it can check the time information of historical data using time().

        ㆍ The return type is seconds, it is able to convert into the time value using Python functions.



  Example)

   


       import datetime      

       tm = datetime.datetime(2014, 1, 1, 1, 0, 1)

       dataset = logTrand.readDataOnTime('Trend Data Set 1', tm )


       data_time = dataset.time()


       tm = datetime.datetime.fromtimestamp( data_time );