logAnalog



 logAnalog object is used to read the history data of analog points or history data groups. Using this object, user can read hourly / daily / monthly / cumulative moment / maximum / minimum / average / variation values. Status point history uses logStatus.




Methods



Return Type

Method

Description

float

calcAvgInDataGroup( groupName, pointName, valueType, startDate, endDate )

Calculate the average value of data within the range entered analog points that registered on history data groups.

float

calcMaxInDataGroup( groupName, pointName, valueType, startDate, endDate )

Calculate the maximum value of data within the range entered analog points that registered on history data groups.

float

calcMinInDataGroup( groupName, pointName, valueType, startDate, endDate )

Calculate the minimum value of data within the range entered analog points that registered on history data groups.

float

calcSumInDataGroup( groupName, pointName, valueType, startDate, endDate )

Calculate the summation value of data within the range entered analog points that registered on history data groups.

  list[historicalAnalogData]

readAnalogLog( name, start, end, type )

Read the history information list of analog points within the range entered.

dict{pointName: list[historicalAnalogData]}

readAnalogLogMulti( names, start, end, type )

Read the history information list of analog points within the range entered.

  historycalAnalogData

readCurrentReportData( historyDataName, pointName)

Read the current data which is recorded in history data groups.

  list[historicalAnalogData]

readData( group, name, start, end )

Read the history information list of analog points registered on history data groups.

dict{pointName: list[historicalAnalogData]}

readDataMulti( group, names, start, end )

Read the history information list of analog points registered on history data groups.

  historicalAnalogData

readDataOnTime( group, name, date )

Read the history information of analog points registered on history data groups.





  list[historicalAnalogData] readAnalogLog( name:Point name, start:Start date, end:End date, type:Type )

 

  readAnalogLog obtains a list of historical information based on the type within the range of the analog point


        ㆍ Enter the name of analog points to name as String.

        ㆍ Enter the start date to start using Python datetime.

        ㆍ Enter the end date to end using Python datetime.

        ㆍ There are four types.

                - logAnalog.Time : Hour

                - logAnalog.Day : Day

                - logAnalog.Month : month

                - logAnalog.Total : Cumulative


        ※ Refer Python script datetime object usage.


  The usage of history information is introduced on historicalAnalogData.



  Example)

   


      import datetime

      st = datetime.datetime(2014, 1, 1, 0, 0, 0)  << 2014-1-1 0:00:00 of Python datetime format.

      et = datetime.datetime(2014, 2, 1, 0, 0, 0)  << 2014-2-1 0:00:00 of Python datetime format.


      # data_list saves the hourly history information of analog point A between 2014-1-1 0:00:00 to 2014-2-1 0:00:00

      data_list = logAnalog.readAnalogLog(‘A’, st, et, logAnalog.Time)

      for v in range(0, len(data_list)):        

       if data_list[v].isGood():

               print data_list[v].curValue()        # Obtain the moment value of 'A'

               print data_list[v].maxValue()        # Obtain the maximum value of 'A'

               print data_list[v].minValue()        # Obtain the minimum value of 'A'

               print data_list[v].deltaValue()        # Obtain the variation of 'A'

               print data_list[v].avgValue()        # Obtain the average value of 'A'


   





  dict{pointName: list[historicalAnalogData]} readAnalogLogMulti( names:Point name, start:Start date, end:End date, type:Type )

 

  readAnalogLogMulti reads a list of historical information based on type within the range of analog points.


        ㆍ Enter the name of analog points to names as String. Each name is separated by ';'.

        ㆍ Enter the start date to start using Python datetime.

        ㆍ Enter the end date to end using Python datatime.

        ㆍ There are four types.

                - logAnalog.Time : Hour

                - logAnalog.Day : Day

                - logAnalog.Month : Month

                - logAnalog.Total : Cumulative


        ※ Refer Python script datetime object usage.


  The usage of history information is introduced on historicalAnalogData.



  Example)

   


      import datetime

      st = datetime.datetime(2014, 1, 1, 0, 0, 0)  << 2014-1-1 0:00:00 of Python datetime format.

      et = datetime.datetime(2014, 2, 1, 0, 0, 0)  << 2014-2-1 0:00:00 of Python datetime format.


      # dlist에는 아날로그 포인트인 SG공통.본관 총 누적 소비전력량, SG공통.인문사회관 총 누적 소비전력량, SG공통.대학원 총 누적 소비전력량의 2014-1-1 0:00:00부터 2014-2-1 0:00:00 까지의 시간대별 이력정보가 저장됩니다. ******

      dlist = logAnalog.readAnalogLogMulti('SG공통.본관 총 누적 소비전력량;SG공통.인문사회관 총 누적 소비전력량;SG공통.대학원 총 누적 소비전력량', st, et, logAnalog.Time)

      for v in range(0, len(dlist)):        

            pointName = dlist.keys()[v]                       

            data_list = dlist[pointName]               

            for v in range(0, len(data_list)):

                  print data_list[v].curValue()        #  Obtain the moment value of points.

                  print data_list[v].maxValue()        #  Obtain the maximum value of points.

                  print data_list[v].minValue()        #  Obtain the minimum value of points.

                  print data_list[v].deltaValue()        #  Obtain the variation of points.

                  print data_list[v].avgValue()        #  Obtain the average value of points.


   



  list[float] readCurrentReportData( historyDataGroupName:History data group name, pointName:Point name )

 

  Read the current data recorded on history data groups.

  For example, if the history data group exists as well as below, set the history data group and point, read the current data.

  The return type is historicalAnalogData.



   For example, if the current time is '11:12 AM', it reads the report data between '11:00 AM ~ Current time'.



  Example)

   

     #If the current time is '11:12 AM'.

     data = logAnalog.readCurrentReportData('15분 전력량' , 'LP 1.분기#1.누적 유효 전력량' )*****

     print data.deltaValue() #Read the variation between '11:00 AM ~ Current'.

     print data.curValue()   #Read the data at 11:00.

     print data.minValue()   #Read the minimum value between '11:00 AM ~ Current'.

     print data.maxValue()  #Read the maximum value between '11:00 AM ~ Current'.

     print data.avgValue()   #Read the average value between '11:00 AM ~ Current'.

   



  list[historicalAnalogData] readData( setname:History data group name, name:Point name, start:Start date, end:End date )

 

  readData obtains a list of historical information within the search period of analog points among points that are registered on the history data group in Data Explorer.


        ㆍ Enter the registered group name to setname as String.

        ㆍ Enter the name of analog points belonging to the group to name as String.

        ㆍ Enter the start date to start using Python datetime.

        ㆍ Enter the end date to end using Python datetime.


        ※ Refer Python script datetime object usage.


  The usage of history information is introduced on historicalAnalogData.



  Example)

   


       import datetime

       st = datetime.datetime(2014, 1, 1, 0, 0, 0)  << 2014-1-1 0:00:00 of Python datetime format.

       et = datetime.datetime(2014, 2, 1, 0, 0, 0)  << 2014-2-1 0:00:00 of Python datetime format.


       # data_list에는 이력 데이터 그룹1에 속한 아날로그 포인트 스테이션1.온도 포인트의 2014-1-1 0:00:00부터 2014-2-1 0:00:00 까지의 이력정보가 저장됩니다. ******

       data_list = logAnalog.readData(‘이력 데이터 그룹1’, ‘스테이션1.온도’, st, et )

       for v in range(0, len(data_list)):        

       if data_list[v].isGood():

               print data_list[v].curValue()        # Obtain the moment value of 'Station1.Temperature'

               print data_list[v].maxValue()        # Obtain the maximum value of 'Station1.Temperature'

               print data_list[v].minValue()        # Obtain the minimum value of 'Station1.Temperature'

               print data_list[v].deltaValue()        # Obtain the variation of 'Station1.Temperature'

               print data_list[v].avgValue()        # Obtain the average value of 'Station1.Temperature'


   



  dict{pointName: list[historicalAnalogData]} readDataMulti( setname:History data group name, names:Point name, start:Start date, end:End date )

 

  readDateMulti obtains a list of historical information within the search period of analog points among points that are registered on the history data groups in Data Explorer.

 

        ㆍ Enter the registered group name to setname.

        ㆍ Enter the name of analog points to names as String. Each name is separated by ';'.

        ㆍ Enter the start date to start using Python datetime.

        ㆍ Enter the end date to end using Python datetime.


        ※ Refer Python script datetime object usage.


  The usage of history information is introduced on historicalAnalogData.



  Example)

   


       import datetime

       st = datetime.datetime(2014, 1, 1, 0, 0, 0)  << 2014-1-1 0:00:00 of Python datetime format

       et = datetime.datetime(2014, 2, 1, 0, 0, 0)  << 2014-2-1 0:00:00 pf Python datetime format


       # dlist는 이력 데이터 그룹 '15kwh'에 속한 아날로그 포인트인 SG공통.본관 총 누적 소비전력량,SG공통.인문사회관 총 누적 소비전력량,SG공통.대학원 총 누적 소비전력량의 2014-1-1 0:00:00부터 2014-2-1 0:00:00 까지의 이력정보가 저장됩니다.****

       dlist = logAnalog.readDataMulti('15kwh','SG공통.본관 총 누적 소비전력량;SG공통.인문사회관 총 누적 소비전력량;SG공통.대학원 총 누적 소비전력량',st, lt)

       for v in range(0, len(dlist)):        

              pointName = dlist.keys()[v]      

              data_list = dlist[pointName]            

              for v in range(0, len(data_list)):

                  print data_list[v].curValue()        #  Obtain the moment value of points

                  print data_list[v].maxValue()        #  Obtain the maximum value of points

                  print data_list[v].minValue()        #  Obtain the minimum value of points

                  print data_list[v].deltaValue()        #  Obtain the variation of points

                  print data_list[v].avgValue()        #  Obtain the average value of points





  historicalAnalogData readDataOnTime( setname:History data group name, name:Point name, time:Search date )

 

  readDataOnTime obtains the history information of analog points at the specified time among points that are registered on history data groups in Data Explorer.


        ㆍ Enter the registered group name to setname.

        ㆍ Enter the name of analog points belonging in the group to name as String.

        ㆍ Enter the search date to time using Python datetime.

        ㆍ Precautions when entering time to time.

                - Set the search date according to the collection period in Data Explorer.  

                - For example, if the collection period is 15minutes interval when entering minutes, enter 0, 15, 30, 45 minutes and enter 0 on the second.

                - If the period is 10 seconds interval, enter 0, 10, 20, 30, 40, 50 on the second.

                - The usage of history information is introduced on 9.2.12.


        ※ Refer Python script datetime object usage.


  The usage of history information is introduced on historicalAnalogData.


  Example)

   


       # Suppose the collection period is 1 second interval.

       import datetime

       tm = datetime.datetime(2014, 1, 1, 1, 2, 1)  << 2014-1-1 1:02:01 of Python datetime format.


       # datat에는 이력 데이터 그룹1에 속한 아날로그 포인트 스테이션1.전압 포인트의 2014-1-1 1:02:01 시간의 저장된 이력 정보가 저장됩니다.  *****

       data = logAnalog.readDataOntime(‘이력 데이터 그룹1’, ‘스테이션1.전압’, time )

       if data.isGood():

       print data.curValue()        # Obtain the moment value of Station1.Voltage

       print data.maxValue()        # Obtain the maximum value of Station1.Voltage

       print data.minValue()        # Obtain the minimum value of Station1.Voltage

       print data.deltaValue()        # Obtain the variation of Station1.Voltage

       print data.avgValue()        # Obtain the average value of Station1.Voltage


   



  float calcAvgInDataGroup( groupName:History data group name, pointName:Point name, valueType:Type, startDate:Start date, endDate:End date )

 

  calcAvgInDataGroup calculates the average value within the range of analog points among points that are registered on history data groups in Data Explorer.


        ㆍ Enter the registered group name to groupName.

        ㆍ Enter the name of analog points belonging to the group to pointName.

        ㆍ There are five types of valueType.

                - logAnalog.Current : The moment value

                - logAnalog.Average : The average value

                - logAnalog.Maximum : The maximum value

                - logAnalog.Minimum : The minimum value

                - logAnalog.Delta : The variation

        ㆍ Enter the start date to startDate using Python datetime.

        ㆍ Enter the end date to endDate using Python datetime.


        ※ Refer Python script datetime object usage.



  Example)

   


       # Suppose the collection period is 15 minutes interval.

       import datetime

       

       start = datetime.datetime(2017, 07, 19, 15, 00, 00) << 2017-07-19T15:00:00 of Python datetime format.

       end = datetime.datetime(2017, 07, 19, 17, 00, 00)  << 2017-07-19T17:00:00 of Python datetime format.


       # valueType {Current = 0, Average = 1, Maximum = 2, Minimum = 3, Delta = 4};

       cur = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Current, start, end)        # Calculate the average value of the moment value of '포인트이름'.

       avg = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Average, start, end)      # Calculate the average value of the average value of ''.

       max = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Maximum, start, end)   # Calculate the average value of the maximum value of ''.

       min = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Minimum, start, end)     # Calculate the average value of the maximum value of ''.

       delta = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Delta, start, end)         # Calculate the average value of the minimum value of ''.


   



  float calcMaxInDataGroup( groupName:History data group name, pointName:Point name, valueType:Type, startDate:Start date, endDate:End date )

 

  calcMaxInDataGroup calculates the maximum value within the range of analog points among points that are registered on history data groups in Data Explorer.


        ㆍ Enter the registered group name to groupName.

        ㆍ Enter the name of analog points belonging to the group to pointName.

        ㆍ There are five types of valueType.

                - logAnalog.Current : The moment value

                - logAnalog.Average : The average value

                - logAnalog.Maximum : The maximum value

                - logAnalog.Minimum : The minimum value

                - logAnalog.Delta : The variation

        ㆍ Enter the start date to startDate using Python datetime.

        ㆍ Enter the end date to endDate using Python datetime.


        ※ Refer Python script datetime object usage.



  Example)

 

       # Suppose the collection period is 15 minutes interval.

       import datetime

       

       start = datetime.datetime(2017, 07, 19, 15, 00, 00) << 2017-07-19T15:00:00 of Python datetime format.

       end = datetime.datetime(2017, 07, 19, 17, 00, 00)  << 2017-07-19T17:00:00 of Python datetime format.


       # valueType {Current = 0, Average = 1, Maximum = 2, Minimum = 3, Delta = 4};

       cur = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Current, start, end)        # Calculate the average value of the moment value of '포인트이름'.

       avg = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Average, start, end)      # Calculate the average value of the average value of ''.

       max = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Maximum, start, end)   # Calculate the average value of the maximum value of ''.

       min = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Minimum, start, end)     # Calculate the average value of the maximum value of ''.

       delta = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Delta, start, end)         # Calculate the average value of the minimum value of ''.


   


  float calcMinInDataGroup( groupName:History data group name, pointName:Point name, valueType:Type, startDate:Start date, endDate:End date )

 

  calcMinInDataGroup calculates the minimum value within the range of analog points among points that are registered on history data groups in Data Explorer.


        ㆍ Enter the registered group name to groupName.

        ㆍ Enter the name of analog points belonging to the group to pointName.

        ㆍ There are five types of valueType.

                - logAnalog.Current : The moment value

                - logAnalog.Average : The average value

                - logAnalog.Maximum : The maximum value

                - logAnalog.Minimum : The minimum value

                - logAnalog.Delta : The variation

        ㆍ Enter the start date to startDate using Python datetime.

        ㆍ Enter the end date to endDate using Python datetime.


        ※ Refer Python script datetime object usage.



  Example)

   


       # Suppose the collection period is 15 minutes interval.

       import datetime

       

       start = datetime.datetime(2017, 07, 19, 15, 00, 00) << 2017-07-19T15:00:00 of Python datetime format.

       end = datetime.datetime(2017, 07, 19, 17, 00, 00)  << 2017-07-19T17:00:00 of Python datetime format.


       # valueType {Current = 0, Average = 1, Maximum = 2, Minimum = 3, Delta = 4};

       cur = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Current, start, end)        # Calculate the average value of the moment value of '포인트이름'.

       avg = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Average, start, end)      # Calculate the average value of the average value of ''.

       max = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Maximum, start, end)   # Calculate the average value of the maximum value of ''.

       min = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Minimum, start, end)     # Calculate the average value of the maximum value of ''.

       delta = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Delta, start, end)         # Calculate the average value of the minimum value of ''.


   



  float calcSumInDataGroup( groupName:History data group name, pointName:Point name, valueType:Type, startDate:Start date, endDate:End date )

 

  calcSumInDataGroup calculates the cumulative value within the range of analog points among points that are registered on history data groups in Data Explorer.


        ㆍ Enter the registered group name to groupName.

        ㆍ Enter the name of analog points to pointName.

        ㆍ There are five types of valueType.

                - logAnalog.Current : The moment value

                - logAnalog.Average : The average value

                - logAnalog.Maximum : The maximum value

                - logAnalog.Minimum : The minimum value

                - logAnalog.Delta : The variation

        ㆍ Enter the start date to startDate using Python datetime.

        ㆍ Enter the end date to endDate using Python datetime.


        ※ Refer Python script datetime object usage.



  Example)

   


       # Suppose the collection period is 15 minutes interval.

       import datetime

       

       start = datetime.datetime(2017, 07, 19, 15, 00, 00) << 2017-07-19T15:00:00 of Python datetime format.

       end = datetime.datetime(2017, 07, 19, 17, 00, 00)  << 2017-07-19T17:00:00 of Python datetime format.


       # valueType {Current = 0, Average = 1, Maximum = 2, Minimum = 3, Delta = 4};

       cur = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Current, start, end)        # Calculate the average value of the moment value of '포인트이름'.

       avg = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Average, start, end)      # Calculate the average value of the average value of ''.

       max = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Maximum, start, end)   # Calculate the average value of the maximum value of ''.

       min = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Minimum, start, end)     # Calculate the average value of the maximum value of ''.

       delta = logAnalog.calcAvgInDataGroup('15분 전력 사용량', '전력.15분 합산 사용량', logAnalog.Delta, start, end)         # Calculate the average value of the minimum value of ''.