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
  • Get Connection Status
  • Start Connection
  • Stop Connection
  1. Programing
  2. APIs

Connection Functions

Connection functions allow you to manage connections on the inSCADA platform with script/expression. With these functions you can run, stop and check the status of connections.

Get Connection Status

String ins.getConnectionStatus(String connectionName)

Provides information about the status of a connection.

connectionName: The connection name.

Return Value: Returns a string containing information about the connection status. ("Connected","Disconnected")

Syntax

var status=ins.getConnectionStatus("Connection_01");
if (status==="Disconnected") {
    ins.notify("error","Connection 01","Connection 01 is fail");
}

String ins.getConnectionStatus(Integer connectionId)

Returns information about a connection status.

connectionId: The ID of the connection.

Return Value: Returns a string containing information about the connection status. ("Connected","Disconnected")

Syntax

var connectionId=1;
var status=ins.getConnectionStatus("Connection_01");
if (status==="Disconnected") {
    ins.notify("error","Connection 01","Connection 01 is fail");
}

ConnectionId is a unique registration number in the database on connections in the inSCADA Platform. It is not displayed on the platform. However, this information can be taken from value expression using the self expression (self.connectionId). This allows you to write expressions that can check the overall connection status.

Start Connection

startConnection(String connectionName)

Starts a connection.

connectionName: The connection name.

Return Value: Does not return any value.

if (ins.getConnectionStatus("Connection_01")==="Disconnected") {
    ins.startConnection("Connection_01");
}

Stop Connection

stopConnection(String connectionName)

Stops a connection.

connectionName: The connection name.

Return Value: Does not return any value.

Syntax

if (ins.getConnectionStatus("Connection_01")==="Connected") {
    ins.stopConnection("Connection_01");
}
PreviousVariable FunctionsNextProject Functions

Last updated 5 years ago