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

Usefull Features

PreviousDatabaseNextUpdate Logs

Last updated 5 years ago

The inSCADA platform includes tools and methods that make it easy for developers and users. These features have been developed to increase your productivity on a comfortable platform.

Code2Form

Code2Form is a feature that you can use on all forms where you write script / expression on the inSCADA platform. Thanks to this feature, you can make your script / expressions parametric and select their parameters through the form and prevent you to make changes in the coding each time. Reduces your risk of making mistakes. Makes your Script / Expressions more portable.

As shown in Figure 1, when you open the script editor, you can see the javascript codes if the Code button is enabled. Let's examine the sample code of the form below.

function example() {
    
    var frm_anytag='{#tag:Tags}';
    var frm_text='{#text:Description}';
    var frm_on_color='{#combo:Energized:["GREEN","LIME"]}';
    
    var anytag=ins.getVariableValue(frm_anytag);
    if (anytag!==null) {
        return frm_text+" "+ anytag.value+" "+frm_on_color;
    }
    return "NOK";
}

example();

When we examine the above code, some definitions are made in {}. These are the definitions that make up the elements of our form when we press the Code button and switch the form mode. With these definitions, we enable the user to input the parameters in the form view that we want to use during the execution of our javascript code.

{#tag: Tags} returns all variables as a combobox on the form and allows the user to select them.

{#tag: Description} allows the user to enter a string to a textedit on the form.

{#combo: Energized: ["GREEN", "LIME"]} lists the options defined in the expression in a combobox on the form and allows the user to select any of them.

As can be seen in Figure 2, in the form mode, the user is no longer on the javascript code, but in a form where the user can select and edit the parameters needed.

Figure 1 : Script Editor Code Mode
Figure 2 : Script Editor Form Mode