An Automated NSW Smart Solutions Guide

Also see: Using Notepad++ As a Programming Aid

Eikon Logic Builder is ALC’s development environment for their proprietary Eikon programming language. Mastery of Eikon differentiates power users and senior technicians from mere mortals. If you are doing a lot of work in Eikon, and find that there are repetitive tasks that you’d like to perform, or information that you’d like to export, the scripting interface of Eikon can be a powerful tool. We use it internally to ensure that we have met some of our internal design standards, as well as to provide BacNet point lists in advance to our customers and integration partners.

In order to enable scripting in Eikon, you must first import the scripting Add-on. The scripting add-on ships with the Webctrl (or OEMctrl) installer. So it’s pretty easy to add. Just go to Tools->Configure Tools and select “Scripts” then select “Add” and “OK”. Now the Scripting add on will be selectable in the Tools drop down. To create a new script, go to Tools->Scripting->New, and a scripting dialog box will appear.

 

Once the scripting add-on is enabled, you can view the example scripts from the Tools->Script->Examples menu option.

We prefer to change the script we’re working on in Notepad++, and then paste the changes into the Eikon editor. This is because Notepad++ can provide a syntax highlighter, superior find/replace support for refactoring, and column editing mode that allows for changing multiple lines simultaneously.

The Eikon scripting interface allows you to use the Groovy programming language (a language that targets the Java Virtual Machine) to interact with the Eikon Groovy API, which is reasonably well documented in the Eikon Script Help files available in the Help menu in the Script Editor dialog.

One of the scripts we use is a tool for exporting all the information about network visible BacNet objects in an Eikon program. Let’s dive into it a little bit. It looks like this in Notepad++:

Notepad++coding example

 

Those first 4 lines are declaring some variables and constants.

The template variable is a Java “String Template” which you can supply with a list of strings using the String.format() command to populate each field with actual values. 

pointlist is an array of fields that I use as a header row for a CSV file.

Address and module  are declared as blank strings. Later in the program, I will be overwriting it with other values.

A call to logic.microblocks allows us to iterate through each microblock in the Eikon program that is currently open. By checking the ‘network visible’ property (in prop.’network visible’), we determine if an external device will be able to discover this microblock on the BacNet network. If this is the case, then we add the point type, instance number and IO module address to our output list. First we gather the data that applies to this point in our try…catch section. This allows the same program to run on inputs and outputs without halting on an error. Then we post the gathered data to our list of points using pointlist.add()

After that, we post the pointlist to an csv file using new File().withWriter(). 

This program outputs a table that looks like this:

Output tables

Automated NSW specializes in seamless systems integration for automated environmental controls and automation services. We unify your diverse components—sensors, controllers, software, and networks—into a cohesive system that ensures optimal functionality and efficiency. 

Send us your feedback– what other tech tips would you like to see?