Вы находитесь на странице: 1из 50

StruxureWare Building Operation

Plain English and Script


Difference Guide
04-16002-01-en
December 2014
StruxureWare Building Operation
Plain English and Script
Difference Guide
04-16002-01-en
December 2014
Copyright © 2014 Schneider Electric. All rights reserved.
The Schneider Electric brand and any registered trademarks of Schneider Electric Industries SAS referred to in this guide are the sole property of Schneider
Electric SA and its subsidiaries. They may not be used for any purpose without the owner's permission, given in writing. This guide and its content are
protected, within the meaning of the French intellectual property code (Code de la propriété intellectuelle français, referred to hereafter as "the Code"), under
the laws of copyright covering texts, drawings and models, as well as by trademark law. You agree not to reproduce, other than for your own personal, non-
commercial use as defined in the Code, all or part of this guide on any medium whatsoever without Schneider Electric's permission, given in writing. You also
agree not to establish any hypertext links to this guide or its content. Schneider Electric does not grant any right or license for the personal and non-
commercial use of the guide or its content, except for a non-exclusive license to consult it on an "as is" basis, at your own risk. All other rights are reserved.
Trademarks and registered trademarks are the property of their respective owners.
Contents

Introduction
1 About This Guide ........................................................... 9
1.1 Purpose of This Guide ................................................................. 11
1.2 How This Guide is Organized ...................................................... 12
1.3 Typographical Conventions ......................................................... 13

2 Additional Information .................................................. 15


2.1 Where to Find Additional Information ........................................... 17
2.2 Regulatory Notices ...................................................................... 19

Reference
3 Script Programming Language Overview ..................... 23
3.1 Script Programming Language ................................................... 25
3.1.1 Script Programs ....................................................................... 25
3.1.2 Script Functions ........................................................................ 25
3.1.3 Types of Script Programs and Functions .................................. 25
3.2 Program Status and Configuration Information ............................ 27
3.3 Tasks .......................................................................................... 28

4 Program Language Differences .................................... 29


4.1 Script and Plain English Program Differences ............................. 31
4.1.1 Binding Variables ...................................................................... 31
4.1.2 User Function Declarations ....................................................... 31
4.1.3 Array Element Access ............................................................... 32
4.1.4 BACnet Priority Level Access .................................................... 32
4.1.5 New Wait Keyword ................................................................... 32
4.1.6 System Constants .................................................................... 33
4.1.7 System Variables ...................................................................... 33
4.1.8 Scheduled Program Execution .................................................. 33
4.1.9 Script Editor Features ............................................................... 34
4.2 Declaring a Binding Variable ........................................................ 35
4.3 Declaring a User Function ........................................................... 36
4.4 Configuring BACnet Priority Level Access ................................... 37
4.5 Configuring Delays in Plain English Programs .............................. 39

04-16002-01-en, December 2014 Plain English and Script


5
4.6 Using System Constants ............................................................. 41

5 Script Editor Overview .................................................. 43


5.1 Script Editor Similarities to Plain English IDE Editor ..................... 45
5.2 Script Editor Color-Coded Program Elements ............................ 46
5.3 Script Editor Code Library .......................................................... 47
5.4 Plain English Code Import and Export in Script ........................... 48

Plain English and Script 04-16002-01-en, December 2014


6
Introduction

The Introduction part contains information on the purpose


of this guide, how this guide is organized, where to find
more information, and information on regulatory notices.
1 About This Guide

Topics
Purpose of This Guide
How This Guide is Organized
Typographical Conventions
1 About This Guide
1.1 Purpose of This Guide

1.1 Purpose of This Guide


This guide provides information about the differences between the Plain English
programs and Script programs. An overview of the Script programming language
and Script Editor are also included.

04-16002-01-en, December 2014 Plain English and Script


11
1 About This Guide
1.2 How This Guide is Organized

1.2 How This Guide is Organized


This Building Operation Guide is divided into the following parts:

Introduction
The Introduction part contains information on the purpose of this guide, how this
guide is organized, where to find more information, and information on regulatory
notices.

Reference
The Reference part contains conceptual information, procedures, user interface
descriptions and troubleshooting information. If you want more information, see
WebHelp or the other Building Operation Reference Guides.

Plain English and Script 04-16002-01-en, December 2014


12
1 About This Guide
1.3 Typographical Conventions

1.3 Typographical Conventions


Building Operation Guides use the following specially marked texts:

Tip
Helps you understand the benefits and capabilities of the product.

Note
Provides you with supplementary information.

Important
Alerts you to supplementary information that is essential to the completion of a
task.

Caution
Alerts you to a condition that can cause loss of data.

Warning
Alerts you to a condition that can cause product damage or physical harm.

Bold texts:
User interface items, such as property names and buttons, are written in bold, for
example "On the File menu, select New."

04-16002-01-en, December 2014 Plain English and Script


13
2 Additional Information

Topics
Where to Find Additional Information
Regulatory Notices
2 Additional Information
2.1 Where to Find Additional Information

2.1 Where to Find Additional Information


All the technical Building Operation information is available online, on WebHelp.
WebHelp is a web-based help system for StruxureWare Building Operation and
Automation Server Family products, the software and hardware that powers
SmartStruxure solution.
By pressing F1 or clicking a Help button in the StruxureWare Building Operation
software your web browser opens WebHelp with the latest, up-to-date, technical
documentation.

Figure: Help in StruxureWare Building Operation


Some StruxureWare Building Operation software products give you context-
sensitive help by opening a WebHelp page that explains the view or dialog box you
have in focus. Some programs open up an overview page. From these pages, you
can follow the links to get more detailed information.
WebHelp contains all the technical information that is in the guides, specification
sheets, and installation instructions.

The WebHelp site


One of the advantages with WebHelp is that you can reach Help without having the
StruxureWare Building Operation software installed on your computer. By entering
the URL address help.sbo.schneider-electric.com you can access WebHelp from
any computer, smartphone, or tablet connected to the internet.

Finding information
The easiest way to find information on WebHelp is to search for it.

Figure: Home page search


All technical information is gathered in one place, so you do not need to know
which guide, specification sheet, or installation instruction the information is in.

Filtering the information


To narrow down the search results, you can use these filters:
• Product
• Functionality
• Information type

04-16002-01-en, December 2014 Plain English and Script


17
2 Additional Information
2.1 Where to Find Additional Information

Figure: Search filters

Plain English and Script 04-16002-01-en, December 2014


18
2 Additional Information
2.2 Regulatory Notices

2.2 Regulatory Notices

UL 916 Listed products for the Unites States and Canada, Open
Class Energy Management Equipment.

WEEE - Directive of the European Union (EU)


This equipment and its packaging carry the waste of electrical and electronic
equipment (WEEE) label, in compliance with European Union (EU) Directive
2002/96/EC, governing the disposal and recycling of electrical and electronic
equipment in the European community.

CE - Compliance to European Union (EU)


2004/108/EC Electromagnetic Compatibility Directive
This equipment complies with the rules, of the Official Journal of the European
Union, for governing the Self Declaration of the CE Marking for the European Union
as specified in the above directive(s) per the provisions of the following standards:
IEC/EN 61326-1 Product Standard, IEC/EN 61010-1 Safety Standard.

Industry Canada
ICES-003
This is a Class B digital device that meets all requirements of the Canadian
Interference Causing Equipment Regulations.

C-Tick (Australian Communications Authority (ACA))


AS/NZS 3548
This equipment carries the C-Tick label and complies with EMC and radio
communications regulations of the Australian Communications Authority (ACA),
governing the Australian and New Zealand (AS/NZS) communities.

Federal Communications Commission


FCC Rules and Regulations CFR 47, Part 15, Class B
This device complies with part 15 of the FCC Rules. Operation is subject to the
following two conditions: (1) This device may not cause harmful interference. (2) This
device must accept any interference received, including interference that may cause
undesired operation.

04-16002-01-en, December 2014 Plain English and Script


19
Reference

The Reference part contains conceptual information,


procedures, user interface descriptions and troubleshooting
information. If you want more information, see WebHelp or
the other Building Operation Reference Guides.
3 Script Programming Language
Overview

Topics
Script Programming Language
Program Status and Configuration Information
Tasks
3 Script Programming Language Overview
3.1 Script Programming Language

3.1 Script Programming Language


The Script programming language is derived from the Plain English programming
language in Continuum. Script programming consists of a set of instructions that
tells the server to take some type of specific action to control a building. For
example, you can tell the server to take the following actions:
• OPEN THE DAMPER
• CLOSE THE VALVE
Each instruction in Script is a complete text-command description. Program
instructions are listed in the order in which the controller must perform them.
Program statements are written with Script words, known as keywords, that are
arranged in a predefined structure. Each keyword has its own keyword syntax.
According to the rules of that syntax, certain parameters and values are allowed or
not allowed to follow a keyword.

3.1.1 Script Programs


You can store your Script programs like a common document and include them
later in other projects for use in your control system. You can also write programs
that perform very complex control system decisions, such as controlling lighting,
boilers, and air handling units at multiple sites.
Programs or other applications may indirectly set or monitor a piece of equipment
through its controlling program. It is best practice to only control an output with a
single program.
The capability to control a piece of equipment eliminates the possibility of a conflict
occurring between the instructions in two different programs. For example, a
program that locks and unlocks a door prevents the likelihood of an accidental door
locking and unlocking.

3.1.2 Script Functions


A function is a routine designed to carry out an often repeated task or series of
tasks. Your Script function then becomes a subroutine that can be called whenever
that particular action needs to be performed.

3.1.3 Types of Script Programs and Functions


There are two overall types of Script programs and functions. One type is used in an
Enterprise Server or Automation Server, while the other type is used in a b3 Bacnet
device.

Table: Script Program and Function Types


Script Type Device Type

Script Program Enterprise Server, Automation Server

Script Function Enterprise Server, Automation Server

04-16002-01-en, December 2014 Plain English and Script


25
3 Script Programming Language Overview
3.1 Script Programming Language

Continued
Script Type Device Type

b3 Script Program b3 Bacnet device

b3 Script Function b3 Bacnet device

Plain English and Script 04-16002-01-en, December 2014


26
3 Script Programming Language Overview
3.2 Program Status and Configuration Information

3.2 Program Status and Configuration


Information
Like Plain English, Script provides you with status and configuration information
about your programs. In Script, there are new ways for you to display this
information:
• Task: Identifies the particular run queue or task (typically one of the 5 System
Tasks) where the program executes. The default is Task 3.
• Execution precedence: specifies the priority this program holds against other
applications in the same task
• Restart: when set to True, starts executing the program from the beginning

04-16002-01-en, December 2014 Plain English and Script


27
3 Script Programming Language Overview
3.3 Tasks

3.3 Tasks
Function block and Script programs must be connected to tasks in order to run.
You access Tasks from the Properties dialog box.
The task is a property of the object that defines the program cycles.
When you create a new function block or Script program, Task 3 is the default. This
means that one program cycle executes in 1000 ms.

Figure: Tasks
The way you schedule programs to execute in Script differs from how you schedule
them to execute in Continuum. For more information, see section 4.1 “Script and
Plain English Program Differences ” on page 31.

Table: Task Intervals


Task Interval

Task 1 0.1 seconds

Task 2 0.5 seconds

Task 3 1 seconds

Task 4 5 seconds

Task 5 10 seconds

Plain English and Script 04-16002-01-en, December 2014


28
4 Program Language
Differences

Topics
Script and Plain English Program Differences
Declaring a Binding Variable
Declaring a User Function
Configuring BACnet Priority Level Access
Configuring Delays in Plain English Programs
Using System Constants
4 Program Language Differences
4.1 Script and Plain English Program Differences

4.1 Script and Plain English Program


Differences
There are a number of differences between Script and Plain English programs.

4.1.1 Binding Variables


You must declare a binding variable for each object property the Script program
needs to access. This differs from Plain English where property names or path
names are used instead. For more information, see section 4.2 “Declaring a Binding
Variable” on page 35.
Binding variables access property values external to the owning program or
function. Binding variables may also access properties of the owning program itself.
For example, instead of directly using TS (Total Seconds) in the program, you may
create an input variable and bind it to the program’s TS property. This works equally
well.
The declaration syntax is as follows:
<variable_type><qualifier><variable_name>

Table: Binding Variable Qualifiers


Qualifier Description

Input Reads values from object properties.

Output Writes values to object properties.

Public Used by other applications to read from or


write to a program variable.

4.1.2 User Function Declarations


You can declare user functions in Script as you can in Plain English. The process of
declaring user functions differs in Script since you must declare a variable of the
type Function for each user function that a program or function calls. For more
information, see section 4.3 “Declaring a User Function” on page 36.

Note
• You can use nested function calls in Script.

The declaration syntax is as follows:


Function <function_name>

04-16002-01-en, December 2014 Plain English and Script


31
4 Program Language Differences
4.1 Script and Plain English Program Differences

4.1.3 Array Element Access


Like Plain English, program local variable arrays are supported in Script. However,
only b3 array elements are supported for Building Operation v1.0, through binding.
A binding variable is required to access values of b3 array elements from a b3
program or function.

Figure: b3 Array Element Access Example

4.1.4 BACnet Priority Level Access


In Plain English, you must explicitly specify the priority level of a BACnet
commandable object when you use the WriteProperty or Relinquish function.
Otherwise, the default priority level is assumed.
‘Set the Priority Level 5 of AnalogValue 1 to 100
WriteProperty (bCX1\b3_1\AnalogValue 1, 100, 5)
‘Relinquish the value of AnalogValue1 at priority level 5
Relinquish (bCX1\b3_1\AnalogValue1, 5)
‘Get the present value of Analog_Value1
‘That is the first non-null value in the ‘priority level array
‘ReadProperty (bCX_1\b3_1\Analog_Value_1)
In Script, you cannot use the full path name of an object directly. For more
information, see section 4.4 “Configuring BACnet Priority Level Access ” on page
37.

4.1.5 New Wait Keyword


Wait is a new keyword that directs the Script program to pause at the Wait
statement for the specified number of seconds. (Delay is the alias of the Wait
keyword). For more information, see section 4.5 “Configuring Delays in Plain English
Programs” on page 39.
Plain English does not have a Wait or Delay keyword. Instead, Plain English uses
elapsed time keywords, such as TS, TM, TH, and TD to program delays. For
example, you can use the TS progam property to check whether enough time has
passed while on a given line. The program may continue to execute various
statements all along, unlike Building Operation, where the program is actually
paused until the time elapses.

Plain English and Script 04-16002-01-en, December 2014


32
4 Program Language Differences
4.1 Script and Plain English Program Differences

The elapsed time keyword method continues to work in Script. The Wait keyword is
not required. Wait is more efficient, however, since it provides a simpler syntax than
that of the elapsed time keywords for both the AS and ES.
The Wait syntax is as follows:
Wait <numeric_expression>

Note
• Wait and Delay are applicable only to standard Script programs and not to b3
Script programs.

4.1.6 System Constants


Like Plain English, simple system constants are available in Script. These include
such constants as True, False, On, Off, Monday, and January.
In addition, Intellisense™ and autocompletion support are available for Script
system constants. Intellisense is an autocompletion tool. Building Operation uses
Intellisense to store a collection of keywords, function names, and constants for use
in Script programming. For more information, see section 4.6 “Using System
Constants” on page 41.

4.1.7 System Variables


Like Plain English, system variables, such as Date, Hour, Month, and Year are
available in Script. In a b3 BACnet device, system variables are actual objects- as
they are in Plain English.
In an Automation Server or Enterprise Server, system variables are not objects.
Instead, they are keywords used in Script that behave like system variables.

4.1.8 Scheduled Program Execution


You schedule programs to execute differently in Script than you do in Continuum.

Table: Program Execution Schedule Differences


Continuum Building Operation

One scanner Several simultaneous running tasks

Firing order Execution precedence (the user still has


control of the program execution order –
within one task)

Last-In/First-Out (LIFO) Default: Task 3, settable order of execution,


with preset default (100)

04-16002-01-en, December 2014 Plain English and Script


33
4 Program Language Differences
4.1 Script and Plain English Program Differences

Continuum Building Operation

4.1.9 Script Editor Features


The Script Editor is the text programming tool that you use to create your Script
programs. The Script Editor opens when you create or edit a Script program in
WorkStation in Building Operation.
The Script Editor includes many features to assist in the development of your Script
programs and functions:
• Simultaneous multi-program and function editing
• A color-coded text editor ( For more information, see section 5.2 “Script Editor
Color-Coded Program Elements ” on page 46.)
• Intellisense asssistance and auto-completion
• An integrated compiler
• An integrated property editor
• Context-sensitive online help
• A customizable library ( For more information, see section 5.3 “Script Editor
Code Library ” on page 47.)
• A clipboard pane to store copied and cut program items
• Text find and replace in multiple active documents
• Text file import and export
• Plain English code import and export from Continuum libraries ( For more
information, see section 5.4 “Plain English Code Import and Export in Script ”
on page 48.)

Plain English and Script 04-16002-01-en, December 2014


34
4 Program Language Differences
4.2 Declaring a Binding Variable

4.2 Declaring a Binding Variable


You must declare a binding variable for each object property the Script program
needs to access. This differs from Plain English where property names or path
names are used instead.
For more information, see section 4.1 “Script and Plain English Program
Differences ” on page 31.

To declare a binding variable


1. In WorkStation, in the List View, select a Script program.
2. Right-click and click Edit.
3. In the Script Editor, declare a binding variable for each object property the
Script program needs to access.

4. In the Plain English IDE Editor, use property names or path names instead.

04-16002-01-en, December 2014 Plain English and Script


35
4 Program Language Differences
4.3 Declaring a User Function

4.3 Declaring a User Function


You can declare a user function in Script as you can in Plain English. The process of
declaring user functions differs in Script since you must declare a variable of the
type Function for each user function that a program or function calls.
For more information, see section 4.1 “Script and Plain English Program
Differences ” on page 31.

To declare a user function


1. In WorkStation, in the List View, select a Script program.
2. Right-click and click Edit.
3. In the Script Editor, declare a variable of the type Function for each user
function that a program or function calls.
4. Call a user function by binding the function variable to the actual function
object.
5. Then, use its name followed by any arguments to be passed in parentheses.

6. In Plain English programs, you must enter a path to the function object (or just
the name if the function is in the same location as the program).

Plain English and Script 04-16002-01-en, December 2014


36
4 Program Language Differences
4.4 Configuring BACnet Priority Level Access

4.4 Configuring BACnet Priority Level


Access
In Script, you cannot use the full path name of an object directly when configuring
BACnet priority level access. Instead, you must declare a program binding variable
and bind it to a specific priority level property.
For more information, see section 4.1 “Script and Plain English Program
Differences ” on page 31.

To configure BACnet priority level access


1. In WorkStation, in the List View, select a Script program.
2. Right-click and click Edit.
3. In the Script Editor, do not use the full path name of an object directly.
4. Declare a binding variable in the program and bind it to a specific priority level
property (1 through 16) of a commandable object.
5. Then, use the variable name to set the priority level value or relinquish the
value without having to specify the priority level itself in the statement. (See the
AS program example that follows.)

Note
• The ReadProperty and WriteProperty keywords are available in
Script, but the priority level argument is no longer needed in the
statement. It is assumed based on the binding information.

6. For b3 programs in Building Operation, you must create a binding variable and
bind it to the present value of the commandable object (that is, not a specific
priority level as in the AS Script).
7. Then, use ReadProperty, WriteProperty or Relinquish.
Continued on next page

04-16002-01-en, December 2014 Plain English and Script


37
4 Program Language Differences
4.4 Configuring BACnet Priority Level Access

8. Ensure that you use the binding variable name instead of the full path name of
the object. Then, specify the priority level as needed. (See the b3 program
example that follows.)

Plain English and Script 04-16002-01-en, December 2014


38
4 Program Language Differences
4.5 Configuring Delays in Plain English Programs

4.5 Configuring Delays in Plain English


Programs
You use the Wait keyword to direct the Script program to pause at the Wait
statement for the specified number of seconds. In Plain English, you use the TS
property to check whether enough time has passed while on a given line.
For more information, see section 4.1 “Script and Plain English Program
Differences ” on page 31.

To configure delays in Script and Plain English


1. In WorkStation, in the List View, select a Script program.
2. Right-click and click Edit.
3. In the Script Editor, use Wait and Delay to direct the Script program to pause
for the specified number of seconds.

Continued on next page

04-16002-01-en, December 2014 Plain English and Script


39
4 Program Language Differences
4.5 Configuring Delays in Plain English Programs

4. In the Plain English IDE Editor, use the TS property to check whether enough
time has passed while on a given line.

Plain English and Script 04-16002-01-en, December 2014


40
4 Program Language Differences
4.6 Using System Constants

4.6 Using System Constants


You can use system constants, such as True, False, On, and Off in both your Script
and Plain English programs.
For more information, see section 4.1 “Script and Plain English Program
Differences ” on page 31.

To use system constants


1. In WorkStation, in the List View of a server, select the Script program or
function you want to open.
2. Right-click and select Edit.
3. In the Script Editor, start typing and use autocompletion to fill in predictive text
for your system constant text. For more information, see the Using Script
Auto-Completion topic on WebHelp.

4. Type the rest of the statement. Here, you enter the word 'then' to finish the If
statement.
Continued on next page

04-16002-01-en, December 2014 Plain English and Script


41
4 Program Language Differences
4.6 Using System Constants

5. In Plain English, use the IDE Editor to select the system constant you want to
add to your program.

Plain English and Script 04-16002-01-en, December 2014


42
5 Script Editor Overview

Topics
Script Editor Similarities to Plain English IDE Editor
Script Editor Color-Coded Program Elements
Script Editor Code Library
Plain English Code Import and Export in Script
5 Script Editor Overview
5.1 Script Editor Similarities to Plain English IDE Editor

5.1 Script Editor Similarities to Plain English


IDE Editor
Script Editor is designed to have similarities to the existing IDE Editor in Plain
English, such as the position and function of the toolbars and the use of the Text
Editor pane.

Figure: Script Editor

Table: Script Editor


Number Description

Toolbars
Use the toolbars to perform a variety of
functions, including opening, closing, saving,
printing, importing, and exporting Script
programs.

Text Editor pane


Use this pane to create and edit your Script
programs and functions. You can open more
than one program at the same time. Only
one of those programs is the active or
current text editor pane, however.

04-16002-01-en, December 2014 Plain English and Script


45
5 Script Editor Overview
5.2 Script Editor Color-Coded Program Elements

5.2 Script Editor Color-Coded Program


Elements
Each Script program element is displayed in a different color to differentiate it from
other program elements.

Figure: Program Elements

Table: Program Elements and Default Colors


Program Element Default Color

Text Black

Keyword Blue

Function Dodger Blue

Value Maroon

String Red

Number Navy

Operator Teal

Comment Green

Plain English and Script 04-16002-01-en, December 2014


46
5 Script Editor Overview
5.3 Script Editor Code Library

5.3 Script Editor Code Library


Use the Script Editor Code Library and its system-provided programs, functions,
and sample import files to help solve common problems.

Figure: Script Editor code library

Table: Script Editor Code Library


Component Description

Programs Folder Contains a series of system-provided Script


programs to assist in solving common
problems. You can use these items as-is or
as samples when developing your own
Script programs.

Sample Import Files Folder Contains a group of system-provided import


files. You can use these items as-is or as
samples when developing your own Script
programs.

04-16002-01-en, December 2014 Plain English and Script


47
5 Script Editor Overview
5.4 Plain English Code Import and Export in Script

5.4 Plain English Code Import and Export in


Script
Use the Script Editor to import (see below) and export Plain English code from
Continuum libraries to Script.

Figure: Import Plain English dialog box

Plain English and Script 04-16002-01-en, December 2014


48
Schneider Electric | Buildings Division
www.schneider-electric.com/buildings

© 2014 Schneider Electric. All rights reserved.

04-16002-01-en
December 2014

Вам также может понравиться