statusData



 statusData is the value through the function getStatusData in SCADA

 The data includes various information such as the state of status points, the last data, On / Off time, On / Off count, tag, limit, and quality. It has built-in functions that allow you to recall various values.


       Use example)

                   staData = scada.getStatusData('Point name')

                   val = staData.isGood()


 statusData consists of similar functions to logStatus, but unlike the searchable by specifying the date in logStatus, the data is acquired based on the acquisition time.




Methods




Return Type

Method

Description

  int

isGood()

Obtain the value of whether the data is correct.

  float

lastValue()

Obtain the last recorded value of points.

int

scanTime()

Obtain the measurement time of points.

int

timeOnDuration()

Obtain the On-state time of the current time zone.

int

timeOffDuration()

Obtain the Off-state time of the current time zone.

int

timeOnCount()

Obtain the On count of the current time zone.

int

timeOffCount()

Obtain the Off count of the current time zone.

float

timeOnRatio()

Obtain the On / Off ratio of the current time zone.

  int

todayOnDuration()

Obtain the On-state time today.

  int

todayOffDuration()

Obtain the Off-state time today.

  int

todayOnCount()

Obtain the On count today.

  int

todayOffCount()

Obtain the Off count today.

float

todayOnRatio()

Obtain the On / Off ratio today.

  int

monthOnDuration()

Obtain the On-state time this month.

  int

monthOffDuration()

Obtain the Off-state time this month.

  int

monthOnCount()

Obtain the On count this month.

  int

monthOffCount()

Obtain the Off count this month.

float

monthOnRatio()

Obtain the On / Off ratio this month.

int

yearOnDuration()

Obtain the On-state time this year.

int

yearOffDuration()

Obtain the Off-state time this year.

int

yearOnCount()

Obtain the On count this year.

int

yearOffCount()

Obtain the Off count this year.

float

yearOnRatio()

Obtain the On / Off ratio this year.

  int

totalOnDuration()

Obtain the On-state time of all time.

  int

totalOffDuration()

Obtain the Off-state time of all time.

  int

totalOnCount()

Obtain the On count of all time.

  int

totalOffCount()

Obtain the Off count of all time.

float

totalOnRatio()

Obtain the On / Off ratio of all time.

  int

tag()

Obtain the prohibition setting information of points.

int

limit()

Obtain a value range of points.

  int

quality()

Obtain the state information(quality) of points.


  int isGood()

 

  isGood returns the state of data.


         If the return value is 1, it is correct data.

        ㆍ If the return value is 0, it means the server stopped due to abnormal data, the unusual state of drivers, and the error of data. quality() method contains error information.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.isGood();  << when the value of val is 1, it is correct data, if it is 0, it is abnormal data.





  float lastValue()

 

  lastValue returns the last recorded value(the recent value) on the status point.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  <<  Read the data of status points matched with the entered point name.

       val = sta_Data.lastValue();  << Enter the last recorded value to val.





  int scanTime()

 

   scanTime returns the measurement time of points.


        ㆍ The return value is the number computed in second.

        ㆍ The return value can convert into time value through the function Datetime.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       scanTimedata = sta_Data.scanTime();  << Enter the measurement time of points to scanTimedata.


       tm = datetime.datetime.fromtimestamp(scanTimedata);  << Convert the number in seconds into the Python time format.


                   



  int timeOnDuration()

 

  timeOnDuration obtains the On-state time of the current time zone based on the acquisition time.

  For example, when the acquisition time is 10:20, it obtains the On-state time between 10:00 to 10:20.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.timeOnDuration();  << Enter the On-state time of the current time zone to secTime.





  int timeOffDuration()

 

  timeOffDuration obtains the Off-state time of the current time zone based on the acquisition.

  For example. when the acquisition time is 10:20, it obtains the Off-state time between 10:00 to 10:20.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.timeOffDuration();  << Enter the Off-state time of the current time zone to secTime.

 




  int timeOnCount()

 

  timeOnCount obtains the On count of the current time zone based on the acquisition time.

  For example, when the acquisition time is 10:20, it obtains the On count between 10:10 to 10:20.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.timeOnCount();  << Enter the On count of the current time zone to val.

 




  int timeOffCount()

 

  timeOffCount obtains the Off count of the current time zone based on the acquisition time.

  For example, when the acquisition time is 10:20, it obtains the Off count of the current time zone.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.timeOffCount();  << Enter the Off count to val.





  float timeOnRatio()

 

  timeOnRatio obtains the On / Off ratio of the current time zone based on the acquisition time.

  For example, when the acquisition time is 10:20, it obtains the On / Off ratio of the current time zone.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.timeOnRatio();  << Enter the On / Off ratio of the current time zone to val.





  int todayOnDuration()

 

  todayOnDuration obtains the On-state time today based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.todayOnDuration();  << Enter the On-state time today to secTime.





  int todayOffDuration()

 

  todayOffDuration obtains the Off-state time today based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.todayOffDuration();  << Enter the Off-state time today to secTime.





  int todayOnCount()

 

  todayOnCount obtains the On count today based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.todayOnCount();  << Enter the On count today to val.





  int todayOffCount()

 

  todayOffCount obtains the Off count today based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.todayOffCount();  << Enter the Off count today to val.





  float todayOnRatio()

 

  todayOnRatio obtains the On / Off ratio today based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.todayOnRatio();  << Enter the On / Off ratio today to val.





  int monthOnDuration()

 

  monthOnDuration obtains the On-state time this month based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.monthOnDuration();  << Enter the On-state time this month to secTime.





  int monthOffDuration()

 

  monthOffDuration obtains the Off-state time this month based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.monthOffDuration();  << Enter the Off-state time this month to secTime.





  int monthOnCount()

 

  monthOnCount obtains the On count this month based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.monthOnCount();  << Enter the On count this month to val.





  int monthOffCount()

 

  monthOffCount obtains the Off count this month based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.monthOffCount();  << Enter the Off count this month to val.





  float monthOnRatio()

 

  monthOnRatio obtains the On / Off ratio this month based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.monthOnRatio();  << Enter the On / Off ratio this monthe to val.





  int yearOnDuration()

 

  yearOnDuration obtains the On-state time this year based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.yearOnDuration();  << Enter the On-state time this year to secTime.





  int yearOffDuration()

 

  yearOffDuration obtains the Off-state time this year based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.yearOffDuration();  << Enter the Off-state time this year to secTime.





  int yearOnCount()

 

  yearOnCount obtains the On count this year based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.yearOnCount();  << Enter the On count this year to val.





  int yearOffCount()

 

  yearOffCount obtains the Off count this year based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.yearOffCount();  << Enter the Off count this year to val.





  float yearOnRatio()

 

  yearOnRatio obtains the On / Off ratio this year based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.yearOnRatio();  << Enter the On / Off ratio this year to val.





  int totalOnDuration()

 

  totalOnDuration obtains the On-state time of the all time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.totalOnDuration();  << Enter the On-state time of the all time to secTime.





  int totalOffDuration()

 

  totalOffDuration obtains the Off-state time of the all time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       secTime = sta_Data.totalOffDuration();  << Enter the Off-state time of the all time to secTime.





  int totalOnCount()

 

  totalOnCount obtains the On count of the all time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.totalOnCount();  << Enter the On count of the all time to val.





  int totalOffCount()

 

  totalOffCount obtains the Off count of the all time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.totalOffCount();  << Enter the Off count of the all time to val.





  float totalOnRatio()

 

  totalOnRatio obtains the On / Off ratio of the all time based on the acquisition time.



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       val = sta_Data.totalOnRatio();  << Enter the On / Off ratio of the all time to val.





  int tag()

 

  tag returns the prohibition setting value.


        ㆍ If the return value is 0, it means no prohibition settings.

        ㆍ Users can check the return value as a comparison.

        ㆍ tag return value

                - scada.ControlInhabit (0x01) : Control prohibition

                - scada.AlarmInhibit (0x02) : Alarm prohibition

                - scada.ScanInhabit (0x04) : Scan prohibition

                - scada.UpdateInhabit (0x08) : Update prohibition



  Examples)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       tagdata = sta_Data.tag();  << Enter the tag information of status data is entered to tagdata. If the tagdata information is 0, it means no prohibition settings.

       

       if (tagdata & scada.ControlInhabit):

       << TRUE: Control prohibition setting, FALSE: No control prohibition setting

       if (tagdata & scada.AlarmInhibit):

       << TRUE: Alarm prohibition setting, FALSE: No alarm prohibition setting

       if (tagdata & scada.ScanInhabit):

       << TRUE: Scan prohibition setting, FALSE: No scan prohibition setting

       if (tagdata & scada.UpdateInhabit):

       << TRUE: Update prohibition setting, FALSE: No update prohibition setting


       



  int quality()

 

  quality returns the reason when the data of status points is abnormal.


        ㆍ If the return value is 0, it is correct data.

        ㆍ Users can check the return value by comparison.

        ㆍ quality return value

                - scada.NonTelemeted (0x01) : Fep scan failed

                - scada.ManuallyReplaced (0x04) : Manual entry state

                - scada.Failed (0x08) : Fep response failed

                - scada.OldData (0x20) : The data state persists for more than a certain amount of time

                - scada.BadData (0x40) : Abnormal data



  Example)

   


       sta_Data = scada.getStatusData('Point name');  << Read the data of status points matched with the entered point name.

       qualitydata = sta_Data.quality();  << Enter the quality information of status data to qualitydata. If the qualitydata information is 0, there is no quality information and it is correct data.

       

       if (qualitydata& scada.NonTelemeted):

       << TRUE: Fep scan failed data, FALSE: Normal data

       if (qualitydata& scada.ManuallyReplaced):

       << TRUE: Manual entry state data, FALSE: Normal data

       if (qualitydata& scada.Failed):

       << TRUE: Fep response failed data, FALSE: Normal data

       if (qualitydata& scada.OldData):

       << TRUE: The data state persists for more than a certain amount of time, FALSE: Normal data

       if (qualitydata& scada.BadData):

       << TRUE: Abnormal data, FALSE: Normal data

       




  int limit()

 

  limit returns the value range of status points.


         If the return value is 0, no range set, and it is correct data.

         Users can check the return value by comparison.

         limit return value

                - scada.LowHi (0x01) : Hi Low exceeded

                - scada.LowLowHiHi (0x02) : HiHi LowLow exceeded

                - scada. UnReasonable (0x04) : Out of range data

                - scada.Roc (0x08) : Out of change rate data

                - scada.Abnormal (0x10) : Abnormal data



  Examples)

   


       sta_Data = scada.getStatusData(‘Point name’);  << Read the data of status points matched with the entered point.

       limitdata = sta_Data.limit();  << Enter the limit information of status data to limitdata. If the limitdata information is 0, there is no information about the range and it is correct data.

       

       if (limitdata & scada.LowHi):

       << TRUE: Out of LowHi range data, FALSE: Inside the range data

       if (limitdata & scada.LowLowHiHi):

       << TRUE: Out of LowLowHiHi range data, FALSE: Inside the range data

       if (limitdata & scada.UnReasonable):

       << TRUE: Out of range data, FALSE: Inside the range data

       if (limitdata & scada.Roc):

       << TRUE: Out of change rate data, FALSE: Inside the change rate data

       if (limitdata & scada.Abnormal):

       << TRUE: Abnormal data, FALSE: Normal data