SCADA Scripts

SCADA script is an advanced feature of a basic system. It is required mainly if the user need to customize the integration for some uncommon scenario, or anything other unique behavior which ordinary settings could not achieve. For example, some operation which requires mathematics calculation.

One of the benefits of Ecava IGX is the inclusiveness of built-in functions (let’s call it IGX function), which provided free for all users. There are 2 mostly used IGX functions, setTag() and getTag(). As the function name indicates, setTag() is used to write value into the particular tag, while getTag() is for reading values from the tag. In this training, a few of these IGX functions will be walked through.

Create New SCADA Script

Let’s get started by opening an existing or create a new Ecava IGX project. Then, navigate to ‘Script’, and noticed that there were a few existing script files created for user’s convenience. Click on the script name on the left pane will open the script file content in the editor. Note that the script is written in javascript language.

Create a new SCADA script by adding a new row at the script table, set it to trigger by Tag, then select a tag from the list. In this case, create a Boolean type virtual tag and use it as script trigger. Save the project, and the new blank script file will be generated and shown in the list.

create new SCADA script

Writing SCADA Script

Create a few more virtual tags for script’s usage. For example, one for write function and one for read function. Then, open the new script file and try to write some simple scripts for setTag() and getTag() operation, as shown in example below.

SCADA script function set and get tag values

Run the project to test the SCADA script. First, change the value for tag ‘script_gettag’ by using Watch Window. Then trigger the script by setting the trigger tag value, and noticed the tag ‘script_settag’ will be changed accordingly to the script written, as shown below.

SCADA script testing on runtime


Basically, users have all the freedom to develop their own SCADA scripts based on their requirements. However, the best practice is always to keep the programming operations as clean and bug free as possible, so that the entire SCADA control operation will be efficient.

SCADA script javascripts example

For more complicated SCADA script example, open the existing script called ‘init.js’ to reveal the javascripts, as shown in screenshot above. In summary, the script is used to perform mathematics operation that uses random number function for the calculation.


Download Ecava IGX now and start writing own scripts to customize your SCADA system to achieve almost anything possible!


← Back to SCADA Training

Do NOT follow this link or you will be banned from the site!