EMS Edit Script Dialog

The EMS Edit Script dialog is used to create and edit individual EMS programs using DesignBuilder Erl code.

General

Name

Enter the name of the EMS script that will appear in the Script Manager list for selection.

Description

The description can be used to add any extra notes or description of the script.

Category

The Category for an EMS script is set to EMS and should not generally be changed once the script has been created.

Script

The EMS script editor provides colour syntax highlighting to make it easier to read the code.

 

Tip: Standard Erl syntax is described in the main EMS application guide.and DesignBuilder extensions to the standard Erl sytax are described on the DesignBuilder Erl page.

Note: Sometimes it can be useful to create and/or edit scripts in an external text editor and paste the text into this dialog when finished. In this case you should bear in mind that the DesignBuilder Script Editor only supports ANSI characters and not the full UTF8 (Unicode) character set. If you paste Unicode text into the Script Editor there is a risk that it will fail to load correctly into EnergyPlus. You should therefore ensure that the script in the external text editor uses the ANSI character set before copying it.

If you are using Notepad++ as your external text editor, from the “Encoding” top menu item use “Convert to ANSI". Alternatively, if using the standard Windows Notepad editor use the “File > Save As” menu option to specify encoding as ANSI.

It can also be opened into plain old Notepad and on “File” → “Save As” specify encoding as ANSI

Enable program

Check this checkbox to ensure that the EMS script is applied to any simulations carried out. EMS scripts are not applied to Heating and Cooling design calculations.

Utilities

Insert EMS/IDF code

DesignBuilder provides several utilities to make it easy to insert EMS and/or IDF code into the script for sensors, variables, internal variables, programs etc. These are accessed by clicking on the Edit Script dialog Info panel links:

 

 

Some of the above tools add a simple keyword while others insert several lines of DB Erl code:

Other tools

EMS code libraries

Publicly accessible libraries of EMS scripts can be accessed by clicking on the links at the bottom of the Info panel. The idea is for DesignBuilder users to share any scripts they have written and found useful.