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

Project Functions

PreviousConnection FunctionsNextAlarm Functions

Last updated 5 years ago

Project functions allow you to access project information with script / expression. In the inSCADA Platform, besides the project information, we are able to keep a number of parameters specific to our application statically for the project. With these static parameters, we can ensure that our applications are more general and dynamic. See .

Get Project

object ins.getProject()

Reads the project information.

Syntax

function getProjectProp(id,prop) {
var prj=ins.getProject();
var properties=JSON.parse(prj.properties);
var streams=JSON.parse(properties.STREAMS);
if (prop==="STREAM_NUMBER") {
    var counter=0;
    for (var i=0;i<streams.length;i++) {
         if (streams[i].id.substring(22,24)!=="00") {
         var prefix1=streams[i].id.substring(0,22);
         var prefix2=id.substring(0,22);
         if (prefix1==prefix2) counter=counter+1;
         }
    }
    return counter;
}
else 
{
    for (var z=0;z<streams.length;z++) {
         if (streams[z].id==id) return streams[z][prop];
    }
}
return "NOTOK";
}

getProjectProp("STN01_GRP01_PAY_STREAM01","STREAM_NUMBER");

Project Properties