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.


restartCalculation()

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.


       



  float getValue( name:Point name ) 

 

  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( name:Point name, value:Setting value )

 

  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

     


 


  string getTextValue( name:Point name ) 

 

  getTextValue reads the value of text points.



  Example) 

     


       val = scada.getTextValue('Station 1.A');  # Read the value of text point 'Station 1.A'

       


 


  setTextValue( name:Point name, text:Text )

 

  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'

     


 


  boolean waitForValueChange( name:Point name, value:Setting value, msec:Waiting time(msec) )

 

  Wait for the time entered until the point changed to the value you set. (Do not change to the setting value)

  If the value changed in the waiting time, return TRUE, otherwise, return FALSE.



  Examples) 

     


       remote.setValue('Station 1.Control Switch', 1)  # Set the state of the switch as 1

       ret =  scada.waitForValueChange('Station 1.Switch_Status', 1, 1000);  # Wait for a second until the state of the switch changed to 1.

       if ( ret == 1 ):

              print 'Changed'

       else:

              print 'Not changed'

     




  resetData( name:Point name )

 

  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'

     




  sendEvent( level:Alarm level, aor: Responsible area, origin: Location, desc: Description, event: Alarm contents )

 

  Create an event and print it on the event screen.



  Example) 

     


       scada.sendEvent(1, 1, 'System', 'System test', 'Error.')

     



Output)

 


  restartCalculation()

 

  Restart the calculation.



  Example) 

     


       scada.restartCalculation()  # Restart the calculation.

     




  boolean isPointExist( name:Point name )

 

  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'

   




  setSummation( name:Name for the point to save, datas:List of points to be added )

 

  setSummation is used to sum values and save it to a new point. The calculation is executing once.


        ㆍ name is the name of the point to save the added value.

        ㆍ datas is a list of points for summation. The following is the form.

                ㆍ ['Point1','Point2']



  Example) 

   


       # Sum the value of A,B and save it to C

       scada.setSummation('C', ['A', 'B']);


    



  setFormula( name:Name for the point to save, formula: Point formula)

 

  setFormula is used to calculate values and save them to a new point. The calculation is executing once.


        ㆍ name is the name of points to save the calculated value.

        ㆍ The formula is a point formula including summation, subtraction, multiply, and division. The following is an example.

                - Subtract the point2 from point1 : " 'point1' - 'point2' "

                - Sum the point2 and point1 then subtract the point3 : " 'point1' + 'point2' - 'point3' "


  Example) 

   


       # Subtract the value of B from A then save it to C

       f = "  'A' - 'B' "

       scada.setFormula('C', f)