logTrand



 logTrand provides the function that obtains the trend group information stored as history data. It is able to obtain periodical trend group information and the data of the trend group at a specified time.




Methods




Return Type

Method

Description

  list[trandData]

readData( name, start, end )

Obtain the history of trend group for the period entered by users.

  trandData

readDataOnTime( name, date )

Users obtain the history of the trend group at a specified time.


  list[trandData] readData( name:Trand group name, start:Start time, end:End time )

 

  readData obtains the data of trend groups between the start time and the end time as a list.


        ㆍ Enter the name of trend groups to name as String.

        ㆍ Enter the start time to start using Python datetime.

        ㆍ Enter the end time to end using Python datetime.


        ※ Refer Python script datetime object usage.


  The usage of history information is introduced on trandData.



  Example)

   


       import datetime       # This is the statement for using Python datetime.


       st = datetime.datetime(2014, 1, 1, 0, 0, 0)  # Set the start time as 2014-1-1 0:00:00.

       et = datetime.datetime(2014, 1, 7, 0, 0, 0)  # Set the end time as 2014-1-7 0:00:00.


       dataset = logTrand.readData('Trand data set 1', st, et)

       # dataset saves the data of Trand data set 1 between 2014-1-1 0:00:00 to 2014-1-7 0:00:00.


   



  trandData readDataOnTime( name:Trand group name, date:Search date )

 

  readDataOnTime obtains the data of the trend group at a specified time by setting the time of data.


        ㆍ Enter the name of trend groups to name as String.

        ㆍ Enter the search date to date using Python datetime.

        ㆍ Precautions when entering the desired time.

                - Set the time according to the storage time of trend groups.

                - If the trend group is saved in 1 second interval, the user must set datetime up to the second. If the trend group is saved in 60 seconds interval, the user must set datetime up to the minute.

                - The trend group saved in an hour interval and the user must set the time by computing the saving time.

                - The collection period of trend groups can be checked in Data Explorer.


        ※ Refer Python script datetime object usage.


  The usage of history information is introduced on trandData.



  Example)

   


       import datetime       # This is the statement for using Python datetime.

       tm = datetime.datetime(2014, 1, 1, 1, 0, 1)  << Set the search time as 2014-1-1 1:00:01.

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

       # If the storage period of trand data set 1 is a second, obtains the history data at 2014-1-1 1:00:01.


       tm = datetime.datetime(2014, 1, 1, 2, 30, 0)  << Set the search time as 2014-1-1 2:30:00.

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

       # If the storage period of trand data set 2 is 30 minutes, obtains the history data at 2014-1-1 2:30:00.