Backend scripts

03.03.2021

Internal scripts are written in JavaScript using ES3. Scripts can be executed periodically (according to the schedule or time period you can edit) or triggered by a change of the SCADA system variable (SCADA system variables are called “tags”).

Access SCADA tag

getTag(tagName)
The function returns the value of a SCADA tag
Parameter name Parameter type Description
tagName String The name of a SCADA tag

Example of getting the SCADA tag value.

// Value of the “tag1” tag is 100
getTag(“tag1”);
// returns 100

Change SCADA tags value

setTag(tagName, newTagValue)
The function sets the new value to a SCADA tag.
Parameter name Parameter type Description
tagName String The name of a SCADA tag
newTagValue String | Number The new value of a SCADA tag

Example of setting the SCADA tag value (from the internal script or the frontend).

// “tag1” value is 100
setTag(“tag1”, 200);
// “tag1” value is 200

To get data from the database

getSql(query,{dbgroup: dbgroupName, outfmt: outFmtName})
The function sets the new value to a SCADA tag.
Parameter name Parameter type Description
query String The SQL query
dbgroupName String Name of the configured database (can be seen in the “Name” column of the “Database” tab in the Integraxor Project Editor)
outFmtName String Name of the format the query result will be returned in.

If the DOM node that was clicked (event.target) was neither our container div (this.wrapperRef.current) nor was it any node inside of it (!this.wrapperRef.current.contains(event.target)), we call the onOutsideClick prop.

Questions & Answers

Uzdošu ļoti svarīgu jautājumu. Have you ever been to Uranus?

Yes, I have. What's the deal?!

Ask a question

By submitting this form, I agree that provided information will be used to inform me with an answer to my question.