statusData
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 |
Obtain the value of whether the data is correct. |
|
float |
Obtain the last recorded value of points. |
|
int |
Obtain the measurement time of points. |
|
int |
Obtain the On-state time of the current time zone. |
|
int |
Obtain the Off-state time of the current time zone. |
|
int |
Obtain the On count of the current time zone. |
|
int |
Obtain the Off count of the current time zone. |
|
float |
Obtain the On / Off ratio of the current time zone. |
|
int |
Obtain the On-state time today. |
|
int |
Obtain the Off-state time today. |
|
int |
Obtain the On count today. |
|
int |
Obtain the Off count today. |
|
float |
Obtain the On / Off ratio today. |
|
int |
Obtain the On-state time this month. |
|
int |
Obtain the Off-state time this month. |
|
int |
Obtain the On count this month. |
|
int |
Obtain the Off count this month. |
|
float |
Obtain the On / Off ratio this month. |
|
int |
Obtain the On-state time this year. |
|
int |
Obtain the Off-state time this year. |
|
int |
Obtain the On count this year. |
|
int |
Obtain the Off count this year. |
|
float |
Obtain the On / Off ratio this year. |
|
int |
Obtain the On-state time of all time. |
|
int |
Obtain the Off-state time of all time. |
|
int |
Obtain the On count of all time. |
|
int |
Obtain the Off count of all time. |
|
float |
Obtain the On / Off ratio of all time. |
|
int |
Obtain the prohibition setting information of points. |
|
int |
Obtain a value range of points. |
|
int |
Obtain the state information(quality) of points. |
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. |
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. |
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.
|
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. |
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.
|
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.
|
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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
|
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
|
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
|