scada
scada
scada object is used to read or write the value of points, and also can be used to process the data within the system.
scada object provides the following methods.
Methods
Return Type |
Method |
Description |
analogData |
getAnalogData( name ) |
Read the data of analog points. |
statusData |
getStatusData( name ) |
Read the data of status points. |
string |
getTextValue( name ) |
Read the value of text points. |
float |
getValue( name ) |
Read the value of status points or analog points. |
boolean |
isPointExist( name ) |
Check whether the point exists. |
resetData( name ) |
Clear the current value and the history data value of status points or analog points. |
|
Restart the calculation. |
||
sendEvent( level, area, origin, desc, event ) |
Create an event and send it. |
|
setFormula( name, formula ) |
Used to calculate points. |
|
setSummation( name, datas ) |
Used to sum points. |
|
setTextValue( name, value ) |
Write a text value on the text point. |
|
setValue( name, value ) |
Write a value on the status point or analog point. |
|
boolean |
waitForValueChange( name, value, msec ) |
Wait for the value of points to be the set value. |
analogData getAnalogData( name:Point name ) |
getAnalogData can get additional information the analog point had, including the current value. The return type is analogData, it includes various values as well as the current value. Examples)
data = scada.getAnalogData('Station 1.A') # Read the data of analog point 'Station 1.A'. current = data.lastValue() # Read the current value. current = data.maxValue() # Read the maximum time value based on the current time. current = data.minValue() # Read the minimum time value based on the current time. current = data.avgValue() # Read the average time value based on the current time. current = data.accValue() # Read the variation time value based on the current time. ################################### current = data.dayMaxValue() # Read the maximum value today based on the current time. current = data.dayMinValue() # Read the minimum value today based on the current time. current = data.dayAvgValue() # Read the average value today based on the current time. current = data.dayAccValue() # Read the variation value today based on the current time. ################################### current = data.monthMaxValue() # Read the maximum value this month based on the current time. current = data.monthMinValue() # Read the minimum value this month based on the current time. current = data.monthAvgValue() # Read the average value this month based on the current time. current = data.monthAccValue() # Read the variation value this month based on the current time.
################################### current = data.yearMaxValue() # Read the maximum value this year based on the current time. current = data.yearMinValue() # Read the minimum value this year based on the current time. current = data.yearAvgValue() # Read the average value this year based on the current time. current = data.yearAccValue() # Read the variation value this year based on the current time. ################################### current = data.totalMaxValue() # Read the maximum value of all time. current = data.totalMinValue() # Read the minimum value of all time. current = data.totalAvgValue() # Read the average value of all time. current = data.totalAccValue() # Read the variation value of all time.
good = data.isGood() # Check whether the data is correct.
|
statusData getStatusData( name:Point name ) |
getStatusData can get additional information the status point had, including the current value. The return type is statusData, it includes various values as well as the current value. Examples)
data = scada.getAnalogData('Station 1.A'); # Read the data of status point 'Station 1.A'. current = data.lastValue() # Read the current value. current = data.timeOnDuration() # The time duration that the current value is On based on the current time.(ms) current = data.timeOffDuration() # The time duration that the current value is Off based on the current time.(ms) current = data.timeOnCount() # The number of counts that the current value switches to On based on the current time. current = data.timeOffCount() # The number of counts that the current value switches to Off based on the current time. current = data.timeOnRatio() # The ratio of the time for the value is On based on the current time. ################################### current = data.todayOnDuration() # The time duration that the daily value is On based on the current time.(ms) current = data.todayOffDuration() # The time duration that the daily value is Off based on the current time.(ms) current = data.todayOnCount() # The number of counts that the daily value switches to On based on the current time. current = data.todayOffCount() # The number of counts that the daily value switches to Off based on the current time. current = data.todayOnRatio() # The ratio of the time for the daily value is On based on the current time. ################################### current = data.monthOnDuration() # The time duration that the monthly value is On based on the current time.(ms) current = data.monthOffDuration() # The time duration that the monthly value is Off based on the current time.(ms) current = data.monthOnCount() # The number of counts that the monthly value switches to On based on the current time. current = data.monthOffCount() # The number of counts that the monthly value switches to Off based on the current time. current = data.monthOnRatio() # The ratio of the time for the monthly value is On based on the current time. ################################### current = data.yearOnDuration() # The time duration that the annual value is On based on the current time.(ms) current = data.yearOffDuration() # The time duration that the annual value is Off based on the current time.(ms) current = data.yearOnCount() # The number of counts that the annual value switches to On based on the current time. current = data.yearOffCount() # The number of counts that the annual value switches to Off based on the current time. current = data.yearOnRatio() # The ratio of the time for the annual value is On based on the current time. ################################### current = data.totalOnDuration() # The time duration that the all time value is On based on the current time.(ms) current = data.totalOffDuration() # The time duration that the all time value is Off based on the current time.(ms) current = data.totalOnCount() # The number of counts that the all time value switches to On based on the current time. current = data.totalOffCount() # The number of counts that the all time value switches to Off based on the current time. current = data.totalOnRatio() # The ratio of the time for the all time value is On based on the current time.
good = data.isGood() # Check whether the data is correct.
|
getValue reads the value of points. Both analog points and status points are available. Example)
val = scada.getValue('Station 1.A'); # Read the data of point 'Station 1.A'.
|
setValue writes the value of points. Both analog points and status points are available. Example)
scada.setValue('Station 1.A', 202.4); # Set the value of point 'Station 1.A' as 202.4
|
getTextValue reads the value of text points. Example)
val = scada.getTextValue('Station 1.A'); # Read the value of text point 'Station 1.A'
|
setTextValue writes the value of text points. It is available in the text point. Example)
scada.setTextValue('Station 1.A', 'myText'); # Set the value of text point 'Station 1.A' as 'myText'
|
Reset the value of points. The history of data value is also reset. Example)
scada.resetData('Station 1.A') # Reset the value of point 'Station 1.A'
|
Restart the calculation. Example)
scada.restartCalculation() # Restart the calculation.
|
Check whether the point exists. Example)
ret = scada.isPointExist('Station 1.A'); # Check whether point 'Station 1.A' exists. if ( ret == 0 ): print 'Not exists' else: print 'Exists'
|