inSCADA
EN
EN
  • Introduction
  • Getting started
  • User Interface
    • Home
    • Development
      • Projects
      • Connections
      • Devices
      • Animations
        • Get
        • Color
        • Rotate
        • Move
        • Opacity
        • Bar
        • Click
        • Tooltip
      • Alarm Groups
      • Alarms
      • Scripts
      • Expressions
      • Variables
      • Reports
      • Processes
      • Mail
      • Import/Export
    • Wizards
      • Gas Metering
      • HPP Unit
      • Device Library
    • Visiualisation
    • Processes
    • Control Panel
    • Project Map
    • Variable History
    • Alarm History
    • Alarm Monitor
    • Trend Graphics
    • Reports
    • Logs
    • Auth Logs
    • Jobs
    • Users
    • Help
    • About
    • License
  • Mimic Design
  • Communication Protocols
    • MODBUS
      • Modbus TCP
      • Modbus UDP
      • Modbus RTU Over TCP
      • Modbus TCP Server
      • Modbus RTU Slave Over TCP
    • DNP3
      • DNP3 Master
      • DNP3 Outstation
    • PROFINET
    • IEC-104
    • SNMP
    • OPC
      • OPC UA Client
  • Programing
    • APIs
      • Variable Functions
      • Connection Functions
      • Project Functions
      • Alarm Functions
      • Script Functions
      • In-Memory DB Functions
      • System Functions
      • User Functions
      • Date-Time Functions
      • String Functions
      • Notification Functions
      • Confirmation Functions
      • Database Functions
      • Other Functions
  • Database
  • Usefull Features
  • Update Logs
  • Architectures and Applications
  • Development Roadmap
  • Migration to inSCADA
  • Licensing Policies
  • FAQ
  • Screenshots
  • Auxiliary Tools
  • Installations
    • Requirements
    • Installation on Linux
Powered by GitBook
On this page
  1. Programing
  2. APIs

Confirmation Functions

Confirmation functions are used to obtain confirmation from users via script/expression on the inSCADA platform.

Getting Approval From Users

ins.confirm(String type,String title, String message, Object object)

Confirmation about actions to be taken from users provides information for events that are happening. For example, you can have the user enter an information message about why a system has stopped. In this way, you can get reports about the reasons for stopping the system from inSCADA.

inSCADA offers 8 different methods of obtaining approval or information. You specify these methods with the Type parameter. They are

  • combo-text-yes

  • combo-text-yesno

  • combo-yes

  • combo-yesno

  • text-yes

  • text-yesno

  • yes

  • yesno

Other parameters in ins.confirm method are;

  • Title : Defines the title of the dialog to be opened.

  • Message : Defines the message of the dialog to be opened.

  • Object : It is an object that shapes the dialog window and defines the methods to be executed when the yes and no buttons are clicked.

Now let's examine how our dialog window for obtaining confirmation or information according to these parameters is formed.

var obj = {};
            obj.options = [
                "HV Circuit Breaker Opened at Transformer Center",
                "HV Circuit Breaker Opened at Unit Cubicle",
                "HV Circuit Breaker Opened at Grid Cubicle",
                "Water Sold Out",
                "Operator Fail",
                "Mekanik Fail",
                "RTU/PLC Fail",
                "SCADA Fail"];
            obj.onScript =  function(a){
                ins.notify("info", "Reason for Stopping", a.comboValue+"-"+a.textValue);
                ins.writeLog("info", "Unit 01","Reason for Stopping", a.comboValue+"-"+a.textValue);
            };
            obj.offScript = function(a){
                ins.notify("info","Canceled","No any message"}; 
            };
    
        ins.confirm("combo-text-yes", "PLEASE ANSWER..", "WYH DID THE UNIT STOP?", obj);

When you examine the above code, you can see that the object that defines our dialog window with the object obj is defined.

  • Object.options : Creates a list of options to be seen in Combobox.

  • Object.onScript : Defines the script to be executed when the Yes button is clicked.

  • Object.offScript : Defines the script to run when the No button is clicked.

The type, Title, Message, and object parameters are sent to the API on the line where the ins.confirm API is called.

PreviousNotification FunctionsNextDatabase Functions

Last updated 5 years ago

Figure 1 : combo-text-yes
Figure 2 : combo-text-yesno
Figure 3 : combo-yes
Figure 4 : combo-yesno
Figure 5 : text-yes
Figure 6 : yesno
Figure 7 : yes
Figure 8 : yesno