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.
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")
var status=ins.getConnectionStatus("Connection_01");
if (status==="Disconnected") {
ins.notify("error","Connection 01","Connection 01 is fail");
}
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")
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.
Starts a connection.
connectionName: The connection name.
Return Value: Does not return any value.
if (ins.getConnectionStatus("Connection_01")==="Disconnected") {
ins.startConnection("Connection_01");
}
Stops a connection.
connectionName: The connection name.
Return Value: Does not return any value.
if (ins.getConnectionStatus("Connection_01")==="Connected") {
ins.stopConnection("Connection_01");
}
Last modified 3yr ago