0% found this document useful (0 votes)
20 views

SYS600_Programming Language SCIL

The document is a manual for MicroSCADA X SYS600 version 10.5, detailing the SCIL programming language. It includes sections on programming environment, data types, objects, variables, and expressions, providing comprehensive guidance for users. Issued by Hitachi Energy in February 2023, it serves as a technical reference for application engineering and programming in SCIL.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

SYS600_Programming Language SCIL

The document is a manual for MicroSCADA X SYS600 version 10.5, detailing the SCIL programming language. It includes sections on programming environment, data types, objects, variables, and expressions, providing comprehensive guidance for users. Issued by Hitachi Energy in February 2023, it serves as a technical reference for application engineering and programming in SCIL.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 380

MicroSCADA X SYS600 10.

5
Programming Language SCIL
Document ID: 1MRK 511 664-UEN
Issued: February 2023
Revision: A
Product version: 10.5

© 2023 Hitachi Energy. All rights reserved.


1MRK 511 664-UEN Rev. A Table of contents

Table of contents

Section 1 Copyrights....................................................................................................21

Section 2 About this manual....................................................................................... 23


2.1 Use of symbols....................................................................................................................23
2.2 Intended audience...............................................................................................................23
2.3 Related documents............................................................................................................. 23
2.4 Document conventions........................................................................................................23
2.5 Document revisions.............................................................................................................24

Section 3 Introduction..................................................................................................25
3.1 Presentation of SCIL........................................................................................................... 25
3.1.1 What is SCIL..................................................................................................................... 25
3.1.2 Application engineering.....................................................................................................25
3.1.3 What can be done with SCIL.............................................................................................26
3.2 SCIL programs.................................................................................................................... 27
3.2.1 Composition...................................................................................................................... 27
3.2.2 Occurrence .......................................................................................................................28
3.2.3 Activation of SCIL programs..............................................................................................28
3.2.4 Execution modes...............................................................................................................28
3.2.5 Example............................................................................................................................ 28
3.3 SCIL statements..................................................................................................................29
3.3.1 Components......................................................................................................................29
3.3.2 Statement format...............................................................................................................29
3.4 Organization of this manual.................................................................................................30

Section 4 Programming in SCIL.................................................................................. 31


4.1 SCIL programming environment......................................................................................... 31
4.1.1 General..............................................................................................................................31
4.1.2 SCIL program editor.......................................................................................................... 31
4.1.3 Picture programs............................................................................................................... 31
4.1.4 Window definitions............................................................................................................ 32
4.1.5 Methods.............................................................................................................................33
4.1.6 Command procedures.......................................................................................................33
4.1.7 Data objects...................................................................................................................... 34
4.1.8 Time channels................................................................................................................... 35
4.1.9 Using SCIL in external applications...................................................................................36
4.1.10 SCIL test tool.....................................................................................................................37
4.2 SCIL programming rules..................................................................................................... 37
4.2.1 Program structure..............................................................................................................37
4.2.2 Examples...........................................................................................................................37
4.2.3 SCIL characters.................................................................................................................38
4.2.4 SCIL names.......................................................................................................................39

MicroSCADA X SYS600 10.5 1


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

Section 5 Data types.....................................................................................................41


5.1 General................................................................................................................................41
5.1.1 Data types......................................................................................................................... 41
5.1.2 Reliability of data...............................................................................................................41
5.2 Integer................................................................................................................................. 41
5.2.1 Description........................................................................................................................ 41
5.2.2 Example............................................................................................................................ 42
5.3 Real..................................................................................................................................... 42
5.3.1 Description........................................................................................................................ 42
5.3.2 Example............................................................................................................................ 42
5.4 Boolean............................................................................................................................... 43
5.4.1 Description........................................................................................................................ 43
5.4.2 Examples...........................................................................................................................43
5.5 Time.....................................................................................................................................43
5.6 Text......................................................................................................................................44
5.6.1 Description........................................................................................................................ 44
5.6.2 Examples...........................................................................................................................44
5.7 Bit string.............................................................................................................................. 44
5.7.1 Description........................................................................................................................ 44
5.7.2 Example............................................................................................................................ 44
5.8 Byte string .......................................................................................................................... 45
5.8.1 Description........................................................................................................................ 45
5.9 Vector.................................................................................................................................. 45
5.9.1 Description........................................................................................................................ 45
5.9.2 Vector aggregate...............................................................................................................45
5.9.3 Example............................................................................................................................ 45
5.10 List.......................................................................................................................................46
5.10.1 Description........................................................................................................................ 46
5.10.2 List aggregate....................................................................................................................46
5.10.3 Example............................................................................................................................ 46
5.11 Accessing components of structured data.......................................................................... 46

Section 6 Objects and files.......................................................................................... 49


6.1 General................................................................................................................................49
6.1.1 Object categories.............................................................................................................. 49
6.1.2 Attributes and methods..................................................................................................... 50
6.1.3 Handling objects in SCIL...................................................................................................50
6.2 System objects.................................................................................................................... 50
6.2.1 General..............................................................................................................................50
6.2.1.1 Overview...................................................................................................................... 50
6.2.1.2 System object notation.................................................................................................50
6.2.2 Base system objects (B)....................................................................................................51
6.2.2.1 Description................................................................................................................... 51
6.2.2.2 Some attributes............................................................................................................ 52
6.2.2.3 Examples..................................................................................................................... 52
6.2.3 Communication system objects.........................................................................................52

2 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

6.2.3.1 Description................................................................................................................... 52
6.2.3.2 Some attributes............................................................................................................ 52
6.2.3.3 Examples..................................................................................................................... 53
6.3 Application objects.............................................................................................................. 53
6.3.1 General..............................................................................................................................53
6.3.1.1 Object types................................................................................................................. 53
6.3.1.2 Application object notation........................................................................................... 54
6.3.2 Process objects (P)........................................................................................................... 55
6.3.2.1 Description................................................................................................................... 55
6.3.2.2 Some process object attributes....................................................................................55
6.3.2.3 Groups and indices...................................................................................................... 56
6.3.2.4 Examples..................................................................................................................... 56
6.3.3 Event handling objects (H)................................................................................................ 56
6.3.3.1 Description................................................................................................................... 56
6.3.3.2 Some event handling attributes....................................................................................57
6.3.4 Scales (X)..........................................................................................................................57
6.3.4.1 Description................................................................................................................... 57
6.3.4.2 Some scale attributes...................................................................................................57
6.3.5 Data objects (D)................................................................................................................ 57
6.3.5.1 Description................................................................................................................... 57
6.3.5.2 Some data object attributes......................................................................................... 58
6.3.5.3 Examples..................................................................................................................... 58
6.3.6 Command procedures (C).................................................................................................58
6.3.6.1 Description................................................................................................................... 58
6.3.6.2 Some command procedure attributes.......................................................................... 59
6.3.6.3 Examples .................................................................................................................... 59
6.3.7 Time channels (T)............................................................................................................. 59
6.3.7.1 Description................................................................................................................... 59
6.3.7.2 Some time channel attributes.......................................................................................60
6.3.8 Event channels (A)............................................................................................................60
6.3.8.1 Description................................................................................................................... 60
6.3.8.2 Some event channel attributes.....................................................................................61
6.3.9 Logging profiles (G)...........................................................................................................61
6.3.9.1 Description................................................................................................................... 61
6.3.10 Event objects (E)............................................................................................................... 61
6.3.10.1 Description................................................................................................................... 61
6.3.10.2 Example....................................................................................................................... 62
6.3.11 Variable objects (V)........................................................................................................... 62
6.3.11.1 Description................................................................................................................... 62
6.3.11.2 Examples..................................................................................................................... 63
6.4 User interface objects..........................................................................................................63
6.4.1 Visual SCIL objects........................................................................................................... 63
6.4.1.1 General........................................................................................................................ 63
6.4.1.2 Dialog systems.............................................................................................................64
6.4.1.3 Attributes and methods................................................................................................ 65
6.4.1.4 Visual SCIL object references......................................................................................65

MicroSCADA X SYS600 10.5 3


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

6.4.1.5 Attribute references......................................................................................................65


6.4.1.6 Method calls................................................................................................................. 66
6.4.2 Pictures............................................................................................................................. 66
6.4.2.1 General........................................................................................................................ 66
6.4.2.2 Picture hierarchy.......................................................................................................... 66
6.4.2.3 Picture Paths................................................................................................................67
6.4.2.4 Picture object attributes................................................................................................67
6.4.2.5 Named program calls................................................................................................... 68
6.4.3 Predefined VS object, window and picture function methods........................................... 68
6.4.3.1 _FLAG_FOR_EXECUTION(name, program [, delay]).................................................69
6.4.3.2 _QUEUE_FOR_EXECUTION(program [, delay])........................................................ 69
6.4.4 Predefined VS object, window and picture function attributes.......................................... 69
6.4.4.1 _ATTRIBUTE_NAMES.................................................................................................69
6.4.4.2 _CHILD_OBJECTS......................................................................................................70
6.4.4.3 _COMPILED................................................................................................................ 70
6.4.4.4 _FILE_REVISION........................................................................................................ 70
6.4.4.5 _OBJECT_CLASS....................................................................................................... 70
6.4.4.6 _OBJECT_NAME.........................................................................................................71
6.4.4.7 _OBJECT_PATH.......................................................................................................... 71
6.4.4.8 _SG_GEOMETRY....................................................................................................... 71
6.4.4.9 _SOURCE_FILE_NAME..............................................................................................71
6.4.4.10 _VARIABLE_NAMES................................................................................................... 71
6.5 Files.....................................................................................................................................72
6.5.1 File naming........................................................................................................................72
6.5.2 Text files............................................................................................................................ 73
6.5.3 Binary files.........................................................................................................................73
6.5.4 Keyed files.........................................................................................................................74
6.5.4.1 General........................................................................................................................ 74
6.5.4.2 Implementation.............................................................................................................74
6.5.4.3 Use...............................................................................................................................75
6.6 SCIL databases...................................................................................................................75
6.6.1 General..............................................................................................................................75
6.6.2 Versions.............................................................................................................................76
6.6.3 Access...............................................................................................................................76
6.6.4 Use....................................................................................................................................77

Section 7 Variables....................................................................................................... 79
7.1 General................................................................................................................................79
7.1.1 Variable names..................................................................................................................79
7.1.2 Scope of variables.............................................................................................................79
7.2 Local variables.................................................................................................................... 79
7.3 Global variables...................................................................................................................80
7.3.1 SCIL contexts....................................................................................................................80
7.4 Using variables....................................................................................................................80
7.4.1 Variable assignment.......................................................................................................... 80
7.4.2 Examples...........................................................................................................................81

4 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

7.4.3 Using variables in expressions..........................................................................................81


7.4.4 Examples...........................................................................................................................81
7.4.5 Variable expansion ........................................................................................................... 82
7.4.6 Examples...........................................................................................................................82
7.5 Predefined picture variables................................................................................................82
7.5.1 Examples...........................................................................................................................83

Section 8 Expressions................................................................................................. 85
8.1 General principles............................................................................................................... 85
8.1.1 Use....................................................................................................................................85
8.1.2 Composition...................................................................................................................... 85
8.1.3 Operands...........................................................................................................................85
8.1.4 Operators.......................................................................................................................... 86
8.2 Arithmetical operators......................................................................................................... 86
8.2.1 Use....................................................................................................................................86
8.2.2 Operators.......................................................................................................................... 86
8.2.3 Priority order......................................................................................................................86
8.2.4 Compatibility rules............................................................................................................. 87
8.2.5 Examples...........................................................................................................................89
8.3 Relational operators............................................................................................................ 89
8.3.1 Use....................................................................................................................................89
8.3.2 Operators.......................................................................................................................... 89
8.3.3 Compatibility rules............................................................................................................. 90
8.3.4 Examples...........................................................................................................................90
8.4 Logical operators.................................................................................................................91
8.4.1 Use....................................................................................................................................91
8.4.2 Operators.......................................................................................................................... 91
8.4.3 Compatibility rules............................................................................................................. 91
8.4.4 Examples...........................................................................................................................91
8.5 SCIL Data Derivation Language (SDDL).............................................................................91
8.5.1 General..............................................................................................................................91
8.5.2 Relation to SCIL language................................................................................................ 92
8.5.3 Context variables...............................................................................................................92
8.5.4 SDDL expression properties............................................................................................. 92
8.5.5 Examples...........................................................................................................................92

Section 9 SCIL statements...........................................................................................95


9.1 General................................................................................................................................95
9.1.1 Types of SCIL statements................................................................................................. 95
9.1.2 Arguments.........................................................................................................................95
9.1.3 Overview........................................................................................................................... 95
9.2 General SCIL statements.................................................................................................... 98
9.2.1 Basic SCIL statements...................................................................................................... 98
9.2.1.1 [@]name[component]* = value.....................................................................................98
9.2.1.2 #ARGUMENT name [,name]*...................................................................................... 98
9.2.1.3 #BLOCK[statement]* #BLOCK_END........................................................................... 99

MicroSCADA X SYS600 10.5 5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

9.2.1.4 #CASE value, [ #WHEN selector statement]*, [ #OTHERWISE statement],


#CASE_END................................................................................................................99
9.2.1.5 #DO program............................................................................................................. 100
9.2.1.6 #ERROR IGNORE, #ERROR CONTINUE, #ERROR STOP, #ERROR EVENT....... 101
9.2.1.7 #ERROR RAISE [status]............................................................................................101
9.2.1.8 #IF condition1 #THEN statement1, [ #ELSE_IF condition2 #THEN statement2]*,
[ #ELSE statement3].................................................................................................. 102
9.2.1.9 #LOCAL name [= value] [,name [= value]]*................................................................102
9.2.1.10 #LOOP [condition], [statement]*, #LOOP_END [max]............................................... 103
9.2.1.11 #LOOP_WITH var = low .. high, [statement]*, #LOOP_END..................................... 104
9.2.1.12 #LOOP_EXIT............................................................................................................. 105
9.2.1.13 #ON event [statement]............................................................................................... 105
9.2.1.14 #ON ERROR [statement]........................................................................................... 106
9.2.1.15 #ON KEY_ERROR [statement]..................................................................................106
9.2.1.16 #PAUSE interval.........................................................................................................106
9.2.1.17 #RETURN [value].......................................................................................................107
9.2.1.18 #SET_TIME time........................................................................................................107
9.2.2 Application and system object commands...................................................................... 108
9.2.2.1 #CREATE object [=attributes].................................................................................... 108
9.2.2.2 #DELETE object.........................................................................................................108
9.2.2.3 #EXEC object [(variable_list)].................................................................................... 109
9.2.2.4 #EXEC_AFTER delay object [(variable_list)]............................................................. 109
9.2.2.5 #GET object............................................................................................................... 110
9.2.2.6 #INIT_QUERY n [condition]........................................................................................110
9.2.2.7 #MODIFY object = attributes...................................................................................... 111
9.2.2.8 #SEARCH n apl type order [start [condition]]............................................................. 112
9.2.2.9 #SET object_attribute [= value].................................................................................. 113
9.2.3 Printout commands..........................................................................................................114
9.2.3.1 #LIST printer object [(variable list)].............................................................................114
9.2.3.2 #PRINT printer picture [(variable list)]........................................................................ 114
9.2.4 Path commands...............................................................................................................115
9.2.4.1 #PATH name [dir [, dir]*], #PATH name + dir [, dir]*, #PATH name - [dir [, dir]*].........115
9.2.4.2 #REP_LIB library [file [, file]*], #REP_LIB library + [file [, file]*], #REP_LIB library
- [file [, file]*]................................................................................................................117
9.2.5 File handling commands..................................................................................................118
9.2.5.1 #CLOSE_FILE n ........................................................................................................118
9.2.5.2 #CREATE_FILE n apl file keylength...........................................................................118
9.2.5.3 #DELETE_FILE apl file.............................................................................................. 119
9.2.5.4 #OPEN_FILE n apl file keylength...............................................................................119
9.2.5.5 #READ n key data1 [data2]........................................................................................119
9.2.5.6 #READ_KEYS n keys [key1 [key2]]........................................................................... 120
9.2.5.7 #READ_NEXT n key data1 [data2]............................................................................ 120
9.2.5.8 #READ_PREV n key data1 [data2]............................................................................121
9.2.5.9 #REMOVE n key........................................................................................................ 121
9.2.5.10 #RENAME_FILE apl old new .................................................................................... 121
9.2.5.11 #WRITE n data1 [data2].............................................................................................122
9.3 Visual SCIL commands..................................................................................................... 122

6 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

9.3.1 Loading, creating and deleting Visual SCIL objects........................................................ 122


9.3.1.1 .CREATE object = type [(attribute = value [,attribute = value]*)]................................ 122
9.3.1.2 .DELETE object..........................................................................................................123
9.3.1.3 .LOAD object = type(, file , name [, attribute = value]*)..............................................124
9.3.2 Handling Visual SCIL attributes and methods.................................................................124
9.3.2.1 [object].method [(argument [,argument]*)]................................................................. 124
9.3.2.2 .MODIFY object = list................................................................................................. 125
9.3.2.3 .SET [object].attribute[component]* = value...............................................................125
9.4 Picture handling commands.............................................................................................. 126
9.4.1 General picture handling commands...............................................................................126
9.4.1.1 !CLOSE...................................................................................................................... 126
9.4.1.2 !FAST_PIC[picture], !FAST_PIC-[picture], !FAST_PIC[-][picture],[-][picture], ........... 126
9.4.1.3 !INT_PIC.................................................................................................................... 127
9.4.1.4 !LAST_PIC................................................................................................................. 127
9.4.1.5 !NEW_PIC picture...................................................................................................... 127
9.4.1.6 !RECALL_PIC............................................................................................................ 128
9.4.1.7 !RESTORE.................................................................................................................128
9.4.1.8 !STORE_PIC..............................................................................................................129
9.4.1.9 !UPDATE interval....................................................................................................... 129
9.4.2 Window handling commands.......................................................................................... 129
9.4.2.1 !ERASE [picture path]window.................................................................................... 130
9.4.2.2 !SHOW [picture path]window [expression].................................................................130
9.4.2.3 !SHOW_BACK [picture path]window [expression]..................................................... 131
9.4.2.4 !WIN_BG_COLOR [picture path]window color...........................................................131
9.4.2.5 !WIN_CREATE [picture path]window......................................................................... 131
9.4.2.6 !WIN_INPUT [picture path]window expression.......................................................... 132
9.4.2.7 !WIN_LEVEL [picture path]window level....................................................................132
9.4.2.8 !WIN_NAME [picture path]window............................................................................. 133
9.4.2.9 !WIN_PIC [picture path]window picture......................................................................133
9.4.2.10 !WIN_POS [picture path]window pos......................................................................... 134
9.4.2.11 !WIN_REP [picture path]window representation........................................................ 134
9.4.3 Input commands..............................................................................................................135
9.4.3.1 !CSR_LEFT, !CSR_RIGHT, !CSR_BOL, !CSR_EOL................................................. 135
9.4.3.2 !ENTER...................................................................................................................... 135
9.4.3.3 !INPUT_POS var........................................................................................................136
9.4.3.4 !INPUT_VAR [picture path]window variable max_length........................................... 136
9.4.3.5 !RUBOUT, !RUBOUT_CUR, !RUBOUT_BOL, !RUBOUT_EOL.................................137
9.4.4 Miscellaneous picture commands................................................................................... 137
9.4.4.1 !SEND_PIC device number........................................................................................137
9.4.4.2 !RESET...................................................................................................................... 138

Section 10 Functions....................................................................................................139
10.1 General..............................................................................................................................139
10.1.1 Function calls.................................................................................................................. 139
10.1.2 Overview......................................................................................................................... 140
10.2 Generic functions.............................................................................................................. 153

MicroSCADA X SYS600 10.5 7


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

10.2.1 CASE(selector, w1, v1 [, wi, vi]* [, "OTHERWISE", vo])....................................................153


10.2.2 CHOOSE(v), CHOOSE(v1, v2, [vi]*)................................................................................ 154
10.2.3 DATA_TYPE(expression)................................................................................................ 154
10.2.4 DUMP(data [,line_length])............................................................................................... 155
10.2.5 ELEMENT_LENGTH(vl)..................................................................................................155
10.2.6 EQUAL(v1, v2, [,status_handling [,case_policy]])........................................................... 155
10.2.7 EVALUATE(expression).................................................................................................. 156
10.2.8 GET_STATUS(data)........................................................................................................157
10.2.9 IF(condition, truevalue, falsevalue)................................................................................. 157
10.2.10 LENGTH (arg)................................................................................................................. 157
10.2.11 SET_STATUS(source, status).........................................................................................158
10.2.12 TYPE_CAST(source, type)............................................................................................. 158
10.3 Arithmetic functions........................................................................................................... 159
10.3.1 ABS(arg)..........................................................................................................................159
10.3.2 ARCCOS(arg)................................................................................................................. 159
10.3.3 ARCSIN(arg)................................................................................................................... 159
10.3.4 ARCTAN(arg).................................................................................................................. 160
10.3.5 COS(arg).........................................................................................................................160
10.3.6 EVEN(arg).......................................................................................................................160
10.3.7 EXP(arg)..........................................................................................................................160
10.3.8 HIGH_PRECISION_ADD(n1 [,n]*).................................................................................. 160
10.3.9 HIGH_PRECISION_DIV(n1, n2)..................................................................................... 161
10.3.10 HIGH_PRECISION_MUL(n1, n2)....................................................................................161
10.3.11 HIGH_PRECISION_SHOW(n [,decimals])......................................................................161
10.3.12 HIGH_PRECISION_SUB(n1, n2)....................................................................................162
10.3.13 HIGH_PRECISION_SUM(v)........................................................................................... 162
10.3.14 LN(arg)............................................................................................................................ 162
10.3.15 MAX(arg1 [,arg]*)............................................................................................................ 162
10.3.16 MIN(arg1 [,arg]*)..............................................................................................................163
10.3.17 ODD(arg).........................................................................................................................164
10.3.18 RANDOM(n1, n2)............................................................................................................ 164
10.3.19 ROUND(arg [,decimals])................................................................................................. 164
10.3.20 SET_RANDOM_SEED(seed)......................................................................................... 165
10.3.21 SIN(arg)...........................................................................................................................165
10.3.22 SQRT(arg).......................................................................................................................165
10.3.23 TRUNC(arg [,decimals]).................................................................................................. 165
10.4 Time functions................................................................................................................... 165
10.4.1 Qualified time.................................................................................................................. 166
10.4.2 CLOCK............................................................................................................................167
10.4.3 DATE[(time [,"FULL"])].................................................................................................... 167
10.4.4 DAY[(time)]...................................................................................................................... 167
10.4.5 DOW[(time)].................................................................................................................... 168
10.4.6 DOY[(time)]..................................................................................................................... 168
10.4.7 HOD[(time)]..................................................................................................................... 168
10.4.8 HOUR[(time)]...................................................................................................................168
10.4.9 HOY[(time)]..................................................................................................................... 168

8 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

10.4.10 HR_CLOCK.....................................................................................................................168
10.4.11 LOCAL_TIME..................................................................................................................169
10.4.12 LOCAL_TIME_ADD(time, s [,ms])...................................................................................169
10.4.13 LOCAL_TIME_INFORMATION[(time)]............................................................................169
10.4.14 LOCAL_TIME_INTERVAL(from, to)................................................................................ 170
10.4.15 LOCAL_TO_SYS_TIME(time).........................................................................................170
10.4.16 LOCAL_TO_UTC_TIME(time)........................................................................................ 170
10.4.17 MINUTE[(time)]............................................................................................................... 171
10.4.18 MONTH[(time)]................................................................................................................ 171
10.4.19 PACK_TIME(year, month, day, hour, minute, second).................................................... 171
10.4.20 SECOND[(time)]..............................................................................................................171
10.4.21 SET_CLOCK(time)..........................................................................................................171
10.4.22 SET_LOCAL_TIME(time)................................................................................................172
10.4.23 SET_SYS_TIME(time).................................................................................................... 172
10.4.24 SET_UTC_TIME(time).................................................................................................... 172
10.4.25 SYS_TIME.......................................................................................................................173
10.4.26 SYS_TIME_ADD(time, s [,ms])....................................................................................... 173
10.4.27 SYS_TIME_INTERVAL(from, to).....................................................................................173
10.4.28 SYS_TO_LOCAL_TIME(time).........................................................................................174
10.4.29 SYS_TO_UTC_TIME(time)............................................................................................. 174
10.4.30 TIME[(time [,"FULL"])]..................................................................................................... 174
10.4.31 TIME_SCAN(string [,resolution [,option1 [,option2]]])..................................................... 175
10.4.32 TIME_ZONE_RULES[(rule)]........................................................................................... 175
10.4.33 TIMEMS[(time [,msecs] [,"FULL"])]................................................................................. 177
10.4.34 TIMES[(time [,"FULL"])]...................................................................................................178
10.4.35 TOD[(time)]......................................................................................................................178
10.4.36 TODMS[(time [,msecs])]..................................................................................................178
10.4.37 TODS[(time)]................................................................................................................... 179
10.4.38 UTC_TIME...................................................................................................................... 179
10.4.39 UTC_TIME_ADD(time, s [,ms])....................................................................................... 179
10.4.40 UTC_TIME_INTERVAL(from, to).................................................................................... 179
10.4.41 UTC_TO_LOCAL_TIME(time)........................................................................................ 180
10.4.42 UTC_TO_SYS_TIME(time)............................................................................................. 180
10.4.43 WEEK(time)]....................................................................................................................180
10.4.44 YEAR(time)].................................................................................................................... 180
10.5 String functions..................................................................................................................181
10.5.1 ASCII(n)...........................................................................................................................181
10.5.2 ASCII_CODE(c).............................................................................................................. 181
10.5.3 BCD_TO_INTEGER(bcd)................................................................................................181
10.5.4 BIN(b)..............................................................................................................................182
10.5.5 BIN_SCAN(string)........................................................................................................... 182
10.5.6 BIT_SCAN(string)............................................................................................................183
10.5.7 CAPITALIZE(text)............................................................................................................183
10.5.8 COLLECT(v, delimiter).................................................................................................... 183
10.5.9 DEC(value [,length [,decimals]])......................................................................................184
10.5.10 DEC_SCAN(string)..........................................................................................................184

MicroSCADA X SYS600 10.5 9


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

10.5.11 EDIT(text, key)................................................................................................................ 184


10.5.12 HEX(n).............................................................................................................................185
10.5.13 HEX_SCAN(string)..........................................................................................................185
10.5.14 INTEGER_TO_BCD(int [,digits])..................................................................................... 185
10.5.15 JOIN(delimiter [, a]*)........................................................................................................186
10.5.16 LOCATE(string1, string2 [,"ALL"])................................................................................... 187
10.5.17 LOWER_CASE(text)....................................................................................................... 187
10.5.18 OCT(n)............................................................................................................................ 187
10.5.19 OCT_SCAN(string)..........................................................................................................188
10.5.20 PACK_STR(source, type [,length [,byte_order]]).............................................................188
10.5.21 PAD([string, ]filler, length)................................................................................................189
10.5.22 REPLACE(text, string, new_string)................................................................................. 189
10.5.23 SEPARATE(text, delimiter)..............................................................................................189
10.5.24 SUBSTR(string, start [,length])........................................................................................190
10.5.25 UNPACK_STR(source [,length [,byte_order]])................................................................ 190
10.5.26 UPPER_CASE(text)........................................................................................................ 191
10.6 Bit functions.......................................................................................................................191
10.6.1 BIT(a, b).......................................................................................................................... 191
10.6.2 BIT_AND(a1, a2).............................................................................................................192
10.6.3 BIT_CLEAR(a [,b]*)......................................................................................................... 192
10.6.4 BIT_COMPL(a)................................................................................................................192
10.6.5 BIT_MASK([b1 [,b]]*).......................................................................................................193
10.6.6 BIT_OR(a1, a2)............................................................................................................... 193
10.6.7 BIT_SET(a [,b]*).............................................................................................................. 193
10.6.8 BIT_STRING(length [,b]*)................................................................................................194
10.6.9 BIT_XOR(a1, a2).............................................................................................................194
10.7 Vector handling functions.................................................................................................. 194
10.7.1 APPEND(v, data).............................................................................................................194
10.7.2 BINARY_SEARCH(v, value)........................................................................................... 195
10.7.3 CLASSIFY(v, n, low, high)............................................................................................... 195
10.7.4 CUMULATE(v).................................................................................................................196
10.7.5 DELETE_ELEMENT(v, index [,index2]).......................................................................... 196
10.7.6 FIND_ELEMENT(v, value [,start_index [,case_policy]]).................................................. 197
10.7.7 HIGH(v), LOW(v).............................................................................................................197
10.7.8 HIGH_INDEX(v), LOW_INDEX(v)...................................................................................197
10.7.9 INSERT_ELEMENT(v, pos, contents).............................................................................198
10.7.10 INTERP(v, x)................................................................................................................... 199
10.7.11 INVERSE(v, n, low, high).................................................................................................199
10.7.12 MEAN(v)..........................................................................................................................200
10.7.13 PICK(v, indices)...............................................................................................................200
10.7.14 REMOVE_DUPLICATES(v [,status_handling [,case_policy]])........................................ 200
10.7.15 REVERSE(v)................................................................................................................... 201
10.7.16 SELECT(source, condition [,wildcards])..........................................................................201
10.7.17 SHUFFLE(n)....................................................................................................................202
10.7.18 SORT(v, [start, [length]])..................................................................................................203
10.7.19 SPREAD(v, indices, new_value)..................................................................................... 203

10 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

10.7.20 SUM(v), SUM_POS(v), SUM_NEG(v)............................................................................ 204


10.7.21 TREND(v, n).................................................................................................................... 204
10.7.22 VECTOR [([element1 [,element]*)].................................................................................. 205
10.8 List handling functions.......................................................................................................205
10.8.1 ATTRIBUTE_EXISTS(list, attribute)................................................................................ 205
10.8.2 DELETE_ATTRIBUTE(list, attribute)...............................................................................205
10.8.3 LIST([attribute = expression, [attribute = expression]*])]................................................. 205
10.8.4 LIST_ATTR(list)...............................................................................................................206
10.8.5 MERGE_ATTRIBUTES(left, right)...................................................................................206
10.9 Functions related to program execution............................................................................ 206
10.9.1 ARGUMENT(n)............................................................................................................... 206
10.9.2 ARGUMENT_COUNT..................................................................................................... 207
10.9.3 ARGUMENTS................................................................................................................. 207
10.9.4 DO(program [,a]*)............................................................................................................207
10.9.5 ERROR_STATE.............................................................................................................. 208
10.9.6 MEMORY_USAGE(keyword, arg)...................................................................................208
10.9.7 OPS_CALL(command [,nowait]), OPS_CALL(command [,option1 [,option2]])...............208
10.9.8 OPS_PROCESS(command [,directory [,option1 [,option2]]])..........................................209
10.9.9 REVISION_COMPATIBILITY(issue [,enable]).................................................................210
10.9.10 STATUS...........................................................................................................................210
10.9.11 VARIABLE_NAMES........................................................................................................ 211
10.10 Functions related to the run-time environment.................................................................. 211
10.10.1 AEP_PROGRAMS(apl)................................................................................................... 211
10.10.2 CONSOLE_OUTPUT(text [,severity [,category]])............................................................211
10.10.3 ENVIRONMENT(variable)...............................................................................................212
10.10.4 IP_PROGRAMS.............................................................................................................. 212
10.10.5 MEMORY_POOL_USAGE(pool).................................................................................... 212
10.10.6 OPS_NAME[([major [,minor]])]........................................................................................ 213
10.10.7 REGISTRY(function, key, value_name).......................................................................... 213
10.10.8 SCIL_HOST.................................................................................................................... 214
10.11 Functions related to the programming environment..........................................................215
10.11.1 COMPILE(source)........................................................................................................... 215
10.11.2 MAX_APPLICATION_NUMBER..................................................................................... 216
10.11.3 MAX_BIT_STRING_LENGTH.........................................................................................216
10.11.4 MAX_BYTE_STRING_LENGTH..................................................................................... 216
10.11.5 MAX_INTEGER...............................................................................................................216
10.11.6 MAX_LINK_NUMBER..................................................................................................... 216
10.11.7 MAX_LIST_ATTRIBUTE_COUNT.................................................................................. 216
10.11.8 MAX_MONITOR_NUMBER............................................................................................ 216
10.11.9 MAX_NODE_NUMBER...................................................................................................217
10.11.10 MAX_OBJECT_NAME_LENGTH................................................................................... 217
10.11.11 MAX_PICTURE_NAME_LENGTH..................................................................................217
10.11.12 MAX_PRINTER_NUMBER............................................................................................. 217
10.11.13 MAX_PROCESS_OBJECT_INDEX................................................................................217
10.11.14 MAX_REPRESENTATION_NAME_LENGTH................................................................. 217
10.11.15 MAX_STATION_NUMBER..............................................................................................217

MicroSCADA X SYS600 10.5 11


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

10.11.16 MAX_STATION_TYPE_NUMBER.................................................................................. 217


10.11.17 MAX_TEXT_LENGTH.....................................................................................................218
10.11.18 MAX_VECTOR_LENGTH............................................................................................... 218
10.11.19 MAX_WINDOW_NAME_LENGTH..................................................................................218
10.11.20 MIN_INTEGER................................................................................................................218
10.11.21 OBJECT_ATTRIBUTE_INFO(apl, type [,subtype [,selection]])....................................... 218
10.11.22 STATUS_CODE(mnemonic)........................................................................................... 220
10.11.23 STATUS_CODE_NAME(code)........................................................................................220
10.11.24 VALIDATE(as, string)...................................................................................................... 221
10.11.25 VALIDATE_OBJECT_ADDRESS(apl, pt, un, oa [,subaddress] [, self]).......................... 221
10.12 Language functions........................................................................................................... 222
10.12.1 Language identifiers........................................................................................................222
10.12.2 The language of the SCIL context...................................................................................224
10.12.3 Text databases................................................................................................................ 225
10.12.4 SET_LANGUAGE(language).......................................................................................... 226
10.12.5 TRANSLATE(text [,language])........................................................................................ 226
10.12.6 TRANSLATION(id [,language])....................................................................................... 226
10.13 Error tracing functions....................................................................................................... 227
10.13.1 SCIL_LINE_NUMBER.....................................................................................................227
10.13.2 TRACE_BEGIN(filename [,append] [,time_tags] [,no_cyclics]).......................................227
10.13.3 TRACE_END...................................................................................................................227
10.13.4 TRACE_PAUSE.............................................................................................................. 228
10.13.5 TRACE_RESUME...........................................................................................................228
10.14 Database functions............................................................................................................228
10.14.1 General object listing functions....................................................................................... 228
10.14.2 APPLICATION_OBJECT_ATTRIBUTES(apl, type, objects, attributes).......................... 228
10.14.3 APPLICATION_OBJECT_COUNT(apl, type [,order [,direction [, start [,condition]]]])..... 229
10.14.4 APPLICATION_OBJECT_EXISTS(apl, type, name [,condition [,verbosity]]).................. 229
10.14.5 APPLICATION_OBJECT_LIST(apl, type [,order [,direction [,start [,condition
[,attributes [,max]]]]])........................................................................................................230
10.14.6 APPLICATION_OBJECT_SELECT(apl, type, names, condition [,verbosity]])................ 233
10.14.7 BASE_SYSTEM_OBJECT_LIST(type [,condition [,attributes [,apl]]])............................. 234
10.14.8 Object maintenance functions......................................................................................... 235
10.14.9 FETCH(apl, type, name [,index]).....................................................................................235
10.14.10 NEXT(n), PREV(n).......................................................................................................... 235
10.14.11 PHYS_FETCH(apl, unit, address [,bit_address])............................................................ 236
10.14.12 Alarm list functions.......................................................................................................... 236
10.14.13 APPLICATION_ALARM_COUNT(apl [, filter]).................................................................236
10.14.14 APPLICATION_ALARM_LIST(apl, lists [,attributes [, order [, filter [, max_count]]]]).......237
10.14.15 Data object functions.......................................................................................................239
10.14.16 DATA_FETCH(apl, name, index1 [,step [,count]]), DATA_FETCH(apl, name, time1,
time2 [,step [,shift]]), DATA_FETCH(apl, name, time1 [,step [,count [,shift]]]),
DATA_FETCH(apl, name, indices)..................................................................................239
10.14.17 DATA_STORE(apl, name, data, index1 [,step]), DATA_STORE(apl, name, data,
indices)............................................................................................................................240
10.14.18 Process object query functions....................................................................................... 241
10.14.19 END_QUERY.................................................................................................................. 241

12 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

10.14.20 PROD_QUERY(n)...........................................................................................................241
10.14.21 History database functions..............................................................................................242
10.14.22 HISTORY_DATABASE_MANAGER("OPEN" [,apl])........................................................242
10.14.23 HISTORY_DATABASE_MANAGER("CLOSE", session)................................................ 243
10.14.24 HISTORY_DATABASE_MANAGER("SET_PERIOD", session, begin [,end]).................243
10.14.25 HISTORY_DATABASE_MANAGER("SET_DIRECTORY", session, directory)...............244
10.14.26 HISTORY_DATABASE_MANAGER("SET_WINDOW", session, begin, end).................244
10.14.27 HISTORY_DATABASE_MANAGER("SET_ORDER", session, order)............................ 245
10.14.28 HISTORY_DATABASE_MANAGER("SET_DIRECTION", session, direction)................ 245
10.14.29 HISTORY_DATABASE_MANAGER("SET_TIMEOUT", session, timeout)..................... 245
10.14.30 HISTORY_DATABASE_MANAGER("SET_CONDITION", session, condition)...............246
10.14.31 HISTORY_DATABASE_MANAGER("SET_ATTRIBUTES", session, attributes).............246
10.14.32 HISTORY_DATABASE_MANAGER("GET_PARAMETERS", session)...........................246
10.14.33 HISTORY_DATABASE_MANAGER("QUERY", session, count [,start]).......................... 247
10.14.34 HISTORY_DATABASE_MANAGER("READ", session, event)........................................248
10.14.35 HISTORY_DATABASE_MANAGER("SET_COMMENT", session, event, comment)..... 248
10.14.36 HISTORY_DATABASE_MANAGER("WRITE", session, data)........................................248
10.14.37 GENERATE_HISTORY_EVENT(LN, IX, MT, DATA).......................................................249
10.14.38 Name hierarchy function................................................................................................. 249
10.14.39 NAME_HIERARCHY(names, order, syntax [, arg4 [, arg5]])...........................................249
10.14.40 Mapping functions........................................................................................................... 253
10.14.41 LOGICAL_MAPPING(otype, number [, apl])................................................................... 253
10.14.42 PHYSICAL_MAPPING(otype, number [, apl]).................................................................254
10.15 Network Topology Functions............................................................................................. 255
10.15.1 NETWORK_TOPOLOGY_MANAGER(subfunction [, arg]* [, apl])................................. 255
10.15.2 NETWORK_TOPOLOGY_MANAGER("SCHEMAS").....................................................255
10.15.3 NETWORK_TOPOLOGY_MANAGER("SCHEMA", schema).........................................255
10.15.4 NETWORK_TOPOLOGY_MANAGER("LEVELS", schema).......................................... 255
10.15.5 NETWORK_TOPOLOGY_MANAGER("SET_LEVELS", schema, levels)...................... 256
10.15.6 NETWORK_TOPOLOGY_MANAGER("MODELS")....................................................... 256
10.15.7 NETWORK_TOPOLOGY_MANAGER("MODEL", model).............................................. 256
10.15.8 NETWORK_TOPOLOGY_MANAGER("START", model),
NETWORK_TOPOLOGY_MANAGER("STOP", model)................................................. 257
10.15.9 NETWORK_TOPOLOGY_MANAGER("VALIDATE", modeldata)................................... 257
10.15.10 NETWORK_TOPOLOGY_MANAGER("IMPORT", modeldata)...................................... 257
10.15.11 NETWORK_TOPOLOGY_MANAGER("EXPORT", model)............................................ 257
10.15.12 NETWORK_TOPOLOGY_MANAGER("DELETE", model).............................................257
10.16 File handling functions.......................................................................................................258
10.16.1 DATA_MANAGER(function [,argument]*)....................................................................... 258
10.16.2 DATA_MANAGER("CREATE", file)................................................................................. 258
10.16.3 DATA_MANAGER("OPEN", file)..................................................................................... 258
10.16.4 DATA_MANAGER("COPY", handle, new_file [, version])............................................... 258
10.16.5 DATA_MANAGER("CLOSE", handle)............................................................................. 259
10.16.6 DATA_MANAGER("LIST_SECTIONS", handle)............................................................. 259
10.16.7 DATA_MANAGER("CREATE_SECTION", handle, section)............................................259
10.16.8 DATA_MANAGER("DELETE_SECTION", handle, section)............................................ 259

MicroSCADA X SYS600 10.5 13


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

10.16.9 DATA_MANAGER("GET", handle, section [,component]*)............................................. 260


10.16.10 DATA_MANAGER("PUT", handle, section, data [,component]*).................................... 260
10.16.11 DATA_MANAGER("DELETE", handle, section, [,component]*)......................................261
10.16.12 DELETE_PARAMETER(file, section [,key]).................................................................... 261
10.16.13 FILE_LOCK_MANAGER(function, file)........................................................................... 261
10.16.14 KEYED_FILE_MANAGER(function, file [,output_file [,key_size] [,version]])...................262
10.16.15 PARSE_FILE_NAME(name [,file]).................................................................................. 263
10.16.16 PATH(name)....................................................................................................................264
10.16.17 PATHS(level)................................................................................................................... 264
10.16.18 READ_BYTES(file [,start [,length]]).................................................................................264
10.16.19 READ_COLUMNS(file, pos, width [,start [,count]])......................................................... 265
10.16.20 READ_PARAMETER(file, section, key [,default])........................................................... 265
10.16.21 READ_TEXT(file [,start [,number]])................................................................................. 266
10.16.22 REP_LIB(name).............................................................................................................. 266
10.16.23 REP_LIBS(level)............................................................................................................. 266
10.16.24 SHADOW_FILE(file_name [,"DELETED"])..................................................................... 267
10.16.25 TEXT_READ(file [,start [,number]).................................................................................. 267
10.16.26 WRITE_BYTES(file, data [,append])............................................................................... 268
10.16.27 WRITE_COLUMNS(file, pos, width, data [,append] [,encoding]).................................... 268
10.16.28 WRITE_PARAMETER(file, section, key, value [, encoding])...........................................268
10.16.29 WRITE_TEXT(file, text [,append] [,encoding])................................................................ 269
10.17 File management functions............................................................................................... 269
10.17.1 Calling syntax..................................................................................................................270
10.17.2 Compatibility....................................................................................................................271
10.17.3 DRIVE_MANAGER......................................................................................................... 271
10.17.4 DRIVE_MANAGER("LIST").............................................................................................271
10.17.5 DRIVE_MANAGER("EXISTS", drive)..............................................................................271
10.17.6 DRIVE_MANAGER("GET_DEFAULT")...........................................................................271
10.17.7 DRIVE_MANAGER("GET_ATTRIBUTES", tag)..............................................................271
10.17.8 DIRECTORY_MANAGER............................................................................................... 272
10.17.9 DIRECTORY_MANAGER("LIST", directory [,filter [,recursion] [,hidden]])...................... 272
10.17.10 DIRECTORY_MANAGER("CREATE", directory [,recursion])......................................... 272
10.17.11 DIRECTORY_MANAGER("DELETE", directory)............................................................ 273
10.17.12 DIRECTORY_MANAGER("DELETE_CONTENTS", directory [,filter [,subdirectories]]). 273
10.17.13 DIRECTORY_MANAGER("EXISTS", directory)..............................................................273
10.17.14 DIRECTORY_MANAGER("COPY", source, target)........................................................ 273
10.17.15 DIRECTORY_MANAGER("COPY_CONTENTS", source, target [,filter
[,subdirectories [,overwrite]]]).......................................................................................... 274
10.17.16 DIRECTORY_MANAGER("MOVE", directory, target).....................................................274
10.17.17 DIRECTORY_MANAGER("RENAME", directory, name)................................................ 274
10.17.18 DIRECTORY_MANAGER("GET_ATTRIBUTES", directory)...........................................275
10.17.19 FILE_MANAGER.............................................................................................................275
10.17.20 FILE_MANAGER("LIST", directory [,filter [,recursion] [, hidden]])...................................275
10.17.21 FILE_MANAGER("DELETE", file)................................................................................... 276
10.17.22 FILE_MANAGER("EXISTS", file).................................................................................... 276
10.17.23 FILE_MANAGER("COPY", source, target [,overwrite])...................................................276

14 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

10.17.24 FILE_MANAGER("MOVE", file, target)........................................................................... 276


10.17.25 FILE_MANAGER("RENAME", file, name).......................................................................276
10.17.26 FILE_MANAGER("GET_ATTRIBUTES", file)................................................................. 277
10.17.27 Auxiliary functions........................................................................................................... 277
10.17.28 FM_APPLICATION_DIRECTORY[(path)]....................................................................... 277
10.17.29 FM_APPLICATION_FILE(path).......................................................................................277
10.17.30 FM_COMBINE(tag1 [,tagi]*, tagn)...................................................................................278
10.17.31 FM_COMBINE_NAME(name, extension)....................................................................... 278
10.17.32 FM_DIRECTORY(path [,check])..................................................................................... 278
10.17.33 FM_DRIVE(name [,check])............................................................................................. 278
10.17.34 FM_EXTRACT(tag, component)..................................................................................... 279
10.17.35 FM_FILE(path [,check])...................................................................................................279
10.17.36 FM_REPRESENT(tag [,option]*).....................................................................................279
10.17.37 FM_SCIL_DIRECTORY(name [,check])......................................................................... 280
10.17.38 FM_SCIL_FILE(name [,option] [,option]).........................................................................280
10.17.39 FM_SCIL_REPRESENT(tag [,case]).............................................................................. 280
10.17.40 FM_SPLIT_NAME(file)....................................................................................................281
10.18 Communication functions.................................................................................................. 281
10.18.1 SPACOM(message)........................................................................................................ 281
10.18.2 TIMEOUT(millisecs)........................................................................................................ 281
10.19 CSV (Comma Separated Value) functions........................................................................ 282
10.19.1 CSV_TO_SCIL(csv, start, field_info [,option])................................................................. 282
10.19.2 SCIL_TO_CSV(data [,option]*)....................................................................................... 283
10.20 DDE client functions.......................................................................................................... 284
10.20.1 DDE_CONNECT(service, topic)......................................................................................285
10.20.2 DDE_DISCONNECT(connection_id).............................................................................. 285
10.20.3 DDE_REQUEST(connection_id, item [,timeout])............................................................ 286
10.20.4 DDE_POKE(connection_id, item, value [,timeout])......................................................... 286
10.20.5 DDE_EXECUTE(connection_id, statement [,timeout])....................................................287
10.21 DDE server functions........................................................................................................ 288
10.21.1 DDE_VECTOR(vector, decimal_separator, list_separator).............................................288
10.21.2 DDE_REAL(real, separator)............................................................................................288
10.22 ODBC functions.................................................................................................................289
10.22.1 SQL_CONNECT(source, user, password)...................................................................... 289
10.22.2 SQL_DISCONNECT(connection_id)...............................................................................290
10.22.3 SQL_EXECUTE(connection_id, SQLstring [,timeout])....................................................291
10.22.4 SQL_FETCH(statement_id)............................................................................................ 291
10.22.5 SQL_FREE_STATEMENT(statement_id)....................................................................... 292
10.22.6 SQL_BEGIN_TRANSACTION(connection_id)................................................................292
10.22.7 SQL_COMMIT(connection_id)........................................................................................ 293
10.22.8 SQL_ROLLBACK(connection_id)................................................................................... 294
10.23 OPC Name Database functions........................................................................................ 294
10.23.1 OPC_NAME_MANAGER(function, apl [,argument]*)......................................................295
10.23.2 OPC_NAME_MANAGER("LIST", apl).............................................................................295
10.23.3 OPC_NAME_MANAGER("PUT", apl, name, definition)..................................................295
10.23.4 OPC_NAME_MANAGER("GET", apl, name)..................................................................295

MicroSCADA X SYS600 10.5 15


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

10.23.5 OPC_NAME_MANAGER("DELETE", apl, name)........................................................... 296


10.24 OPC functions................................................................................................................... 296
10.24.1 OPC_AE_ACKNOWLEDGE(apl, ln, ix, ack_id [, comment [, cookie, active_time]])....... 296
10.24.2 OPC_AE_NAMESPACE(nodenr [, clsid1 [, root]]),
OPC_AE_NAMESPACE(nodename, clsid2 [, root [, user, password]]).......................... 297
10.24.3 OPC_AE_REFRESH(apl, unit)........................................................................................298
10.24.4 OPC_AE_SERVERS(nodenr), OPC_AE_SERVERS(nodename [, user, password]).....298
10.24.5 OPC_AE_VALIDATE(apl, unit)........................................................................................299
10.24.6 OPC_DA_NAMESPACE(nodenr [, clsid1 [, root]]),
OPC_DA_NAMESPACE(nodename, clsid2 [, root [, user, password]]).......................... 300
10.24.7 OPC_DA_REFRESH(apl, unit, group [, wait]).................................................................301
10.24.8 OPC_DA_SERVERS(nodenr), OPC_DA_SERVERS(nodename [, user, password]).... 302
10.25 RTU functions....................................................................................................................303
10.25.1 RTU_ADDR(key).............................................................................................................303
10.25.2 RTU_AINT(i)....................................................................................................................303
10.25.3 RTU_AREAL(r)................................................................................................................304
10.25.4 RTU_ATIME [(t [,msec])]................................................................................................. 304
10.25.5 RTU_BIN(h).....................................................................................................................304
10.25.6 RTU_HEXASC(b)............................................................................................................304
10.25.7 RTU_INT(a).....................................................................................................................304
10.25.8 RTU_KEY(oa)................................................................................................................. 305
10.25.9 RTU_MSEC(atime)......................................................................................................... 305
10.25.10 RTU_OA(type, ba)...........................................................................................................305
10.25.11 RTU_REAL(a)................................................................................................................. 305
10.25.12 RTU_TIME(a).................................................................................................................. 306
10.26 Printout functions...............................................................................................................306
10.26.1 PRINT_TRANSPARENT(data [,log])...............................................................................306
10.26.2 PRINTER_SET................................................................................................................309
10.27 User session functions...................................................................................................... 309
10.27.1 SET_EVENT_LIST_USER_NAME(name)...................................................................... 309
10.27.2 USM_ADDRESS............................................................................................................. 309
10.27.3 USM_AOR_DATA........................................................................................................... 310
10.27.4 USM_AUTHORIZATION_LEVEL(group)........................................................................ 310
10.27.5 USM_AUTHORIZATION_LEVEL_FOR_OBJECT(group, object_name, object_index)..310
10.27.6 USM_AUTHORIZATIONS............................................................................................... 311
10.27.7 USM_CHANGE_PASSWORD(old_password, new_password)......................................311
10.27.8 USM_IS_NEW_APPLICATION....................................................................................... 311
10.27.9 USM_LOGIN(name, password).......................................................................................311
10.27.10 USM_LOGOUT............................................................................................................... 312
10.27.11 USM_PASSWORD_CHANGE........................................................................................ 312
10.27.12 USM_PASSWORD_POLICY.......................................................................................... 313
10.27.13 USM_RELEASE_USER_SESSIONS............................................................................. 313
10.27.14 USM_SELECT_ROLE(role)............................................................................................ 314
10.27.15 USM_SESSION_ATTRIBUTES...................................................................................... 314
10.27.16 USM_SESSION_ID.........................................................................................................314
10.27.17 USM_SESSIONS............................................................................................................ 315

16 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

10.27.18 USM_USER_LANGUAGE.............................................................................................. 315


10.27.19 USM_USER_NAME........................................................................................................ 315
10.27.20 USM_USER_ROLE.........................................................................................................315
10.27.21 USM_USER_ROLES...................................................................................................... 315
10.27.22 USM_USER_SESSION_DATA....................................................................................... 315
10.28 Miscellaneous functions.................................................................................................... 316
10.28.1 ADD_INTERLOCKED(object, index, amount).................................................................316
10.28.2 AUDIO_ALARM(alarm_class, on_or_off)........................................................................317
10.28.3 SCALE(v, scale_object [,direction])................................................................................. 317
10.28.4 UNLOCK_PICTURE(picture).......................................................................................... 317

Section 11 Graphics primitives................................................................................... 319


11.1 Introduction........................................................................................................................319
11.1.1 Graphics contexts............................................................................................................319
11.1.2 Graphics canvas..............................................................................................................319
11.1.3 Miscellaneous..................................................................................................................319
11.2 Full graphics SCIL commands.......................................................................................... 320
11.2.1 Drawing graphical elements............................................................................................ 320
11.2.1.1 .ARC [[scope,]n :] x,y, r, a1,a2 [,FILL]........................................................................ 320
11.2.1.2 .BOX [[scope,]n :] x,y, width, height [,FILL]................................................................ 321
11.2.1.3 .CIRCLE [[scope,]n :] x,y, r [,FILL]..............................................................................321
11.2.1.4 .ELLIPSE [[scope,]n :] x,y, a,b [,FILL]........................................................................ 321
11.2.1.5 .IMAGE x, y, w, h, filename, tag_1[, tag_2[, tag_3[, tag_4] ] ].................................... 322
11.2.1.6 .LINE [[scope,]n :] x1,y1, x2,y2.................................................................................. 322
11.2.1.7 .POINT [[scope,]n :] x,y, [RELATIVE]......................................................................... 323
11.2.1.8 .POLYLINE [[scope,]n :] x,y [,RELATIVE] [,FILL]....................................................... 323
11.2.1.9 .TEXT [[scope,]n :] x,y, text [,FILL] [,align]................................................................. 323
11.3 Graphics contexts..............................................................................................................324
11.3.1 General............................................................................................................................324
11.3.1.1 Scope of graphics contexts........................................................................................ 324
11.3.1.2 Default settings.......................................................................................................... 325
11.3.2 Defining graphics contexts.............................................................................................. 325
11.3.2.1 .GC [[scope,]n [=[scope,]m]]:[[component = value]...[,component = value]].............. 325
11.3.3 Components of graphics contexts................................................................................... 326
11.3.3.1 AM ARC_MODE.............................................................................................. 326
11.3.3.2 BG BACKGROUND......................................................................................... 327
11.3.3.3 CS CAP_STYLE.............................................................................................. 327
11.3.3.4 DL DASH_LIST................................................................................................ 327
11.3.3.5 DO DASH_OFFSET.........................................................................................328
11.3.3.6 FT FONT.......................................................................................................... 328
11.3.3.7 FG FOREGROUND......................................................................................... 329
11.3.3.8 FU FUNCTION.................................................................................................329
11.3.3.9 JS JOIN_STYLE.............................................................................................. 329
11.3.3.10 LS LINE_STYLE.............................................................................................. 330
11.3.3.11 LW LINE_WIDTH............................................................................................. 330
11.3.3.12 NA NAME.........................................................................................................330

MicroSCADA X SYS600 10.5 17


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Table of contents 1MRK 511 664-UEN Rev. A

11.3.4 Colors and fonts.............................................................................................................. 330


11.3.4.1 Colors.........................................................................................................................330
11.3.4.2 .COLOR [scope,] number : color [,SHARED] ............................................................331
11.3.4.3 COLOR([scope,]number)........................................................................................... 331
11.3.4.4 Fonts.......................................................................................................................... 332
11.3.4.5 .FONT [scope,] number : font.....................................................................................332
11.3.4.6 FONT([scope,] number)............................................................................................. 332
11.3.5 Reading graphics contexts..............................................................................................333
11.3.5.1 GC([scope,]n).............................................................................................................333
11.3.5.2 COLOR_IN([scope,] n)...............................................................................................334
11.3.5.3 FONT_IN([scope,] n)..................................................................................................334
11.4 Graphics canvas................................................................................................................334
11.4.1 General description......................................................................................................... 334
11.4.2 Selecting canvas............................................................................................................. 334
11.4.3 .CANVAS object.............................................................................................................. 334
11.4.4 .CANVAS ROOT............................................................................................................. 335
11.4.5 .CANVAS PARENT......................................................................................................... 335
11.4.6 .CANVAS CURRENT...................................................................................................... 335
11.4.7 .COORDINATE_SYSTEM coordinate_system................................................................335
11.4.8 The SCIL coordinate system........................................................................................... 335
11.4.9 The Visual SCIL coordinate system................................................................................ 336
11.4.10 Changing Scaling Factor.................................................................................................336
11.4.11 .SCALING [s]...................................................................................................................336
11.4.12 Mouse input.....................................................................................................................337
11.4.13 .MOUSE x, y [, button [, buttons [, RELATIVE] ] ]............................................................337
11.4.14 .MOUSE ON [,MOTION], .MOUSE OFF......................................................................... 337
11.4.15 .MOUSE DISCARD......................................................................................................... 338
11.5 Miscellaneous graphical commands................................................................................. 338
11.5.1 Storing and restoring selections......................................................................................338
11.5.1.1 .PUSH, .POP..............................................................................................................338
11.5.2 Display handling commands........................................................................................... 339
11.5.2.1 .FLUSH...................................................................................................................... 339
11.5.2.2 .PEND ON, .PEND OFF.............................................................................................339

Section 12 SCIL programming guide..........................................................................341


12.1 Picture handling.................................................................................................................341
12.2 Visual SCIL object handling.............................................................................................. 342
12.3 Program execution............................................................................................................ 343
12.3.1 Error Handling in Pictures............................................................................................... 345

Section 13 SCIL editor..................................................................................................347


13.1 General..............................................................................................................................347
13.2 Menus................................................................................................................................347
13.3 Toolbar...............................................................................................................................350
13.4 Opening and closing the SCIL editor.................................................................................351
13.4.1 Opening the SCIL editor..................................................................................................351
13.4.2 Opening files................................................................................................................... 351

18 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Table of contents

13.4.3 Creating files................................................................................................................... 351


13.4.4 Saving files......................................................................................................................351
13.4.5 Undo operation................................................................................................................352
13.4.6 Closing the SCIL editor................................................................................................... 352
13.5 Typing and editing programs and texts............................................................................. 352
13.5.1 Typing..............................................................................................................................352
13.5.2 Scroll feature................................................................................................................... 352
13.5.3 Selecting text for editing..................................................................................................352
13.5.4 Copying........................................................................................................................... 353
13.5.5 Moving text......................................................................................................................353
13.5.6 Deleting........................................................................................................................... 353
13.5.7 Commenting....................................................................................................................353
13.5.8 Indenting..........................................................................................................................354
13.5.9 Finding text......................................................................................................................354
13.5.10 Replacing text..................................................................................................................355
13.5.11 Finding blocks................................................................................................................. 355
13.5.12 Finding a line ..................................................................................................................356
13.5.13 Importing and exporting text............................................................................................356
13.5.14 Undoing and redoing operations .................................................................................... 356
13.5.15 Insert SCIL commands, functions and objects................................................................ 357
13.5.16 Syntax checking of a SCIL program................................................................................357

Section 14 SCIL compiler.............................................................................................359


14.1 General..............................................................................................................................359
14.2 Performance improvement................................................................................................ 359
14.3 Impact on SCIL programs................................................................................................. 359
14.3.1 Programs that do not compile......................................................................................... 360
14.3.2 Programs that generate run-time error............................................................................360
14.3.3 Programs that produce wrong results............................................................................. 361
14.3.4 Recommendations.......................................................................................................... 361

Appendix A ODBC ERROR CODES.............................................................................. 363


1.1 About this appendix...........................................................................................................363
1.2 General..............................................................................................................................363
1.3 List of codes...................................................................................................................... 363

Appendix B PARAMETER FILES................................................................................... 365


1.1 About this appendix...........................................................................................................365
1.2 General..............................................................................................................................365
1.3 BNF description.................................................................................................................365

Index.....................................................................................................................................367

MicroSCADA X SYS600 10.5 19


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
20
1MRK 511 664-UEN Rev. A Section 1
Copyrights

Section 1 Copyrights GUID-03127CB5-2F5A-4099-A5DC-20E63835472E v6

The information in this document is subject to change without notice and should not be construed as
a commitment by Hitachi Energy. Hitachi Energy assumes no responsibility for any errors that may
appear in this document.

In no event shall Hitachi Energy be liable for direct, indirect, special, incidental or consequential
damages of any nature or kind arising from the use of this document, nor shall Hitachi Energy be
liable for incidental or consequential damages arising from the use of any software or hardware
described in this document.

This document and parts thereof must not be reproduced or copied without written permission from
Hitachi Energy, and the contents thereof must not be imparted to a third party nor used for any
unauthorized purpose.

The software or hardware described in this document is furnished under a license and may be used,
copied, or disclosed only in accordance with the terms of such license.

© 2023 Hitachi Energy. All rights reserved.

Trademarks

ABB is a registered trademark of ABB Asea Brown Boveri Ltd. Manufactured by/for a Hitachi Energy
company. All other brand or product names mentioned in this document may be trademarks or
registered trademarks of their respective holders.

Guarantee

Please inquire about the terms of guarantee from your nearest Hitachi Energy representative.

Third Party Copyright Notices

List of Third Party Copyright notices are documented in "3rd party licenses.txt" and other locations
mentioned in the file in SYS600 and DMS600 installation packages.

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit.
(https://www.openssl.org/). This product includes cryptographic software written by Eric Young
([email protected]). This product includes software written by Tim Hudson ([email protected]).

This product includes software developed by Computing Services at Carnegie Mellon University
(http://www.cmu.edu/computing/).

This product includes software developed by vbAccelerator (/index.html).

MicroSCADA X SYS600 10.5 21


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
22
1MRK 511 664-UEN Rev. A Section 2
About this manual

Section 2 About this manual GUID-29B43831-2382-41BD-B665-E5B62F34C57D v1

2.1 Use of symbols GUID-02FB8F3C-62BE-46B6-89AF-AC2C6BE30B1B v1

This publication includes warning, caution and information symbols where appropriate to point out
safety-related or other important information. It also includes tips to point out useful hints to the
reader. The corresponding symbols should be interpreted as follows:

Warning icon indicates the presence of a hazard which could result in personal injury.

Caution icon indicates important information or a warning related to the concept


discussed in the text. It might indicate the presence of a hazard, which could result in
corruption of software or damage to equipment/property.

Information icon alerts the reader to relevant factors and conditions.

Tip icon indicates advice on, for example, how to design a project or how to use a certain
function.

Although warning hazards are related to personal injury, and caution hazards are associated with
equipment or property damage, it should be understood that operation of damaged equipment could,
under certain operational conditions, result in degraded process performance leading to personal
injury or death. Therefore, comply fully with all warnings and caution notices.

2.2 Intended audience GUID-CDE76480-29CD-4F86-95E4-C88FEDE1FFBA v1

This manual is intended for installation personnel, administrators and skilled operators to support
installation of the software.

2.3 Related documents GUID-BFB1CA72-D670-4075-9265-ECD008FBC9BD v5

Name of the manual Document ID


SYS600 10.5 Application Objects 1MRK 511 632-UEN
SYS600 10.5 System Configuration 1MRK 511 666-UEN
SYS600 10.5 Status Codes 1MRK 511 665-UEN
SYS600 10.5 System Objects 1MRK 511 667-UEN
SYS600 10.5 Visual SCIL Objects 1MRK 511 669-UEN

2.4 Document conventions GUID-DB57AA79-9E98-40C2-B3AB-5F46F4E9925B v2

The following conventions are used for the presentation of material:

MicroSCADA X SYS600 10.5 23


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 2 1MRK 511 664-UEN Rev. A
About this manual

• The words in names of screen elements (for example, the title in the title bar of a dialog, the
label for a field of a dialog box) are initially capitalized.
• Capital letters are used for file names.
• Capital letters are used for the name of a keyboard key if it is labeled on the keyboard. For
example, press the CTRL key. Although the Enter and Shift keys are not labeled they are written
in capital letters, for example, press ENTER.
• Lowercase letters are used for the name of a keyboard key that is not labeled on the keyboard.
For example, the space bar, comma key and so on.
• Press CTRL+C indicates that the user must hold down the CTRL key while pressing the C key
(in this case, to copy a selected object).
• Press ALT E C indicates that the user presses and releases each key in sequence (in this case,
to copy a selected object).
• The names of push and toggle buttons are boldfaced. For example, click OK.
• The names of menus and menu items are boldfaced. For example, the File menu.
• The following convention is used for menu operations: Menu Name/Menu Item/
Cascaded Menu Item. For example: select File/Open/New Project.
• The Start menu name always refers to the Start menu on the Windows Task Bar.
• System prompts/messages and user responses/input are shown in the Courier font. For
example, if the user enters a value that is out of range, the following message is displayed:
Entered value is not valid.
The user may be told to enter the string MIF349 in a field. The string is shown as follows in the
procedure: MIF349
• Variables are shown using lowercase letters: sequence name

2.5 Document revisions GUID-AD292EC8-364C-48D3-895A-86D0D7A970B6 v5

Revision Version number Date History


A 10.5 17.02.2023 New document for
SYS600 10.5

24 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 3
Introduction

Section 3 Introduction GUID-A998FF79-380B-4D15-9C49-9791754ED3D7 v1

This section introduces the SCIL programming language, the SYS600 application engineering, and
the SCIL program structure.

3.1 Presentation of SCIL GUID-10EB602D-A193-44E0-930D-C746A7414E6F v1

3.1.1 What is SCIL GUID-236EEF86-4F41-462A-B151-1DFDC7F3FE4C v1

SCIL, Supervisory Control Implementation Language, is a high level programming language


especially designed for the application engineering of the supervisory control system SYS600. All
SYS600 application programs, as well as most of the system configuration programs are built in
SCIL.

3.1.2 Application engineering GUID-2B28BADD-A07A-4896-A6C8-7C19CD130D7D v2

In SYS600, application engineering means the composition of customized, process specific


supervisory control software. The result is an application software package regarding control
functions, communicating process devices, user interface, level of information, etc., that is adapted
for the user's needs. A base system contains one or more application software packages named
applications. Application engineering comprises of the following:

• Functional design, that is, the programming and definition of the SCADA functions, as well as
other supervisory control and calculation functions.
• User interface design.

Functional design involves the definition of databases (a database = a set of connected data stored
in a structured form) and the creation of SCIL programs. Each application has a process database for
handling process supervision and a report database for data storage, calculations, automatic
activation, etc. The databases are composed of objects named application objects.

The user interface design involves the composition of pictures and dialogs, see Figure 1. Pictures are
dynamic illustrations containing a static background, dynamic windows and user activated function
keys. Dialogs are independent windows that may contain a wide range of user interface items, such
as menus, buttons, images, notebooks and pictures. Pictures and dialogs represent two different
user interface design methods. The design and programming of dialogs and dialog systems is named
Visual SCIL.

These two portions of an application are interwoven with each others, and the user interface design
and the functional design generally occur in parallel.

Application engineering is simplified by using the standard application software library, LIB 500,
which requires a minimum of object definitions and SCIL programming. However, SCIL is found in all
SYS600 applications, even in those that are built with LIB 500, because the LIB 500 standard
application software is built with SCIL.

MicroSCADA X SYS600 10.5 25


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 3 1MRK 511 664-UEN Rev. A
Introduction

GUID-6C4BA3FE-638D-42AA-8585-38CF5600DF7C V1 EN-US

Figure 1: A SYS600 screen view showing three dialogs, one containing a picture.
The application engineering using LIB 500 is discussed in the LIB 500 User's Guide. The user
interface design is described in the Visual SCIL User Interface Design and the Picture Editing
manuals.

3.1.3 What can be done with SCIL GUID-D82F3BD2-CA54-4AD7-B71A-C9BC07B2147D v2

By means of SCIL, the user can control the entire SYS600 system, not only the features related to
the application, but also features related to the system configuration and communication. With SCIL,
for instance the following actions are possible (as shown in Figure 2):

• Program the user interface portion of the application, for example, define the dynamic changes
in pictures and dialogs, and program operator activated function keys and buttons.
• Design various forms of process control, such as manual control, sequential control, time
control, event control, etc.
• Define routines for calculation and updating in databases to be started automatically or
manually.
• Design reports for presentation on monitor screens or for paper printout.
• Configure, supervise and handle system components, for example printers and monitors.
• Build process simulations.
• Exchange data with other SYS600 applications and with external (non-SYS600) applications (for
example, office applications).

Learning SCIL requires no previous knowledge of conventional programming.

26 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 3
Introduction

GUID-67A7C918-AF21-4AF7-A7F2-551063D2445A V1 EN-US

Figure 2: Features controlling the SCIL program execution and features controlled by SCIL

3.2 SCIL programs GUID-07868051-EDEB-45CD-ABB5-BC789C19BBFD v1

3.2.1 Composition GUID-865F452C-8B64-4C76-9544-00F379BDA938 v2

A SCIL program is composed of one or more textual statements. Each statement represents an
instruction to the system about a task to be carried out, for example, the presentation of a picture or
the assignment of a variable value. Consecutive statements mean a sequence of instructions, which
are carried out in the prescribed order.

MicroSCADA X SYS600 10.5 27


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 3 1MRK 511 664-UEN Rev. A
Introduction

3.2.2 Occurrence GUID-B588C3EE-363B-43A9-80A1-B8487396D0DE v1

SCIL programs appear in pictures, in command procedures (objects for automatic or SCIL activated
program execution), and in the dialogs and dialog items (Visual SCIL objects). For more information,
see Section 4.

3.2.3 Activation of SCIL programs GUID-DF802A5E-F990-410D-BA18-A2774644B1EA v1

The SCIL programs can be started manually or automatically, for example:

• The function keys in pictures and the buttons in dialogs contain SCIL programs that are started
manually by the operator.
• The pictures and dialogs can contain programs, which are started automatically when a picture
is entered or exited, periodically with a certain time interval, and on the occurrence of a process
event.
• The command procedures can start automatically by real or simulated process events, by time,
from other SCIL programs, etc.
• SCIL programs can be started by a SCIL command or a program call.

3.2.4 Execution modes GUID-2658ACF3-9683-4D5B-A5A3-DEC57757CB89 v1

SCIL programs may run in one of two execution modes:

• In Normal Mode, the entire functionality of SCIL language is available for the programmer.
• In Read-only Mode, commands and functions that have side-effects are not allowed. Any
operation that alters the data of the base system or devices connected to it is regarded as a
side-effect.

The Read-only Mode is used in following cases:

• A classic monitor runs in read-only mode before a successful login and after a logout.
• An unauthenticated OPC client runs as read-only if the system hardening is configured
accordingly.
• An external SCIL-API program runs as read-only if the system hardening is configured
accordingly.
• Search and query conditions (filters) of database SCIL functions are evaluated in read-only
mode.
• SCIL Data Derivation Language (SDDL) expressions are typically evaluated in read-only mode.

3.2.5 Example GUID-A7124BA0-28C6-45DE-9170-1AB3B7286115 v1

The example in Figure 3 gives an insight into what a SCIL program can look like. The program could
be placed under a function key in a picture, which means that it is executed each time the key is
pressed. The purpose of the program is to bring a new picture, called a MENU, on the screen
provided that a password is given correctly (999).

28 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 3
Introduction

GUID-220CFBE3-D7D0-45A5-A360-D40F591C171B V1 EN-US

Figure 3: A SCIL program for the input and control of a password

3.3 SCIL statements GUID-4AED9BDC-495E-4486-99B6-711493C613CC v1

3.3.1 Components GUID-55839BCB-71B3-4CCD-9A4B-2DAC9FABA813 v2

Each line in the program example in Figure 3 is a SCIL statement. A statement can also be
continued on several lines. A SCIL statement may consist of the following main components:

• Commands. These are words with a pre-declared meaning constituting orders to the system
about steps to be taken. In the example in Figure 3, each program line starts with a command.
• Objects. An object is a broad concept which may correspond to physical parts of the system or
the process, database items, user interface objects, or abstract functions specific to the SYS600
system.
• Variables. Variables are facilities for the temporary storage and use of changing data. In the
example in Figure 3, WORD is a variable.
• Function calls. SCIL has a large number of predefined functions for various purposes.
• Expressions. Expressions are formulas, which can contain constants, object notations,
variables, function calls and operators (for example, +, - , /, *).

3.3.2 Statement format GUID-D9740D79-5E40-4EA6-8B6A-98B8C81ACBA8 v1

The components above can be combined into statements according to one of the following three
formats:

command {arguments} (1)


variable = expression (2)
name.program {arguments} (3)

Type (1) (described in Section 8, Section 10 and Section 11) implies that an action is performed on or
by means of the arguments. The arguments may be object references, expressions, variables,
names, etc. Some commands do not require any arguments, they are as such complete statements.
In some cases, the arguments may contain statements. The command names start with a ! (picture
commands), # (control commands) or . (Visual SCIL, full graphics and Motif commands).

Type (2) (described in Section 6) implies that a variable gets a value.

Type (3) (described in Section 5) is a program call which starts a program execution in a picture,
dialog or dialog item.

MicroSCADA X SYS600 10.5 29


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 3 1MRK 511 664-UEN Rev. A
Introduction

3.4 Organization of this manual GUID-7E1503CC-2AEC-4B99-A32C-D16881B69279 v1

This manual is composed of 14 sections, which have the following contents:

Section 3 This introduction.


Section 4 Describes the tools for SCIL programming, the rules concerning the structure of SCIL
programs, SCIL characters and naming SCIL elements.
Section 5 Describes the different SCIL data types allowed for data and expressions included in SCIL
programs.
Section 6 Describes briefly the different object types, system objects, application objects, user interface
objects and files, and how they are handled in SCIL.
Section 7 Describes the use of variables in SCIL: how to assign values to variables and how to use
them, predefined picture variables.
Section 8 Describes the construction of SCIL expressions.
Section 9 Describes the SCIL commands: picture handling commands, control commands and Visual
SCIL commands.
Section 10 Describes the predefined SCIL functions which can be included in expressions.
Section 11 Describes the lowest level of the full graphics handling (generally not needed for ordinary
application engineering).
Section 12 Provides a programmer's quick guide.
Section 13 Describes the SCIL Program Editor.
Section 14 Describes the SCIL Compiler.
Section 15 contains a list of ODBC error codes.
Section 16 describes the contents of parameter files.

A list of subject indices can be found at the end of this manual.

30 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 4
Programming in SCIL

Section 4 Programming in SCIL GUID-D7116466-EB83-4B8D-938D-8CEE8424C2C4 v1

This section describes the SCIL programming environment and the rules for programming in SCIL:

Section 4.1 SCIL programming environment:: the SYS600 objects where SCIL programs and
expressions are found, the programming tools in brief, the use of SCIL expressions in
external applications via DDE.
Section 4.2 SCIL programming rules: The structure of the SCIL programs, SCIL characters, SCIL names.

4.1 SCIL programming environment GUID-A7287FFA-FF05-462C-8E5C-3C3173EE6A9C v1

4.1.1 General GUID-FC3701E8-15F6-428D-8DBD-8AABD28AB60C v1

SCIL programs appear in:

• Pictures
• Visual SCIL objects
• Command procedures
• Programs communicating with the base system via OPC Data Access Server

In addition, SCIL expressions appear in windows, data objects and time channels. SCIL expressions
can also be entered in external Windows based applications and evaluated through DDE (Dynamic
Data Exchange).

SCIL programming is carried out online, while the SYS600 system is running. Various application
programming tools, such as Dialog Editor, Picture Editor and Object Navigator, use the SCIL
Program Editor for entering SCIL programs. The SCIL Program Editor is able to check the syntax of
the program. To test SCIL programs, use the Test Dialog accessed from the Tool Manager.

4.1.2 SCIL program editor GUID-80078A64-18A2-41AB-B0F5-0E084C63759D v1

SCIL programs are written in the SCIL Program Editor, which is accessed from tool pictures and from
the Tool Manager. The SCIL Program Editor is opened from the Picture Editor, the Dialog Editor and
the Command Procedure object definition tool.

The SCIL Program Editor is described in Section 13.

4.1.3 Picture programs GUID-51561DE3-2855-4FEE-97C7-12D612DB1FBF v2

A dynamic picture is composed of a static background, windows, function keys, SCIL-programs and
picture functions. Windows are the dynamic parts of the picture. They can present data fields,
graphs, figures or complete pictures. The picture functions are complete pictures which are
integrated in the total picture. Picture functions and window pictures (pictures shown in a window) are
commonly called "part pictures" or "sub-pictures", while the total picture is called "main picture".

Pictures are built and programmed in the Picture Editor where they can be named freely. The
pictures and picture editing are described in the Picture Editing manual.

A picture may contain the following types of picture programs (none of them is obligatory):

• A draw program executed every time the picture is loaded on screen, immediately after the
background has been produced on screen but before the start program is executed. It can, for

MicroSCADA X SYS600 10.5 31


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 4 1MRK 511 664-UEN Rev. A
Programming in SCIL

example, be used for adding context specific graphics to the background by means of graphics
commands.
• A start program executed after the draw program. The start program is used for basic
definitions such as initial variable values, update interval, and program blocks.
• An update program, which is executed repeatedly at intervals defined by a SCIL command
(the !UPDATE command, see Section 8) as long as the picture is displayed on screen.
• An exit program, which is executed each time the picture is closed (even at exit by clicking
three times in the upper left corner of the picture).
• Function key programs executed at each click on the function keys to which they belong.
• Named programs executed by program calls. A SCIL picture may contain any number of
named SCIL programs. The named programs are started by program calls as described in
Section 6.4. The named program names may be up to 63 characters long. Each picture may
contain a named program with a predefined name, ERROR_HANDLER, where the programmer
can define the error handling to be used in the picture. The ERROR_HANDLER program is
described in Section 12.

Besides these programs, the picture contains a background program which is created automatically
by the picture editor. The background program contains graphics commands. Normally, it should not
be edited manually.

4.1.4 Window definitions GUID-E7686019-6389-4C93-8422-062327E40717 v1

The window definitions, see Figure 4, may contain expressions which specify what is to be shown in
the windows. The expression of a window is evaluated each time the window is shown. The window
definitions may also contain conditions for the display of different representations. Both the
expressions and the conditions follow the rules of SCIL.

GUID-F6253A25-E934-4E23-AAEB-D94CA7DEFD53 V1 EN-US

Figure 4: An example of a window definition

32 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 4
Programming in SCIL

4.1.5 Methods GUID-E643C115-3735-44B3-A66C-DAA023FAE147 v1

Each Visual SCIL object can have a number of methods, most of which are SCIL programs. (There
are also predefined methods which are programmed in C, but these methods are not editable).

A dialog or a dialog item may contain the following SCIL programs (methods):

• Methods started at the creation and deletion of the object.


• Cyclically activated methods.
• Event activated methods started by a process event or an event activated by SCIL (through
event objects, see Section 6.3).
• Action methods started on an operator intervention (for example, a click on a button).
• A help method started when help is requested.
• An error handling method.

In addition, each Visual SCIL object may have an arbitrary number of user defined methods which
are executed by a method call (see Section 6.4).

The methods of the dialogs and dialog items are programmed in the Dialog Editor. The composition
and programming of dialogs is described in the Visual SCIL User Interface Design manual.

4.1.6 Command procedures GUID-42C40989-EB4A-4D23-BA3B-D2B79DA4A585 v1

A command procedure is an independent SCIL program consisting of up to 2 000 000 lines (see
Figure 5). A command procedure can be activated by a time channel (see below), an event channel
(controller of event-bound activities) or a SCIL program.

Command procedures are described in the Application Objects manual.

MicroSCADA X SYS600 10.5 33


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 4 1MRK 511 664-UEN Rev. A
Programming in SCIL

GUID-BCB506FD-540E-48CC-B8E5-1C56C6CA4BAA V1 EN-US

Figure 5: An example of a command procedure

4.1.7 Data objects GUID-6A9BF07A-DFB2-4788-A7F8-67171460CEAC v1

The data objects (datalog objects) are objects for the registration and storage of data. The object
definition, see Figure 6, contains a SCIL expression which states how the data is to be calculated.

Data objects are described in the Application Objects manual.

34 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 4
Programming in SCIL

GUID-723341A5-E418-4735-9ECF-DCF0C3EF7A91 V1 EN-US

Figure 6: An example of a data object definition

4.1.8 Time channels GUID-DAD8F377-9232-429B-9BC2-05D4EC05A93E v1

The time channels control the execution of time-bound activities. By conditions which are SCIL
expressions, see Figure 7, the initialization times and execution times can be restricted, so that an
initialization or an execution can only occur when the conditions are fulfilled.

Time channels are described in the Application Objects manual.

MicroSCADA X SYS600 10.5 35


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 4 1MRK 511 664-UEN Rev. A
Programming in SCIL

GUID-B5E3E998-8576-4C8D-9713-A1CE420EEF6F V1 EN-US

Figure 7: An example of a time channel definition

4.1.9 Using SCIL in external applications GUID-CD2E626A-F3BA-43CE-AE58-2D14F78F01FC v1

External applications may run SCIL programs and evaluate SCIL expressions using OPC connection
to the base system. The item name space of the SYS600 OPC Data Access server contains
predefined item names SCIL_PROGRAM and SCIL used to execute SCIL. See the OPC Server
manual for details.

In addition, SYS600 applications can be accessed from external Windows applications using the
DDE protocol, so that the SYS600 application works as a DDE server and the other application
works as a DDE client.

The DDE identifiers service, topic and item have the following meanings when accessing a SYS600
application:

Service = MicroSCADA
Topic = SYS600 application number (APL object number, see the System Configuration manual)
Item, data = Item and data depends on the DDE transaction as follows:
REQUEST: item = SCIL expression
Table continues on next page

36 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 4
Programming in SCIL

POKE: item = SCIL object notation


data = SCIL expression
EXECUTE: item = SCIL statement.

The DDE Server function in SYS600 supports the following SCIL data types (see Section 5): integer,
real, text, boolean. There are some SCIL functions that can be used in the composition of the
expressions used via DDE. See the DDE Server Functions in Section 10.

When handling data using DDE Server, occurred SCIL errors are preserved so that the user can
afterwards read the last SCIL status code of each DDE conversation by doing a request transaction
by giving DDE_SCIL_STATUS_CODE as Item value.

Accessing a SYS600 application using the DDE Server requires that the DDE Server has been
enabled in the base-system configuration (the SYS:BDE attribute).

For more information about using DDE, refer to the DDE documentation of the Windows Application
that is currently in use.

4.1.10 SCIL test tool GUID-EC1A48D8-9AB4-4986-9944-67A96E5041EB v1

The Test Dialog accessed from the Tool Manager allows the programmer to enter individual SCIL
statements and expressions, as well as programs. It also provides means for detailed examination of
the SCIL expressions.

4.2 SCIL programming rules GUID-AD0A7315-AED5-408B-BC9E-BC4FD4057669 v1

4.2.1 Program structure GUID-A7CACB7E-4ED6-4E04-8338-494152B4F041 v1

A SCIL program can contain up to 2 000 000 lines, and each line up to 65 535 characters (including
spaces). A SCIL statement comprises one or more lines. A minus sign (-) at the end of a SCIL line,
before a possible comment, indicates that the statement continues on the next line. A line may be
divided anywhere where spaces are allowed, but not within text constants. Empty lines are allowed
anywhere in the programs.

Spaces are allowed anywhere in the program except within numbers, words, names, object notations
and composed symbols. These elements, disregarding operators, must be adjacent to at least one
space at each side. Also the operators DIV and MOD (see Section 8) must be adjacent to spaces.

Upper and lower case letters may be freely intermixed. When the program is executed, lower case
letters are converted into upper case, except for lower case letters within text constants (see Section
5).

Comments can be placed anywhere in the program. They are preceded by a semicolon (;), which
indicates that the rest of the line is a comment. However, if the semicolon is enclosed in quotation
marks (";"), it is regarded as a text (see Section 5).

4.2.2 Examples GUID-D704A218-9BF6-4C8E-9D62-11D7D308B2FC v1

The following two SCIL-programs are functionally equivalent:

Example 1:

T = TEMP:PAI1
#IF T> 90 #THEN #BLOCK
#SET C:PBO2 = 0
#PRINT 2 OVERHEAT

MicroSCADA X SYS600 10.5 37


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 4 1MRK 511 664-UEN Rev. A
Programming in SCIL

#BLOCK_END
#ELSE_IF T < 70 #THEN #SET C:PBO2 = 1

Example 2:

T = TEMP:PAI1 ;READ THE TEMPERATURE


#IF T > 90 #THEN #BLOCK ;IF WARMED OVER 90
#SET C:PBO2 = 0 ;STOP HEATING
#PRINT 2 OVERHEAT ;PRINT OVERHEAT MESSAGE
#BLOCK_END
#ELSE_IF T < 70 #THEN #SET C:PBO2 = 1
;RESTART HEATING IF T < 70

The following statement is divided on two lines. As a text constant cannot be divided it is necessary
to type it as a sum of two texts.

A = "IN THIS EXAMPLE, A LONG TEXT VALUE IS " - ;Comments allowed


+ "ASSIGNED TO VARIABLE A" ;like this

4.2.3 SCIL characters GUID-DBDE9F10-B307-4774-B510-6E13E774D93F v1

SCIL uses Unicode character set to encode text data. All current languages may be written using 2-
byte Unicode characters in numeric range 0 ... 65535. The range also contains a lot of special
purpose 'characters', such as mathematical symbols and many others.

However, the Unicode standard allows for representation of more than 1 million 'characters'. The
characters outside the range 0 ... 65535 are used to write ancient languages and to draw various
additional symbols. These characters occupy 4 bytes and may be embedded in 2-byte character
strings. These 4-byte Unicode characters are allowed in SCIL text strings, but they are counted as 2
characters wherever the length of string is concerned.

Some of the characters and character combinations have a special meaning in SCIL. They symbolize
punctuation marks and operators or have a special meaning in the SCIL Language. These special
symbols and their meanings are listed below. When the symbols are composed of more than one
character, the characters can not be separated by spaces.

Symbol Meaning in SCIL


- minus sign, continuation of program line
+ plus sign
* multiplication
** exponential operator
/ division, separator in paths
\ separator in Visual SCIL object paths
() parentheses, enclose indexing and argument lists
, an enumeration
. decimal point, marks a graphics or Motif command, an attribute or a method
.. index range
" encloses a text
@ global variable assignment
% global variable access
Table continues on next page

38 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 4
Programming in SCIL

Symbol Meaning in SCIL


' variable expansion
# precedes a control command
! precedes a picture command
: follows an object name
; starts a comment
= assignment
== equal to
> greater than
>= greater than or equal to
< less than
<= less than or equal to
<> not equal to
^ an octal number

4.2.4 SCIL names GUID-08A66D6B-2C20-464D-B1C2-6044F9D419AD v1

Most user interface objects (picture and Visual SCIL objects, see Section 6) and application objects
(see Section 6) are identified by logical names (identifiers), which can be chosen freely. Likewise, the
names of variables, named programs, user defined methods, logical library representation files and
directory paths can be named freely.

As a rule, the names may be up to 63 characters long. However, the names of pictures, windows and
logical paths may be only 10 characters long.

Allowed characters are the letters A-Z, all digits and underscore (_). In application object names
periods (.) are allowed as well. As a rule, the first character of a name must be a letter or an
underscore. Application object names may also start with a digit, but this is not recommended.

SCIL supports blanks in Windows directory and file names.

Upper case and lower case letters are not distinct. For example, OBJ_NAME and
Obj_name are the one and the same name.

Examples

Below are some examples on valid and invalid SCIL names:


Valid names:
RELAY
RELAY_STN
RELAY_1234
Invalid names:
4TH_RELAY (starts with a digit, not valid as a name of a picture,
window or variable)
RELÄ (contains a special character)
RELAY_STATION (too long for a window name)

MicroSCADA X SYS600 10.5 39


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
40
1MRK 511 664-UEN Rev. A Section 5
Data types

Section 5 Data types GUID-FCEE8D64-44E7-487F-8B27-6113F427F29A v1

This section describes the SCIL data types: integer, real, boolean, time, text, bit string, byte string,
vector and list.

5.1 General GUID-2915F2EF-9A14-498B-812C-45B8409C93E1 v1

5.1.1 Data types GUID-9C8D73BE-35D9-4965-88D0-7D90CAB2E105 v1

In SCIL, there are six types of simple data (data constituted of single values): integer, real, boolean,
time, text, bit string and byte string.

In addition, there are two types of structured data: the data type vector that represents an ordered
array of data elements, and the data type list that represents an unordered list of attribute names and
attribute values. The components (elements and attributes) of structured data may be of any data
type, for example an element of a vector may be a vector or a list.

Data type none is used in some contexts to denote a missing value.

For generic functions that deal with any type data (for example read the type or status of data,
determine the length of data item or test two data items for equality), see Section 10.2.

5.1.2 Reliability of data GUID-CA2615B5-ED2F-4E63-A2C1-470C704CFC0B v1

In SCIL, each data item has a status code, which expresses the reliability of the data. As a rule,
when an expression is evaluated, it gets the status code of the least reliable operand. Data written
explicitly by the programmer or entered by the user always have OK status. A bad status code may
originate, for example, from a process object value that has been marked as obsolete due to a
communication fault.

The status code of data can be read and written with SCIL functions GET_STATUS and
SET_STATUS (See Section 10.2). The status codes are listed in the Status Codes manual.

5.2 Integer GUID-738B52CC-187E-4CFD-ADF0-0A7C89878D74 v1

5.2.1 Description GUID-2F6B8EE7-A4C9-4B3B-928A-076E37381058 v1

The integer data type denotes positive and negative integer values ranging from ‑2 147 483 648
through to +2 147 483 647. These values may be referred to by symbolic names MIN_INTEGER and
MAX_INTEGER, respectively. Constant integers outside these limits are represented as real
numbers. The most negative integer -2 147 483 648 cannot be written as a constant, it should be
referred to by its symbolic name MIN_INTEGER.

Integer constants can be typed either in decimal or in octal form. In decimal form integers are written
as a sequence of digits 0 ... 9 optionally preceded by a sign. No embedded spaces nor commas or
points are allowed.

Octal constants are written as a sequence of octal digits 0 ... 7 followed by a trailing up arrow (^).

MicroSCADA X SYS600 10.5 41


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 5 1MRK 511 664-UEN Rev. A
Data types

5.2.2 Example GUID-EFA077F5-155E-4E64-B53E-7FEF5F16CFA8 v1

Examples of some valid integer constants:


GUID-92CB5949-F387-4D8B-89BE-4E22DA06337A v1
256

000123

-5

777^

The last one represents integer value 511(decimal).

5.3 Real GUID-226B4605-8F31-41B6-B495-8B941F91D53A v1

5.3.1 Description GUID-CA46442F-622E-4C8B-9F11-D85E36B3BC65 v1

The real data type expresses, with limited precision, the continuous quantities within a large range of
values. The accuracy of real numbers is limited to about seven significant decimal digits.

Table 1 shows the value ranges of the real numbers. All numbers between the smallest negative and
the smallest positive numbers yield the value 0. The ranges are determined by the processor of the
base system computer.

Table 1: The value ranges of real values.

Smallest negative value -5.88 E(-39)


Largest negative value -3.41 E38
Smallest positive value 5.88 E(-39)
Largest positive value 3.41 E38

Real numbers are written using digits, decimal points and signs. No exponents are allowed. At least
one digit must precede the decimal point. Numbers without any decimal point are considered as
integer values if they fall within the value range of integer values. Outside that range, they are
considered real values.

Internally, real numbers are represented by a 32-bit floating point format.

Because the internal representation of a real number is generally not exact, care should be taken
when comparing two real values for equality. For example, it is not safe to rely on such facts as
1.7/5.0 == 0.34. However, the following holds: every whole number in the range -16 777 216 ..
+16 777 216 has an exact representation as a real number. Therefore, for example the relation
170.0/5.0 == 34.0 is safe, no rounding errors can occur.

For various arithmetic functions that operate on real data, see Section 10.3.

If better accuracy of floating point arithmetics is required by an application, special purpose SCIL
functions operating on 64-bit floating point numbers may be used. See Section 10.3 for functions
whose name is prefixed by HIGH_PRECISION_.

5.3.2 Example GUID-A5B4B931-D512-46B6-BC06-9BAC2A9BF34A v1

Examples of some valid real numbers:

42 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 5
Data types

GUID-711AA093-334F-40D9-9FEE-A3CE2C1E0397 v1
0.0

1234.56789

2147483648

5.

0.000000000000000000001

The second number contains 9 significant digits and thus cannot be stored without some loss of
precision. The third number is a real constant because it falls outside the range of integers.

5.4 Boolean GUID-CC4F2143-A7A1-4A23-8AC1-FAE28F327A06 v1

5.4.1 Description GUID-12A3C761-72DC-4EB4-84E3-8A8D5C312531 v1

Boolean data may take two values: FALSE and TRUE.

Boolean values result from comparisons (relational operators) and various other tests (such as
functions EVEN and ODD). They are frequently used in conditional statements and expressions.

Internally, FALSE is represented by the value 0 and TRUE by the value 1. Hence, the relation
between the two boolean values is:
GUID-EA487460-5B5B-4B0C-8E97-89249B2D8BA6 v1
FALSE < TRUE.

Integer 0 and 1 are returned when boolean SCIL expressions are used via DDE (Dynamic Data
Exchange).

5.4.2 Examples GUID-566D72DB-F77A-4BC5-94E4-5EA11BD564F2 v1

Some examples of boolean expressions and their values:

Expression Boolean value


4 + 1 == 5 TRUE
"NIGHT" == "DAY" FALSE
ODD(5) TRUE

5.5 Time GUID-D3E86997-BC07-4514-8E37-513494EF4948 v2

Time data is obtained by reading the system clock and various time stamp attributes of objects.

A time value is internally represented as a 32-bit unsigned integer counting seconds since the
beginning of 1978.

For various functions that operate on time data, for example give a textual representation (for
example, calendar time) of time data, see Section 10.4.

MicroSCADA X SYS600 10.5 43


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 5 1MRK 511 664-UEN Rev. A
Data types

5.6 Text GUID-39494F26-6047-4B73-A5A7-13D2CD4A427C v1

5.6.1 Description GUID-F50BD0A5-8D03-4C39-87BF-B3EBFD4FFA14 v2

Text data is composed of 0 to 65 535 characters. Unicode character set encoding is used. Symbolic
name MAX_TEXT_LENGTH may be used to refer to the text length limit of the current
implementation (65 535 today). Strictly speaking, the limit 65 535 refers to the maximum length of the
text string as 2-byte words. The Unicode standard defines also characters that occupy 4 bytes of
memory. Fortunately, they are very seldom used. Hence, for practical purposes it is safe to equate
the length of text string and the number of characters it contains.

Text values may be compared and concatenated (added using + operator), see Section 8. For
various predefined functions that operate on text data, see Section 10.5.

Text constants are enclosed in quotation marks ("). A single quote (') or double quote (") contained in
the text must be typed as two single quotes or two double quotes respectively.

5.6.2 Examples GUID-F2543963-736B-41BF-B6C4-21DBC6B95FAA v1

Two text constants:


GUID-529089C0-8321-4856-AC23-796F4E813B6E v1
"ABC_123!!?%"
GUID-B928012B-C996-43D2-BA2B-BE190C4C5A75 v1
"This is a text constant containing one "" and one ' ' "

5.7 Bit string GUID-C3AF21B4-3BA1-4432-AB36-3834525C1869 v1

5.7.1 Description GUID-D0FC0923-AAFD-4218-9289-9E707EEDF522 v1

A bit string is a sequence of bits stored in consecutive memory bytes. The length of a bit string (the
number of bits in the string) may be anything from 0 to 65 535. The bits in a string are numbered
from 1 to 65 535 counting from left to right. Symbolic name MAX_BIT_STRING_LENGTH may be
used to refer to the bit string length limit of the current implementation (65 535 today).

Bit strings appear as values of process object attributes and functions. They can be created using
functions BIT_SCAN and BIT_STRING and represented in a textual format by means of BIN function
(See Section 10).

Bit strings may be compared and concatenated (’added’ using + operator), see Section 8. For
functions that manipulate bit strings on bit level, see Section 10.

Internally, a bit string is represented as a two-byte length field followed by as many data bytes as
needed to store the bits.

5.7.2 Example GUID-ABC08F02-91AB-4E5F-9378-3400B468A074 v1

An example of a bit string of eight bits converted to a text by means of the BIN function:
GUID-EB5D2608-E4E3-4CD0-A238-4859A381720A v1
BIN(%BITSTRING) == "01010101"

44 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 5
Data types

5.8 Byte string GUID-16579ED7-7912-4AED-BF78-AF7ABB89EE0D v1

5.8.1 Description GUID-B2947D9D-7CB4-4A05-B840-5F5EEB8784C6 v1

A byte string is a sequence of consecutive 8-bit bytes with no structure and no predefined semantics.
The length of a byte string may be anything between 0 and 8 388 600 bytes. Symbolic name
MAX_BYTE_STRING_LENGTH may be used to refer to the byte string length limit of the current
implementation (8 388 600 today).

Byte strings can be created by the PACK_STR function. By using the function UNPACK_STR, a byte
string can be interpreted as an array of numerical values. Byte strings may be used to exchange
binary data between SYS600 and other applications. They are used within the SCIL programming
environment, for example, to store compiled SCIL programs.

Byte strings may be compared and concatenated (added using + operator), see Section 8.

Internally, a byte string is represented as a four-byte length field followed by as many data bytes as
needed to store the bytes.

5.9 Vector GUID-5F38802F-87DD-4DCB-A05F-C7A3397E2182 v1

5.9.1 Description GUID-0195774B-D176-49D6-8112-D2E7D8C118D6 v1

A vector is an ordered array of data. A data item as a component of a vector is called an element. A
vector may contain up to 2 000 000 elements numbered from 1 to 2 000 000. Symbolic name
MAX_VECTOR_LENGTH may be used to refer to the vector length limit of the current
implementation (2 000 000 today).

The elements of a vector may be of any data type. Different elements may even be of different data
types.

A vector may be expanded by simply assigning values to its elements or by function


INSERT_ELEMENT. Elements may be removed by function DELETE_ELEMENT. For these and
various other functions that operate on vector data, see Section 10.7.

For accessing elements of a vector, see Section 5.11.

5.9.2 Vector aggregate GUID-D912C938-B1C9-4F98-8382-706243DF98C1 v1

A vector can be written as a vector aggregate in the following format:


GUID-F6FBC31F-153B-4D68-9500-F114EA355477 v1
VECTOR[([element [,element]*])]

or
GUID-6B33B818-0451-4F28-8DC7-04E4B30724FB v1
(element1, element2 [,element]*)

The key word VECTOR is followed by the vector element values separated by commas and enclosed
in parentheses. The elements may be given as expressions of any data type. The key word VECTOR
may be omitted if two or more elements are listed. An empty vector may be written as VECTOR or
VECTOR().

5.9.3 Example GUID-14423A7A-9EBB-4BD3-A132-AC8F077BD757 v1

An example of a vector aggregate of five elements:

MicroSCADA X SYS600 10.5 45


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 5 1MRK 511 664-UEN Rev. A
Data types

GUID-C7EE9037-2ADE-4426-979F-4385383178AA v1
(-23, "NAME", 0.000001, CLOCK, A + B)

5.10 List GUID-7E07266C-B270-4FAA-86ED-7F16AAFF2D85 v1

5.10.1 Description GUID-3F662588-7EC3-45E2-886D-EA224A5A599E v1

A list is an unordered collection of data components. The components are called attributes which
have a name and a value. Hence, data type list is a list of attribute name/value pairs. A list can hold
up to 2 000 000 attributes. Symbolic name MAX_LIST_ATTRIBUTE_COUNT may be used to refer to
the attribute count limit of the current implementation (2 000 000 today).

Attribute names are freely chosen, up to 63 character long identifiers.

The attributes of a list may be of any data type. Different attributes may have different types.

New attributes to a list may be added by function MERGE_ATTRIBUTES. Function


DELETE_ATTRIBUTE may be used to remove attributes. For these and other functions that operate
on list data, see Section 10.8.

For accessing attributes of a list, see Section 5.11.

5.10.2 List aggregate GUID-A2439808-ABDD-4B75-9961-7711F1E0D899 v1

A list can be written as a list aggregate in the following format:


GUID-4F9BA2C7-5DEE-4DF2-BE8B-770DB88C91B7 v1
LIST[([attribute = value [,attribute = value]*])]

The key word LIST is followed by attribute value assignments separated by commas and enclosed in
parentheses. The attribute values may be given as expressions of any data type. An empty list may
be written as LIST or LIST().

5.10.3 Example GUID-A42FCFAE-9422-4FA2-B3CD-296B3F8BDC0B v1

A list could have the following contents:

Attribute name LN IX UN OA OB OV ....


Index
1 "A" 4 10 3560 7 0 ....
2 "B" 2 11 3430 16 5.5 ....

Using a LIST aggregate and vector aggregates, the list could be written:

LIST(LN = ("A","B"), IX = (4,2), UN = (10,11), OA = (3560,3430), OB = (7,16), OV = (0,5.5))

5.11 Accessing components of structured data GUID-9E273F88-ED82-4EDA-BB2A-EA4745BDF558 v2

Components of structured data, that is, elements of a vector and attributes of a list, are accessed by
the following notation:
GUID-D3C7848A-E5C8-4C95-9516-AFB68E388FA7 v1
entity[component]*

where each component is one of the following:


GUID-26AC09D1-E9B3-485B-B0E6-F02D652D9FC9 v1
( index )

46 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 5
Data types

GUID-689DF4F0-B739-4C7E-9C8C-596263403639 v1
( [low] .. [high] )
GUID-D895FEA0-F4C1-4EDA-A4B6-53B599CAB0B1 v2
.attribute

'index' Integer value, 1 ... 2 000 000. Selects an element of a vector.


'low', 'high' Index range, 'low' and 'high' integer values 1 ... 2 000 000. Selects a subvector, or a
slice, containing the elements 'low' to 'high' from a vector, 'high' must be greater or
equal to 'low'. If 'high' is omitted, all indices from 'low' to the end of vector are selected.
If 'low' is omitted, all indices up to 'high' are selected, that is, 'low' defaults to 1.
'attribute' Name of an attribute of a list.

An index range may be specified only as the last component of the notation.

There is no limit for the number of components in the notation. Consequently, any component of
structured data may be directly accessed, regardless of the complexity of the data structure.

'entity' is one of the following:

• Name of a local variable or an argument (see Section 7).


• Name of a global variable preceded by % or @ (see Section 7).
• Visual SCIL object attribute reference (see Section 6).
• Window attribute reference (see Section 6).

A component access notation may appear as an operand of an expression and as the left hand
operand of an assignment statement and .SET command.

Assigning a value to an attribute does not create the attribute. If the attribute to be assigned does not
exist, error SCIL_ATTRIBUTE_NOT_FOUND is raised.

On the other hand, assigning a value to a vector element that does not exist expands the vector or
even creates the vector, if the target is not of vector type.

Examples:

Valid statements containing component access notations:

A.B = C(2).D(2 .. 6) ;Local variable access


@A.B(1)(12) = %C(2).D ;Global variable access
.SET .HEIGHTS(5) = ROOT\OBJ._GEOMETRY.H ;VS object attribute access
.SET ROOT/WINDOW1.A.B = WINDOW2.C(1) ;Window attribute access

Invalid statements:

#SET A:VB.C = SYS:BUV(5).A ;Not for application objects


MS = LOCAL_TIME.MS ;Not for return values
A = .METHOD(ARG).A ;Not for return values
(VECTOR1 + VECTOR2)(1) ;Not for intermediate results

MicroSCADA X SYS600 10.5 47


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
48
1MRK 511 664-UEN Rev. A Section 6
Objects and files

Section 6 Objects and files GUID-A8374BA3-C95D-445E-8964-21E6E88A33C9 v1

This section describes in general terms the objects and how to handle them in SCIL. The objects are
of three main categories which are described in the following sections:

Section 6.1 General: An overview of the three object categories, some object related concepts.
Section 6.2 System objects: The communication system objects and base system objects, their object
notation and some attributes.
Section 6.3 Application objects: The application object types, their object notation, and some attributes.
Section 6.4 User interface objects: The pictures and picture components, the visual SCIL objects, the
object hierarchy, the object references, attributes and methods.
Section 6.5 Files: File naming and different file types.

The description of the object types here is superficial. For a detailed description, refer to the following
manuals: System Objects, Application Objects, Visual SCIL Objects, Visual SCIL User Interface
Design and Picture Editing.

6.1 General GUID-33E284F3-DDAE-4709-917C-77E4C3F25AF9 v1

6.1.1 Object categories GUID-4FC1D02E-DF47-4774-A597-E420F6E31528 v2

There are three categories of objects which represent three levels of system engineering:

• System objects.
System objects are used for system configuration and communication. There are two types of
system objects:
• Base system objects.
• Communication system objects (previously named system objects).
• Application objects.
These objects form the functional portion of the applications. There are eleven types of
application objects:
• Process objects
• Event handling objects
• Scale objects
• Data objects
• Command procedures
• Time channels
• Event channels
• Logging profiles
• Event objects
• Free type objects
• Variable objects
• User interface objects.
There are two types of objects for composing the user interface portion of applications:
• Pictures
• Visual SCIL objects. There are approximately 40 Visual SCIL object types. Each type
corresponds to a type of dialog, dialog item (for example, buttons, texts, lists, menus) or
image.

MicroSCADA X SYS600 10.5 49


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

6.1.2 Attributes and methods GUID-F6D1F15F-CFC0-415E-9227-A226D926DCD6 v1

An important concept when talking about objects is the notion of attribute. Most object types have
attributes which represent the values and properties of the objects. The value of a process object, for
example, is represented by an attribute, the time stamp is another attribute, and so is the alarm state.
Regarding the Visual SCIL objects, the attributes may correspond to visual properties such as the
label or color of a button.

Through the attributes, the SCIL programmer can use and change the object properties. For
instance, the color of a dialog item and the alarm limits of a process object may be changed by
means of a SCIL statement.

The Visual SCIL objects may also have a number of methods which are programs written in SCIL or
in C. The SCIL programs may be freely modified, while the C programs are predefined. By executing
predefined methods, the programmer can affect certain features of the objects.

6.1.3 Handling objects in SCIL GUID-B90E02FF-E571-453E-95A6-F91834280AAC v2

The values and properties of the objects can be read in SCIL as attributes. Provided that write
access is allowed, the values and properties can also be written by means of SCIL commands.
Reading an attribute means that it is used in a SCIL expression, for example, assigned to a variable
or shown in a window.

The system objects and application objects, more precisely their attributes, are accessed by means
of an object notation which contains the object name and type and the attribute name. The Visual
SCIL objects are accessed by means of an object name or path and an attribute name.

The system objects and most of the application objects are global and accessible not only within the
same application and the same base system, but also in the entire distributed SYS600 system. The
Visual SCIL objects, on the contrary, are accessible from SCIL only within the same dialog system.

6.2 System objects GUID-9364D8C8-634B-4DF1-B706-ED68200BA6AE v1

6.2.1 General GUID-5D47EA45-0A71-4059-BC60-1113E5FECD9C v1

6.2.1.1 Overview GUID-7C39B42F-DB4D-4612-A0C8-0B5D910BD9BD v1

The system objects define the hardware and software configuration of the entire SYS600 system, as
well as the data communication with connected devices. There are two types of system objects:

• Base system objects (B) which define the base system configuration.
• Communication system objects (S) which are images of the physical system devices
connected to the communication units (NETs).

The base system objects are stored in the RAM memory of the base system computer as long as
SYS600 is running. They are not stored on disk, but must be defined at each start-up of the base
system. The communication system objects are stored in the communication units (NETs) as long as
the units are running. Default values may be stored in the communication programs as a
preconfiguration.

6.2.1.2 System object notation GUID-08F83ED8-54EF-45B5-B77B-B0A84E056962 v1

SCIL refers to a system object value, i.e. an attribute, by an object notation of the following format
(the items within brackets may be omitted):
GUID-5F5A7512-188D-4D21-9356-95DC7673DDAB v2
name:[application]type attribute[index]

50 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

where
name is the name of the object. The system objects have predefined names which are
composed of a three-letter type notation and a sequence number. Base system objects
may also have a user-defined name.
application is an application number. Generally not needed.
type is a character indicating the object type: S = communication system object, B = base
system object.
attribute is the attribute to be read or written with the notation. The attribute names are a
combination of two letters (A ... Z). The attribute determines the data type of the entire
notation. The system object attributes are all detailed in the System Objects manual.
index is a number or a range of numbers. The indices have different meanings depending on
the object type and attribute. For instance, for NET line attributes the index generally
refers to the NET line number. For some attributes, the index denotes an address. For
more detailed information about the indexing of attributes, see the System Objects
manual.

An index or index range is given in any of the following ways:

• As an integer constant, 0 ... 2 000 000, either a positive decimal number or an octal number.
Octal numbers are used when addressing bits of memory attributes of communication system
objects.
• As an integer type expression enclosed by parentheses.
• As a range enclosed in parentheses, (i .. j), where 'i' denotes the first index number and 'j' the
last. Two points surrounded by parentheses, (..), denotes all the indices of the actual object
notation. (i ..) means all indices larger than or equal to 'i', and (.. j) all indices less than or equal
to 'j'. In an index range, either both or none of the index limits may be given with bit addresses.

There may be no spaces between the items in the object notation.

6.2.2 Base system objects (B) GUID-B9465DB1-104E-4C6C-A946-FB03C404D217 v1

6.2.2.1 Description GUID-17AFEE49-A166-4493-865A-480FE4D3D14D v1

The base system objects correspond to the devices and applications located in, connected to, or
otherwise known to the base system. They determine the hardware and software properties of the
base system and its applications.

The base system objects have the following names:

SYS The base system itself


APLn Applications (n = 1 ... 250)
PRIn Printers ( n = 1 ... 20)
MONn Monitors (n = 1 ... 100)
STAn Stations (n = 1 ... 50 000)
STYn Station types (n = 1 ... 31)
NODn Nodes: base systems and NETs (n = 1 ... 250)
LINn Links: connection line (n = 1 ... 20)

'n' represents an ordinal number (base system object number). For APL and MON type objects, it
can be omitted from the object notations, which means that the notation refers to the current
application or monitor respectively.

MicroSCADA X SYS600 10.5 51


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

6.2.2.2 Some attributes GUID-13FAE3CF-9E09-49D0-B6F5-0211B5F641FC v1

Each of the base system object types have their own attributes. Here are some examples:

AS Application State
The state of the application (APL): HOT = active, WARM = not active, but accessible, COLD
= passive, not available.

LP Lines per Page


Number of lines per printed page. Belongs to PRI objects.

AC Alarm Count
Belongs to APL objects and shows the number of active alarms in the application. The alarm
class is given as an index. Index 0 refers to the total number of active alarms.

6.2.2.3 Examples GUID-6072EC99-02BF-482B-A29A-79657D7DDA10 v1

Examples of some base system object notations:

Notation Value Explanation


APL1:BAS "HOT" Application number 1 is active.
PRI1:BDT "NORMAL" Printer number 1 is black and white.
PRI2:BLP 70 Printer number 2 writes 70 lines per page.
APL1:BAC 20 There are 20 active alarms in application 1.

6.2.3 Communication system objects GUID-01D55B79-30C5-4AB6-8B7F-0B57DED89857 v1

6.2.3.1 Description GUID-6243B8AB-D45B-468A-868F-AFD2201BCF24 v1

The communication system objects correspond to the devices connected to the communication units.
Hence, these devices - communication units, stations, other base systems, workstations and
peripherals - can be accessed and controlled from SCIL as communication system objects. Each
NET unit has its own set-up of communication system objects.

The communication system objects have the following names:

NETn (or NODn) Communication units and base systems (n = 1 ... 250)
APLn Applications (n = 1 ... 250)
STAn Stations (RTUs, PCLs, relays, etc.) (n = 0 ... 255)
PRIn Printers (n = 1 ... 8)

The 'n' above indicates the number of the objects as known to the NET where they are defined.
When handling the objects in SCIL, the 'n' in the object name is the logical number of the device
(according to the device mapping attributes).

6.2.3.2 Some attributes GUID-E25069A9-7D33-44C1-B2F2-588DD74AF6C6 v2

Each of the object types have their own attributes. Here are some examples:

52 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

SA Station Address
The station address of a device. The NET objects and STA objects have a station address.

IU In Use
States whether or not the object is in use. Most system objects have this attribute.
Value: 0 = out of use
1 = in use.

PO Protocol
The protocol of a communication line given as an integer, for example, 1 = ANSI full duplex,
14 = SPA. 0 = the line is not defined.

ME Memory address
The contents of the memory address given as an index. Belongs to the STA objects (ANSI
stations).

6.2.3.3 Examples GUID-067C2512-E967-4552-B191-AFDF790977E8 v1

Examples of some communication system object notations:

Notation Value Explanation


STA1:SSA 201 Station 1 has station address 201.
NET1:SPO2 14 Line 2 of NET1 uses the SPA protocol.
PRI4:SIU 1 The printer is in use.
STA5:SME1234^5 0 The contents of storage address 1234, bit number 5 in STA5

6.3 Application objects GUID-7E8DB353-6359-4531-8EE6-CA8A9C6E9DCE v1

6.3.1 General GUID-0266864F-D03D-4F78-85B6-4931C97B9049 v1

6.3.1.1 Object types GUID-03BBE7DC-0064-41BA-ACBE-5C5D7483EEE5 v1

The application objects are programmable units which perform various functional tasks in the
SYS600 application. They constitute data images of physical process or system devices, data
registers, SCIL programs, scaling algorithms, facilities for automatic activation, etc.

There are eleven types of application objects:

• Process objects (P): data images of the physical process devices connected to process
stations (remote terminal units (RTUs), protective equipment, PLCs, etc.).
• Event handling objects (H): texts related to object states and events.
• Scales (X): algorithms for scaling analog process values.
• Data objects (D): collections of stored data.
• Command procedures (C): SCIL programs.
• Time channels (T): facilities for automatic time bound activation.
• Event channels (A): facilities for automatic event bound activation.
• Logging profiles (G): definitions for logging data into Historian database(s).

MicroSCADA X SYS600 10.5 53


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

• Event objects (E): mechanisms for event activated start-up of SCIL programs or program
sequences in pictures and dialog objects.
• Free type objects (F): special objects for the definition of user-defined process object types.
• Variable objects (V): temporary objects which can contain attributes collected from other
objects or arbitrary attributes.

Process objects, event handling objects, scales and free type objects are stored in the process
database, which holds an image of the process. Data objects, command procedures, time channels,
event channels and logging profiles are all stored in the report database, which is a database
supporting reporting, calculation and control. These objects are also commonly named reporting
objects. Variable objects are stored in the same way as variables (see Section 7). Event objects are
not stored at all.

All application objects, with the exception of the variable objects, are global and accessible
throughout the entire system.

6.3.1.2 Application object notation GUID-0DA3517B-5DC6-4448-9EE6-D72696ED0A94 v1

SCIL refers to an object value, i.e. an attribute, by an object notation of the following format (the
terms in brackets may be omitted in cases where they are not needed):
GUID-8AAD8484-038D-4E98-AFB3-9F15105A8F02 v1
name:[application]type[attribute][index]

where
name is the object name. The application object names are logical (symbolical) and can be
freely chosen in accordance with the rules given in Section 4.2.
application is the logical number of the application where the object is stored. Application number
must be given if the object belongs to an application other than the current one (the
application where the notation is used). If the object belongs to the same application,
the number is omitted. The application numbers are defined by the APL:BAP attribute
(see Section 7).
type is the type of the object given by using the letters P, H, X, D, C, T, A, G, E, F or V.
attribute is the attribute to be read or written by the notation. As a rule, the attribute names are a
combination of two letters (A ... Z). However, if the object is a variable object, the
attribute name may be composed of up to 63 characters. The object notation may
contain one or no attribute name. The attribute determines the data type of the entire
notation when used in expressions.
index is a number or a range of numbers used to select an element or a range of elements of
a vector attribute, or distinguish between process objects within an object group.

As a rule, the indices refer to the elements of an attribute of vector type. The predefined process
object types are an exception. For these objects, the indices refer to the individual objects in a group,
not to attributes of vector type. Still, for a certain attribute, the values are handled as elements in a
vector.

An index or index range is written in one of the following ways:

• As an integer constant, 1 ... 2 000 000. This way may be used only when the length of the
attribute name is exactly 2 characters.
• As an integer type expression enclosed in parentheses.
• As a range (i .. j), where 'i' denotes the first index and 'j' the last. Two points surrounded by
parentheses, (..), is interpreted as all the indices of the attribute. (i ..) means all indices larger
than or equal to 'i', and (.. j) all indices less than or equal to 'j'.

No spaces are allowed between the items in the object notation.

54 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

6.3.2 Process objects (P) GUID-9A7987D7-48B3-478F-A136-814BB638A19A v1

6.3.2.1 Description GUID-030D46C9-A1FF-4ED4-9699-1BF1F6083FDB v1

The process objects correspond to physical devices connected to the process stations (RTUs,
protection equipment, PLCs), for instance switches, sensors and breakers. Each input and output
connection in the stations is represented by a process object. Normally, the value of an input object is
updated from the process station, while the value of an output object is sent to the station when
written with the SCIL command #SET (Section 9.2).

Some process objects have no correspondence in the stations. These are called fictitious process
objects and they can generally be updated only from SCIL programs. They can be used, for example,
for process simulation or manually updated data.

There are nine predefined process object types depending on the type of object value (i.e. the input
or output connection in the stations): binary input and output, analog input and output, digital input
and output, double binary indications, pulse counters and bit streams. In addition, for special
purposes, the programmer can define their own process object types by means of free type objects.

An updating of a process object value may cause an alarm, an automatic printout, an updating on
screen (through event objects, Section 6.3.10), and activation of an event channel (Section 6.3.8).

Process objects with active alarms are included in an alarm buffer, which can be read by SCIL
function APPLICATION_ALARM_LIST and displayed as alarm lists. If desired, the process object
events can be stored in a history database, which can similarly be read by SCIL function
HISTORY_DATABASE_MANAGER and displayed as event lists.

6.3.2.2 Some process object attributes GUID-B349272A-75EC-4552-AC10-062374A6A4DD v1

A few process object attributes are described below. All attributes are detailed in the Application
Objects manual.

OV Object value
The value of the process object as registered in the process database. The object value is
the value read from the process (input values) or sent to the process (output values). The
attribute is a common name for the attributes BI, BO, AI, AO, DI, DO, DB, PC and BS (see
below). Each object value has a time stamp and an error status code.
Value: 1 or 0 for binary objects, real values for analog objects, bit string for bit streams
and integer for the others.

BI Binary Input
Binary process value from the process to the control system.
Value: 1 or 0.

BO Binary Output
Binary set value from the control system to the process.
Value: 1 or 0.

AI Analog Input
Analog measurement value from the process to the control system.
Value: real.

MicroSCADA X SYS600 10.5 55


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

AO Analog Output
Analog set value from the control system to the process.
Value: real.

AL Alarm
States whether the object is in alarm state or not.
Value: 0 - no alarm
1 - alarm state.

HI, LI Lower Input, Higher Input


Lower and higher alarm limits. These attributes are defined only for analog objects with an
alarm function.
Value: real.

If object notation is given without any attribute, the attribute is assumed to be OV, except in
connection with the commands #LIST, #CREATE, #DELETE and #MODIFY (see Section 9), where
the whole object is referenced to.

6.3.2.3 Groups and indices GUID-E61B94E3-3D03-483C-AF5F-7DA8B500C6C5 v1

Related process objects (up to 65 535) of the predefined types may be given the same name.
Process objects with the same name form a process object group. The individual objects in a group
are accessed by means of indices. A process object notation of any predefined type without an index
is interpreted as the lowest indexed object with the given name and attribute (attributes common to
the group are always used without indices).

Concerning user-defined types (defined by free type objects), the indices refer to the elements of a
vector type attribute. A notation without indexing means the entire vector.

6.3.2.4 Examples GUID-64E380C4-0767-4109-97FD-CE172A85F6DA v1

Some examples of process object notations:

Notation Value Explanation


SWITCH:P 1 The value of the process object (the lowest indexed object in the group).
SWITCH:POV 1 -"-
SWITCH:PBI23 1 The switch with the index 23 is connected.
TEMP:POV(%N+1) 37 The value of the expression %N+1 is calculated and used as an index.
TEMP:PHI 90.0 Alarm is given when the temperature rises above 90.
TEMP:PLI 10.0 or falls below 10.
TEMP:PAL 1 Alarm state prevails.

6.3.3 Event handling objects (H) GUID-39274983-94DD-4134-9FCF-9C40C46CC021 v1

6.3.3.1 Description GUID-1E2600C5-28C7-44A3-8A57-7A960B82B867 v1

Event handling objects are related to the process objects. They define translatable texts that describe
the state of the process object and the transitions between the states.

Each process object owns a reference to an event handling object. One event handling object is
typically used by several process objects.

56 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

6.3.3.2 Some event handling attributes GUID-9DBFD0CD-BFF1-4520-88D4-9D2F514B4841 v1

Two event handling object attributes are given below as examples. All attributes are detailed in the
Application Objects manual.

ST State Texts
Value: A text vector containing the text identifiers for the state texts

SX Translated State Texts


Value: A text vector containing the state texts in the current language

6.3.4 Scales (X) GUID-715803E2-E8BC-4206-BA9D-D00834C573BE v1

6.3.4.1 Description GUID-93771CD3-9A70-44E5-86C4-A531FDEB402E v1

Scales are related to the process objects, particularly to analog process objects. They define
algorithms for the transformation of the digital process values transferred from the stations to the
values of the analog units of the corresponding process objects.

Every REAL valued analog process object has a scale name, which defines the scaling algorithm to
be used for the transformation. The same scale can be used by several process objects.

6.3.4.2 Some scale attributes GUID-37A4F696-A471-4120-8409-E9A61DE8ED74 v1

Below are two scale object attributes. All attributes are detailed in the Application Objects manual.

LN Logical Name
Value: text.

SA Scaling Algorithm
Value: 0 = 1:1 scaling
1 = linear scaling
2 = step-wise linear scaling

6.3.5 Data objects (D) GUID-7499788B-E496-4935-A7FB-DB85C3BBCDAB v1

6.3.5.1 Description GUID-DFFEBC7E-32D4-49C5-B2A5-27C78C932A15 v1

Data objects (datalog objects) register and store calculated or sampled data. They are used for the
storage of report data, trend data, data for calculation and control, system configuration data, etc.
The data objects can also be used as application variables when there is a need for exchanging data
between different objects.

The data registration may be initiated from a program (by means of the commands #EXEC and
#EXEC_AFTER, see Section 9.2), from a time channel (Section 6.3.7.) or from an event channel
(Section 6.3.8). Each registration is performed according to a SCIL expression and a logging
function. Besides the calculated or sampled value, each registration includes a time stamp and a
status code.

Every data object can store a chosen number of data registrations (up to 2 000 000). The
registrations can be accessed as vectors by means of indices. The oldest registered value has the
index number 1.

MicroSCADA X SYS600 10.5 57


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

6.3.5.2 Some data object attributes GUID-68E5741A-4601-4CAB-8CF5-4572DB1E45E5 v2

Some of the most important attributes are listed below. A complete description can be found in the
Application Objects manual.

OV Object Value
Registered value.
Value: real or vector of real values.

RT Registration Time
Value: time or vector of time values.

OS Object Status
Indicates the reliability of the registered data.
Value: Integer or vector of integers. The status codes listed in the Status Codes
manual, for example:
0 ... OK
1 ... uncertain
10 ... no values.

If the object notation lacks an attribute, the attribute is assumed to be OV, except in connection with
the command #EXEC or #EXEC_AFTER (Section 9.2), where the notation refers to the whole object.

The above mentioned attributes are used indexed. An object notation with these attributes without
any index refers to the latest registered value.

6.3.5.3 Examples GUID-41936E0A-745A-41D7-A075-A51BE3B3EEBC v1

Some examples of data object notations:

Notation Value Explanation


DATA:D 5.6 The latest registered value of the data object.
DATA:DOV 5.6 The latest registered value of the data object.
DATA:DRT Time of last registration given as time data. Can be converted
to calendar time by means of time functions (Section 10.4).
DATA:DRT(5..) The vector formed by the registration times for the datalog
object DATA starting with registration number 5.
DATA:DOV(1..(DATA:DLR)) The values of the registered data ranging from the oldest one
to the last registration (LR).

6.3.6 Command procedures (C) GUID-1631D543-9D57-43BC-81E2-A1C694813BD8 v1

6.3.6.1 Description GUID-CD55ACEE-9B51-4628-90B9-E86F2E6DE208 v2

The command procedures contain SCIL programs which can be started automatically or by SCIL.
They can be used for all kinds of manually or automatically started operations, such as calculations,
control operations and reporting. They cannot be used for affecting the user interface. Command
procedures can be started in the following ways:

• From SCIL programs with the #EXEC and #EXEC_AFTER commands (Section 9.2). (A
command procedure can even start itself).
• From time channels (Section 6.3.7).
• From event channels (Section 6.3.8).

58 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

A command procedure can hold up to 2 000 000 SCIL lines. As a rule, command procedures may
not contain user interface related commands (picture commands, Visual SCIL commands or
graphical commands, see Section 9.1. However, a command procedure, or a selected part of it, can
be handled as a vector and be executed with the #DO command (Section 9.2) and the DO function
(Section 10). In these cases, it may contain user interface commands if the #DO command or DO
function is executed in a user interface object.

6.3.6.2 Some command procedure attributes GUID-B5EC4485-F98E-4737-971D-67E83C1A5B25 v2

Some command procedure attributes are shown below. All attributes are detailed in the Application
Objects manual.

TC Time Channel.
The name of the time channel that starts the command procedure.
Value: text.

IN Instruction
The program of the command procedure.
Value: text vector.

OS Object Status
States how the last execution succeeded.
Value: The status codes listed in the Status Codes manual, for example:
0 ... correctly executed
10 ... not executed.

A command procedure notation without an attribute refers to the program, i.e., the IN attribute.

Indices can be used only with the attribute IN where they refer to the line numbers. The IN attribute
without indices refers to the whole program.

6.3.6.3 Examples GUID-ED535C6D-F996-44CC-8AC8-69505DDB7B74 v1

Some examples of command procedure notations:

Notation Value Explanation


TASK:C The program as a text vector.
TASK:COS 0 The program execution succeeded.
TASK:CIN5 "@VAR = 10" The fifth line of the command procedure TASK.

6.3.7 Time channels (T) GUID-1AC005F2-1362-4F28-A384-762CBFE36D0F v1

6.3.7.1 Description GUID-3B9FFBB2-84AF-480D-BF57-DCD6655C52E8 v1

Time channels are used for the automatic start-up of time-bound activities, which can be:

• The registration of data objects.


• The execution of command procedures.

A certain time channel can start several data objects and command procedures. The execution order
is determined by the priorities of the data objects and command procedures.

MicroSCADA X SYS600 10.5 59


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

A time channel is activated at the execution time which means that the connected objects are
executed. At the initialization time the time channel is initialized, which means that the registration of
connected data objects is restarted from the first record. Both initialization and execution can take
place at absolute points of time or periodically with a fixed interval. All times are given with an
accuracy of one second. Discontinuous time activation is obtained with conditional expressions.

Time channels can be executed also with the #EXEC commands (Section 9.2) and with event
channels (Section 6.3.8).

6.3.7.2 Some time channel attributes GUID-F1F807F1-24CE-4AF6-8E26-3128B3A2CB7A v2

Some time channel attributes are listed below (a complete list is found in the Application Objects
manual):

IU In Use
States whether the time channel is in use or not.
Value: 0 = not in use
1 = in use

RT
The time of last initialization/activation.
Value: time vector

The time channels can be used without an attribute only with the #EXEC commands.

Indices (1 or 2) can be used, for example, together with the RT attribute. Index 1 refers to the
initialization time and index 2 the activation time.

6.3.8 Event channels (A) GUID-E71DF219-643B-4CF7-9D02-968AC49E636B v1

6.3.8.1 Description GUID-B4C80F80-FE45-4883-B457-B09820E99B11 v1

Event channels are used for the automatic start-up of event-bound activities. The events normally
originate from the process database, from where the event channels transmit them to objects in the
report database which take the consequential actions (calculations, control actions, etc.). An event
channel can start the following operations:

• Registration of a data object.


• Execution of a command procedure.
• Activation of a time channel.

Each process object may have only one event channel, but an event channel may be connected to
up to 11 command procedures and data objects. At the activation of an event channel, some
essential attributes are transmitted as variables from the process object to the connected reporting
object. Thanks to this feature, several process objects can share the same event channel.

An event channel is activated by the following events in the activating process objects:

• An alarm comes or goes.


• The warning limits or alarm limits of an analog object are transgressed (provided that the control
system, not the RTU, handles the limit value supervision).
• The OV attribute (BI, BO, AI, AO, DI, DO, DB, PC, BS or OE) is changed.
• The OV attribute is updated.

60 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

The options are chosen with a process object attribute (AA). Event channels can also be activated
with SCIL (the #EXEC commands, Section 9.2).

In addition, any user-defined attribute can activate the event channel of the object.

6.3.8.2 Some event channel attributes GUID-028C17BC-195D-4DFD-90F6-F54C503FD896 v1

Examples of attributes (a complete list is found in the Application Objects manual):

OT Object Type
The type of the object to be executed.
Value: text.

ON Object Name
The name of the object to be executed.
Value: text.

6.3.9 Logging profiles (G) GUID-E2DBBB32-785D-4858-82D0-6CA5322E0876 v1

6.3.9.1 Description GUID-84918201-D179-4657-9240-871DB06BCD8A v1

Logging profile objects are used to define the connection of SYS600 application database to a
Historian database. A Historian database is a high performance time series database designed to
store large amounts of real-time data for later analysis and reporting.

The following data from the SYS600 database can be logged to a Historian database:

1. OV (Object Value) attribute of process objects of following types:


• BI (Binary Input)
• BO (Binary Output)
• DB (Double Binary)
• DI (Digital Input)
• DO (Digital Output)
• AI (Analog Input)
• AO (Analog Output)
• PC (Pulse Counter
2. OV (Object Value) attribute of data objects of value type real or integer.

In addition to the value itself, also the time stamp and status are logged (attributes RT and OS,
respectively). The objects to be logged are specified by linking the object to a logging profile object
(attribute GP of process and data objects). The logging profile objects specify where and how the
data is logged. For more information about logging profiles, see the Application Objects manual.

6.3.10 Event objects (E) GUID-582B053B-6C51-489E-8880-9F4FECD584A6 v1

6.3.10.1 Description GUID-1BB86CD6-98CF-467A-A40B-B45BF83F6CF6 v1

The event objects are used to start event-bound activities, normally updates, in user interface objects
(pictures and Visual SCIL objects).

In pictures, the activation of an event object causes the execution of the statement(s) determined by
the #ON command (Section 9.2) for the specific event object. The #ON commands are valid only for
the actual picture, either main picture or sub-picture, where they have been executed. The event

MicroSCADA X SYS600 10.5 61


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

causes no action if there is no #ON command in force for the actual event in the picture shown on
screen at the event moment.

In dialogs and dialog items, the activation of an event object starts the execution of the event
method, if any, defined to be activated by the event object in question.

An event object can be activated in two ways:

• From the process database, so that a change in a process object automatically activates an
event object with the same name and index as the process object. The activation takes place
independently of what causes the change - a change of state in a station or an assignment in a
SCIL program (by the command #SET, Section 9.2). The coupling of an event object to a
process object is optional. The activating attributes are listed in the Application Objects manual,
the EE attribute description.
• From a SCIL program (in a picture or a command procedure) by the #EXEC commands (Section
9.2). In this case the name of the event object can be freely chosen.

If a process object is equipped with an event object, updating in pictures is carried out automatically
and immediately when a change occurs. The value of the changed attribute is not transmitted to the
picture, nor is any information about which attribute has changed.

The event object notation does not contain any attribute. Event objects have no values, hence they
cannot be parts of expressions.

6.3.10.2 Example GUID-F5DDCB42-7594-46AE-B52B-AF9F0C6FE50C v1

If the process object


GUID-C99768AF-D21D-4D5F-8C06-6AE6C65BE83D v1
TEMP:P2

is equipped with an event object (EE = 1), the event object


GUID-D1FB8052-04C3-46E3-B4A1-C617D13A9C77 v1
TEMP:E2

is always activated when a change in the process object (for instance the attribute AI) occurs in the
process database.

6.3.11 Variable objects (V) GUID-DBBE6E6A-727D-4612-8246-A8CA05C77B19 v1

6.3.11.1 Description GUID-EA3D9EC7-6878-413D-B664-C2D91F25A0E3 v2

The variable objects serve as temporary storage places for attributes. They are used to compose
lists, for example, alarm and event lists, to browse through the object properties, to copy objects, to
create and modify objects, etc.

A variable object is at the same time both an object and a global variable of list type (Section 5.11).
The list as a whole is handled as a variable with the same name as the object (Section 7). The
attributes in the list are accessed with a variable object notation.

A variable object can be created and assigned attribute values in two ways:

• By creating the variable object with the #CREATE command (Section 9.2) and assigning it
attribute values with a list function or with the #SET command (Section 9.2). In this case, the
attribute names may be arbitrary, up to 63 characters.
• By assigning a global variable a value of list type (Section 7.2). A variable object with the same
name as the variable is formed. The variable object gets all the attributes of the list expression.

A variable object notation must always contain an attribute. Unlike other object types, the names of
variable object attributes can contain up to 63 characters. If the attribute is of vector type, the vector

62 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

elements are identified by indices. An object notation without an index denotes the whole vector. If
the attribute name contains more or less characters than two, the index must be enclosed by
parentheses.

As global variables (Section 7), variable objects are accessible within the SCIL context they are
created in.

6.3.11.2 Examples GUID-988DA803-742D-4E33-93EA-7CE0405CDB05 v1

The statement
GUID-E285580F-F422-43D7-9D95-983A8C609D63 v1
@VAR = PROD_QUERY(20)

assigns the variable VAR the list value returned by the function PROD_QUERY (Section 10). The
variable may be accessed as variable object VAR:V.

Some variable object notations:

Notation Value Explanation


VAR:VLN1 "SWITCH" The first object name in the list.
VAR:VOV1 0 The first object value in the list.
VAR:VLN(1 .. 10) The first ten object names in the list.

Variable objects are more or less obsolete. Attributes of list type variables may be
accessed in a more powerful way by using data component access described in Section
5.11. For example, VAR:VLN1 may be written as %VAR.LN(1), when read, or
@VAR.LN(1), when written.

6.4 User interface objects GUID-6181C586-3B51-4DD4-9B0F-F84A211F945A v1

6.4.1 Visual SCIL objects GUID-9A5D124E-B29E-4908-AD13-84FF2E063DFD v1

6.4.1.1 General GUID-3CE73A1E-6999-438C-8744-B0408462BB4C v1

The Visual SCIL objects correspond to the dialogs, dialog items and images designed in the Dialog
Editor or created with SCIL. There are approximately 40 types of Visual SCIL objects which could be
grouped as follows:

• Dialogs. There are two types:


• Ordinary dialogs
• Main dialogs
• Compound dialog items. These are dialog items which may contain other dialog items:
• Containers: visible or invisible boxes containing other dialog items.
• Picture containers: containers that can contain pictures.
• Menu bars, menus and menu items: menu bars can contain one or more menus, menus
can contain menus and menu items.
• Notebooks, notebook pages and notebook items.
• Simple dialog items, such as buttons, toggle buttons, texts, lists, etc. These dialog items cannot
contain other objects.
• Images.

MicroSCADA X SYS600 10.5 63


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

In SCIL, the visual SCIL object types are referred to by names starting with VS_. For instance,
buttons are named VS_BUTTON. The Visual SCIL Objects manual lists and describes all the Visual
SCIL object types.

Generally, the dialogs, dialog items and images are designed in the Dialog editor, though they can
also be created directly with SCIL. Dialog and dialog items created in the dialog editor are stored in
files from where the SCIL command .LOAD loads them in the memory as a visual SCIL object with a
specific name. Objects created with .CREATE are not stored in files.

The SCIL commands for handling Visual SCIL objects are detailed in Section 9.2.

Unlike system and application objects, the Visual SCIL objects are not global. They are known and
accessed only within the dialog system where they are created or loaded.

6.4.1.2 Dialog systems GUID-622A128F-34F9-4C4E-8A86-4210FA8A37E7 v1

The Visual SCIL objects are arranged in hierarchical dialog systems with a main dialog or picture
container at the top. Each main dialog and each dialog system creates a new dialog system. The
object hierarchy is important when referencing the objects.

Objects containing another object are called parent objects, and the contained objects are called
child objects. Child objects are dependent upon their parent objects. When the parent objects are
loaded, the child objects are loaded as well, and when the parent objects are deleted (with
the .DELETE command), the child objects are also deleted.

When loading a dialog or a dialog item with the .LOAD command, it becomes a child object of the
loading object (unless object path is given, see below). When loading a main dialog or picture
container, it creates a new dialog system.

Figure 8 shows an example of a Visual SCIL dialog system with four dialogs. Dialog 1, which is the
main dialog, contains four dialog items. Dialog item B loads dialog 2. This dialog contains three
dialog items, one of which (object G) loads dialog 3. Dialog item D contains two dialog items, and
dialog item F contains two items. For instance, D could be a menu bar containing menus, which
contain menu items (menu options). Dialog item J loads dialog 4.

The dialog items A .. D are child objects of the main dialog. Dialog 2 is the child object of item B and
the parent object of the dialog items G .. I. Dialog 4 is the child object of item J which is the child
object of item F, and so on.

GUID-2F52471E-1031-4E8F-86A3-8FC809CEB29B V1 EN-US

Figure 8: An example of a dialog system.

64 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

6.4.1.3 Attributes and methods GUID-639288E5-54FD-4544-9ECB-AEC6EB844EB4 v2

The attributes of the Visual SCIL objects specify their properties and functions, for example, visibility,
position, text contents, behavior, color, fonts, etc. Some attribute values can be set in the dialog
editor, some only with SCIL, and some both in the editor and with SCIL.

The dynamic changes of the dialogs and dialog items are obtained by changing their attribute values
with the SCIL commands .SET and .MODIFY.

Each object has a number of predefined attributes with predefined names, data types and meanings.
The predefined attributes of each object type are listed and described in the Visual SCIL Objects
manual. In addition, the objects can be given an arbitrary number of user defined attributes with
the .LOAD, .CREATE and .MODIFY commands.

Each dialog and dialog item may have a number of methods which are programs for various
purposes, for example, cyclically executed programs, programs executed on certain events (event
objects), programs started by a user operation, and programs started by SCIL.

The programs started by SCIL may be predefined or user defined. They are started by a method call
of the format described below.

6.4.1.4 Visual SCIL object references GUID-E08B166E-E971-43BB-AE51-440C4F114364 v1

When designing a dialog or dialog item in the Dialog Editor, each item may be given a name. This
name will be the Visual SCIL object name of the item when it is included in a dialog or dialog item
loaded with the .LOAD command. The loaded dialog or dialog item is given a Visual SCIL object
name with the .LOAD command. Objects created with .CREATE are given object names with this
command.

Object references are used when loading, creating and deleting objects, and in the attribute
references and method calls. When referring to an object one level below, the object name is
sufficient. When referring to an object that is more than one level below, object path should be given
as follows:
GUID-676149E4-3F44-48EA-A4E8-797E8FA9944C v1
name\name\name\.... \name

where each 'name' is a Visual SCIL object name.

The following predefined path names can be used:

ROOT The main dialog or picture container on top of the dialog system.
PARENT The parent of the object.
THIS The object in question.

PARENT and ROOT are the only possibilities for accessing objects on a higher level in the hierarchy.

6.4.1.5 Attribute references GUID-A787A483-A3DF-4A35-AE48-4497D65D9902 v1

Attributes are referenced with the following notations:


GUID-7434EFDA-7894-4281-86E4-95F9D7055FF1 v1
[object].attribute[component]*

where 'object' is an object reference, 'attribute' is the name of the attribute and 'component'
addresses a component of structured data, see Section 5. If the attribute or method is referenced
from a method within the same object, no object reference is needed.

MicroSCADA X SYS600 10.5 65


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

Attribute references can be used as operands in expressions. They are also used together with
the .SET command to achieve a change of the attribute. The attribute references can be expanded
like variables, see Section 7.

Example:

.SET MY_BUTTON._TITLE = "OK"

This statement sets the label of the button (the visual SCIL object MY_BUTTON) to OK, which is
immediately shown on screen if the button is shown.

6.4.1.6 Method calls GUID-54AB6899-1315-4DDD-93FC-AF26C728D1C8 v1

Method calls start the execution of methods, both predefined methods and user defined methods.
Method calls have the following format:
GUID-B8DB4B19-5414-48E6-948B-614C2B2D2228 v1
[object].method [(argument_list)]

where
'object' is an object reference. Not needed when referencing methods in the same object
or one level below.
'method' is the method name.
'argument_list' Arguments, which may be any SCIL expressions given as a list of SCIL
expressions separated by comma and enclosed in parentheses. Up to 32
arguments may be given.

By using the SCIL command #RETURN, a method can be programmed to return a value to the
calling program. A method call that returns a value can be used as an operand in an expression.

6.4.2 Pictures GUID-8AD3DE3B-15B6-44F7-9BD9-9F0A518C451B v1

6.4.2.1 General GUID-2C40EF8F-6DD0-4E6B-BB4D-4FE30775CC17 v1

The pictures and picture components were briefly described in Section 4. The Picture Editing manual
describes how to build and program the pictures. This section discusses how to reference pictures
and picture elements from SCIL.

In SCIL, the pictures and windows are handled by the picture handling commands described in
Section 9.4. In addition, the windows may have attributes which are accessed by a window attribute
reference. The named programs of the pictures are executed by a named program call.

6.4.2.2 Picture hierarchy GUID-ECA0554D-CB00-448E-87B8-B2145F7A78A1 v1

A picture may contain a number of sub-pictures in the shape of pictures shown in windows and
picture functions. These sub-pictures in turn may contain sub-pictures. A picture and its sub-picture
form a picture hierarchy with the main picture (total picture) on the top. Figure 9 shows an example of
such a hierarchy. A, B, C, D, E and F denotes windows and picture functions.

66 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

GUID-40B23FA9-6C16-4BBA-B84A-C47202333BB9 V1 EN-US

Figure 9: A hierarchical picture structure. The subpictures are picture functions or pictures
shown in windows. The letters A .. F denotes the names of windows and picture
functions.
A picture containing sub-pictures is the parent of its sub-pictures and the contained sub-pictures are
children. This parent-child relationship is important in determining how the windows are shown in
relation to other windows. It is also important when referencing windows and named programs.

6.4.2.3 Picture Paths GUID-CAEAB6E7-AD00-40E3-B5C9-3BD9F134868E v1

When referencing windows and named programs, a picture path may be used. A picture path states
in which picture, main picture or sub-picture, the window or named program should be searched. A
picture path has the following format:
GUID-E0CA0094-8DED-4161-BB07-1C283D32747E v1
name/name/name/ ... /name

where each 'name' is the name of the window or picture function containing the next picture in the
hierarchy counting from the picture where the command is issued. (Back slash (\) could be used
instead of forward slash (/).) The main picture can be referenced with the predefined name ROOT. If
the picture is included in a dialog system (see Section 6.4.1.) ROOT also refers to the picture
container where the picture is included.

If no picture path is given, the window or named program is first searched from the same picture as
where the reference is issued. If not found there, it is searched from the parent picture and so on up
to the main picture. Hence, when referencing windows and programs within the same picture or its
parent picture, no path is needed.

For example, the picture path for referencing a named program SAMPLE in sub-picture 4 in Figure 9
from the main picture would be:
GUID-B3A3C1E7-7AAB-4DB0-BF20-B8C08636F507 v1
A/D

If not found in sub-picture 4, the program is searched in sub-picture 1 and then in the main picture.

6.4.2.4 Picture object attributes GUID-095D7F13-BF01-4938-B5BF-6059B6C50C69 v1

The programmer can assign the windows and picture functions attributes for various purposes using
the .SET command, see Section 9.2.

The window and picture function attributes are referenced according to the following format:

MicroSCADA X SYS600 10.5 67


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

[picture].attribute[component]*

where 'picture' is the picture path, 'attribute' is the name of the attribute and 'component' addresses a
component of structured data, see Section 5.

An attribute reference can be used as an operand in SCIL expressions. The operations allowed
depend on the data type of the attribute (see Section 8).

The picture object attributes can also be expanded in the same way as variables (see Section 7).

Examples:

.SET PIC_FUNC_1/WINDOW_2.RESIZED = TRUE


.SET .COUNTER = 0
.SET .COUNTER = .COUNTER + 1

6.4.2.5 Named program calls GUID-7A860C91-CB6F-4975-A45A-D65BA6AC060D v1

Each picture can have a number of named programs which are started with the following program
call:
GUID-9B2B97B9-1972-4A36-B563-583382829C2A v1
[picture].program[(argument_list)]

where
'picture' is the picture path to the object containing the named program, see above. If
omitted, 'program' is searched for in the picture containing the program call. If not
found there, it is searched in its parent picture, and so on.
'program' The name of the named program.
'argument_list' Arguments given as a list of SCIL expressions separated by commas and
enclosed in parentheses. Up to 32 arguments may be given.

When encountered in a program, the program call starts the execution of the named program in the
given picture. The subsequent statement in the calling program is not executed until the named
program has been executed to the end. If no program with the given name is found, an error status is
produced. Named programs can be executed from any program in the dialog system. They are also
used as call back programs of Motif widgets.

By using the SCIL command #RETURN (see Section 9.2) in the named program, it can be
programmed to return a value to the calling program. A named program call that returns a value can
be used as operand in expressions.

Example:

A/B.CREATE_ERROR_DIALOG
Executes the named program CREATE_ERROR_DIALOG of window B which is a
child window of window A.

@A = .MY_NAMED_PROGRAM (125,%V+6,"ABC")
The program MY_NAMED_PROGRAM is executed and its return value is assigned
to the variable A.

6.4.3 Predefined VS object, window and picture function methods GUID-C91B59C9-1CED-4962-8CC5-92F2195E84F3 v1

Every Visual SCIL object, window and picture function has the following predefined methods that are
used to postpone a SCIL program execution.

68 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

6.4.3.1 _FLAG_FOR_EXECUTION(name, program [, delay]) GUID-1E9A425D-3AC2-4195-97E0-6F3856F2647F v1

Queues a SCIL program to be executed.

'name' Text value used as the identifier of the flagged execution. An empty name is allowed.
'program' Text or text vector, the program to be executed.
'delay' Real value indicating the minimum amount of seconds to elapse before the program is
executed. Default value is 0.
Return value: No return value.

This method is identical to _QUEUE_FOR_EXECUTION (see below) with the following exception: If
_FLAG_FOR_EXECUTION method of an object is called twice using the same 'name', the first
flagged execution is cancelled (if still queued).

6.4.3.2 _QUEUE_FOR_EXECUTION(program [, delay]) GUID-BFE19F1A-BE9B-4788-BCE4-150832528ECE v1

Queues a SCIL program to be executed.

'program' Text or text vector, the program to be executed.


'delay' Real value indicating the minimum amount of seconds to elapse before the program is
executed. Default value is 0.
Return value: No return value.

This method is used when the programmer wants to execute a SCIL program at a later point in time
when the process would otherwise be idle. The program to be executed is given as parameter in the
method call. There is no way to exactly know when in time the program is executed. A minimum time
that has to expire can however be defined in seconds as the second parameter. The maximum
number of queued programs per object is 100. If this limit is exceeded all queued executions are
removed and a SCIL error is raised.

Example:

The example shows how to ensure that the blocking cursor of a dialog is switched off after a long
program execution even if an error occurs that interrupts the normal program flow.

.set my_dialog._busy = true


my_dialog._queue_for_execution(".set this._busy = false")
;long SCIL processing here
...

6.4.4 Predefined VS object, window and picture function attributes GUID-6432D11C-AAEE-46C2-8FFC-8DDF22018665 v1

Every Visual SCIL object, window and picture function has the following predefined attributes that
provide information of various properties of the object. All these attributes are read-only.

6.4.4.1 _ATTRIBUTE_NAMES GUID-EB99FEC0-734F-4A6C-B5A7-22252726459C v1

The attributes listed in alphabetical order.

MicroSCADA X SYS600 10.5 69


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

Value type: List.


Value: Two attributes:
USER_DEFINED Text vector containing the names of user-defined attributes.
PREDEFINED Text vector containing the names of the attributes defined by the
object class.

6.4.4.2 _CHILD_OBJECTS GUID-8737F3E6-C3FC-4513-AB6E-85DF53911941 v1

The names of the child objects.

Value type: Text vector


Value: The names of the immediate children of the object listed in the order of creation.

6.4.4.3 _COMPILED GUID-6696E99B-7D83-422B-96BD-C18FD57FF58D v1

Defines whether the SCIL programs of the object are compiled or not.

Value type: Boolean


Value: FALSE Not compiled (default)
TRUE Compiled

When the attribute is set to TRUE, the object and all its child objects that are loaded together with it,
are recursively flagged to be compiled. The methods of the objects are not compiled at once, but
instead they are compiled when called for the first time. If the compilation fails, the uncompiled
source code is silently used instead.

When the attribute is set to FALSE, the _COMPILED flag of the object and its child objects are
recursively cleared, and the compiled methods (if any) are decompiled, i.e. their compilation result is
discarded.

The _COMPILED attribute may be set any time (even from outside the object), but it is good practice
to insert the SCIL statement

.set THIS._compiled = TRUE

in the CREATE method of the object. This is to state that the object has benefit from the compilation
and is comprehensively tested to run as compiled.

6.4.4.4 _FILE_REVISION GUID-7AD9D83E-860F-41B6-9685-F66DAA3B9EBE v1

File revision.

Value type: Text


Value: The FILE_REVISION attribute of the picture file (.pic) or the Visual SCIL object file
(.vso) the object was loaded from.

The value is an empty string if the object has been created on-the-fly.

6.4.4.5 _OBJECT_CLASS GUID-A90066D5-AB33-475A-B26E-319BC278A73F v1

The class of the object.

70 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

Value type: Text


Value: The name of the class of the object

If the object is a window or picture function, the attribute has value "WINDOW" or
"PICTURE_FUNCTION", respectively.

6.4.4.6 _OBJECT_NAME GUID-EBC8F1CF-49D8-4B06-A7A1-F1FB7ADC1BB9 v1

The name of the object.

Value type: Text


Value: The name of the object

6.4.4.7 _OBJECT_PATH GUID-B33EC991-FB6A-405C-A5E1-44DA8B786380 v2

The path of the object.

Value type: Text


Value: The complete object path starting from the root,
For example, "ROOT\NBK_BOOK\NBP_PAGE\TRE_TREE"

6.4.4.8 _SG_GEOMETRY GUID-B050FEE3-F52B-4695-BC58-6267656E3412 v1

This attribute is applicable only for windows and picture functions.

Value type: List.


Value: Six attributes:
X X position of window/pf relative to part picture / picture function.
Y Y position of window/pf relative to part picture / picture function.
ABSOLUTE_X X position of window/pf relative to ROOT.
ABSOLUTE_Y Y position of window/pf relative to ROOT.
W Width of window/picture function in semigraphical characters.
H Height of window/picture function in semigraphical characters
W and H are 0 if window is not shown.

6.4.4.9 _SOURCE_FILE_NAME GUID-7366965D-1E7F-4C78-A826-D7D7F3EE6701 v1

The name of the file where the object is loaded from.

Value type: Text.


Value: The full operating system format name of the vso-file where the object has been loaded
from or the full name of the pic-file where the window or picture function has been read
from.

The value is an empty string, if the object is created on-the-fly, i.e. using .CREATE, !WIN_NAME or !
WIN_CREATE command.

6.4.4.10 _VARIABLE_NAMES GUID-9D6818AE-F85A-47C1-95D6-981C98624740 v1

The names of the variables seen by the object.

MicroSCADA X SYS600 10.5 71


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

Value type: Text vector.


Value: The names of global SCIL variables defined in the SCIL context that the object belongs
to.

The names are listed in alphabetical order.

6.5 Files GUID-269161B6-3404-42B4-83B7-1D320515A95F v1

This section describes the principles of naming files in SCIL language, and the different file types
accessible by SCIL programs.

Here, file type refers to the interpretation of its contents. The three file types supported by SCIL
programming environment are the following:

• Text files
• Binary files
• Keyed files

The file types are further described in the following sections. File management functions, that handle
entire files with no interpretation of the contents, are described in Section 10.17.

6.5.1 File naming GUID-65EB15E1-9AE6-47F6-AF6D-A2D55C1D983F v2

The files and directories used in SCIL language may be identified in several different ways, both
operating system dependent and independent ways. The SCIL functions and commands that take a
file a directory name argument, accept all these identifications unless otherwise noted in their
description.

In the following, the term SYS600 root is referred to. It is the root directory of the current SYS600
installation. In Windows, it is normally the directory C:\SC\, but the drive may be changed during
installation.

File and directory tags are abstract, operating system independent identifiers, that are formed from
textual file and directory names by means of file management functions described in Section 10.17.

A directory may be identified in one of the following ways:

• "/dir1/dir2/.../name/" names a directory relative to SYS600 root in an operating system


independent way, for example, "/APL/TIPPERARY/APL_/".
• By an operating system file path, for example, "D:\SC\APL\TIPPERARY\APL_\".
• By an operating system independent directory tag created from a SCIL directory name or an
operating system directory name.

A file may be identified in one of the following ways:

• "path/name" identifies a file contained in a logical path in an operating system independent way.
The logical paths are simple names given to a directory or a search list of directories. See
Section 9.2.4 for more information on logical paths.
• "name" identifies a file contained in the default directory of the SCIL context or in the logical path
derived from the file name. The default directory is normally the directory PICT below the root
directory of the SCIL application, but may be set by SCIL in the VS_MAIN_DIALOG object.
Outside the VS main dialogs, the so-called 4-letter rule is further applied: A file is first searched

72 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

for in the logical path named according to the 4 first letters of the file name. For example, file
APL_PROCES.PRD is searched for using the logical path "APL_".
• "/dir1/dir2/.../dir/name" names a file relative to SYS600 root in an operating system independent
way, for example, "/APL/TIPPERARY/APL_/FILE.EXT"
• By an operating system file path, for example, "D:\SC\APL\TIPPERARY\APL_\FILE.EXT".
• By an operating system independent file tag created from a file name given by any of the textual
ways above.

The file or directory name ('name' above) may be of any length and contain any characters allowed
by the operating system. However, as far as portability is concerned, names consisting of letters,
digits, underscores and a dot (as a separator of the file name extension) only are recommended.

6.5.2 Text files GUID-12E392FB-6D4E-4BC1-AD77-5FC7E094D8DB v2

Text files are sequential files organized as lines of text data. When a text file is read, the text is
supposed to be encoded via the Active Code Page (ACP) of the operating system unless the actual
text is preceded by a Byte Order Mark (BOM). UTF-8 and UTF-16 (both little and big endian) BOM's
are supported. By default, text files are written in UTF-8 encoding with a BOM. Optionally, the
functions WRITE_TEXT and WRITE_COLUMNS are capable to write ACP encoded text as well.

The lines are terminated by CR/LF (Carriage Return / Line Feed) character pair. When a text file is
read by SCIL, a single LF character is accepted as a line terminator and the terminator of the last line
of the file is not required.

Text file is read by the TEXT_READ or READ_COLUMNS function and written by the WRITE_TEXT
or WRITE_COLUMNS function. The entire file or a bulk of lines is read and written as a text vector by
these functions. Line lengths up to 65 535 characters are supported by the functions.

An obsolete function READ_TEXT is capable of reading only 255 character lines. It is supported for
upward compatibility, but new applications are encouraged to use the TEXT_READ function instead.

Parameter files are special purpose files of predefined format similar to INI files of used by various
utilities of Windows operating system. They are designed to save settings of tool programs from
invocation to another. SCIL functions READ_PARAMETER, WRITE_PARAMETER and
DELETE_PARAMETER implement the handling of parameter files. The format of parameter files is
described in Appendix B.

While a text file is being written, no other SCIL program may read or write the file. Consequently, if a
text file is used to pass data from a SCIL program to another SCIL program that may be executing in
parallel, the access of file should be synchronized between the programs, for example using function
FILE_LOCK_MANAGER.

For descriptions of functions mentioned above, see Section 10.16.

6.5.3 Binary files GUID-FCDAB027-C7E3-4DC4-956B-1D082EC158FF v1

Binary files are byte sequences of any length with no interpretation of structure. They can be used to
exchange data between a SYS600 application and any foreign application. Within SYS600 they are
used to store compiled SCIL programs and download/upload data of process objects of File Transfer
type.

A binary file is read by READ_BYTES function and written by WRITE_BYTES function. The entire file
or up to 8 388 600 bytes of data is read and written as a byte string by these functions.

While a binary file is being written, no other SCIL program may read or write the file. Consequently, if
a binary file is used to pass data from a SCIL program to another SCIL program that may be
executing in parallel, the access of file should be synchronized between the programs, for example
using function FILE_LOCK_MANAGER.

MicroSCADA X SYS600 10.5 73


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

For descriptions of functions mentioned above, see Section 10.16.

6.5.4 Keyed files GUID-9DA11992-DFD1-4027-9466-D81F8DA3B022 v1

6.5.4.1 General GUID-29741B98-207D-4636-88C9-D3C8E8240E51 v1

Keyed files are random access files that consist of data records. The maximum length of a data
record is 508 characters.

The beginning of the data record contains the key of the record. The key uniquely identifies the
record within the file. The length of the key is defined when a keyed file is created. The maximum
length of the key is 253 characters. The data records are logically ordered by the keys. The first
character of the key is the most significant in the ordering, the last character is least significant.
Hence, if the key contains a name, the records are alphabetically ordered.

Each data record must contain the key. Consequently, the minimum length of the data record is the
length of the key.

A data record can be read from a file by specifying its key, or the file may be browsed forward or
backward in the order specified by the record keys.

When a data record is written into the file, it is always positioned according to its key. If the same key
already exists in the file, the old data record is overwritten by the new one. The length of record may
change when it is rewritten.

Data records may also be deleted one by one by specifying the key to be deleted.

Concurrent access of keyed files by several SCIL programs is internally synchronized. Therefore,
they suit well for exchanging real-time data between SCIL programs. More than one program may
safely write and read a keyed file simultaneously.

6.5.4.2 Implementation GUID-52D7A599-3F7E-4522-8624-DC94CD984894 v1

The keyed files are implemented as a number of data blocks, index blocks and a status block.

The data blocks contain the data records of the file. Each data block contains a number of
consecutive (in the order specified by the key) data records organized in the order of the key.

The index blocks make up the index of data blocks in order to achieve fast access of data. An index
block contains a set of (key, block number) pairs, where the key is the first key of the data block
addressed by the block number. The pairs contained in an index block are again organized in the
order of the key. When the file grows, more than one index block is needed. Upper level index blocks
are then created. In the upper level index blocks, the block number addresses a lower level index
block instead of a data block.

The status block, which is the first block of the file, contains book-keeping information of the file,
such as the length of the key and address of the topmost index block.

When a new data record is written into the file (or an existing one is expanded), the index is first used
to locate the would-be data block for the record. If there is enough free space in the block, the data is
written into the block. Otherwise, the neighboring data blocks are examined. If there is enough free
space in the neighboring blocks to rearrange the old records and the new one into these three data
blocks, it is done. Otherwise, a new data block is created and its key is inserted in an index block.
The same procedure is then repeated for the index block.

When a data record is deleted from a file (or an existing one is shortened), the free space of a data
block grows. When it is possible to combine the data block with its neighbors, it is done and the freed
block is inserted in the free block list of the file for later re-use.

74 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

There are two internal implementations of keyed files:

• Version 1 file format uses 512-byte blocks. The size of the file is limited to 32 megabytes.
• Version 2 file format, first introduced in MicroSCADA revision 8.4.4, uses 4 kilobyte blocks and
has no file size restrictions.

Function KEYED_FILE_MANAGER (see Section 10.16) may be used to convert version 1 files to
version 2 and vice versa.

The same function may be used to two other maintenance purposes of keyed files:

• Subfunction COMPACT makes a reorganized copy of a keyed file. The new file is written in its
most compact form and the free space in the file is minimized. The resulting file may be smaller
and faster to access.
• Subfunction REBUILD makes a copy of a keyed file where the index structure is rebuilt from the
scratch. The source file is scanned sequentially, the data records found in the data blocks are
written to the output file and a new index is created for them. The index blocks of the source file
are skipped. This subfunction should be used, when the structure of a keyed file gets corrupted
for a reason or another, for example because of power fail of the computer. A corrupted file may
often be recognized by spurious FILE_INCONSISTENT (5015) errors got when reading the file.

6.5.4.3 Use GUID-BCEB1B7D-B7CF-46C2-890A-2DA7A0E2416B v1

Keyed files are widely used within SYS600 to implement various system files, including:

• Process database file APL_PROCES.PRD


• History database files APL_yymmdd.PHD and APL_yymmdd.PHI
• Report database files APL_REPORT.nnn
• Picture files *.PIC
• Representation library files *.PIR
• SCIL database files *.SDB

For application specific purposes, keyed files may be used by file handling commands described in
Section 9.2.5.

6.6 SCIL databases GUID-0618C7A9-422A-4A58-83B4-730F6A5CFFDE v1

6.6.1 General GUID-51D10DA4-8079-46C4-AE7D-CFB659D5D816 v1

A SCIL database is a data file for general purpose. It is internally structured to store any data
structure that may be created by SCIL language. The file is divided into sections. Each section has a
value that may be of any SCIL data type. The size of a SCIL database file is limited only by the
available disk space.

The structure of SCIL database is optimized for fast access. The component to be read is located
quickly by using indices without having to search through the file. Similarly, writing a new value to a
component rewrites only a minimal part of the file.

The concurrent use of SCIL database by two or more SCIL programs is internally synchronized. In
addition, each read and write operation is atomic. For example, if one SCIL program writes a list type
data structure into the database, the concurrent readers see all the new attribute values or none of
them. Because of the strict access discipline, SCIL databases suit perfectly for sharing SCIL data in
real-time between various SCIL programs of the application (in pictures, Visual SCIL objects,
command procedure objects etc.).

SCIL databases and parameter files (so called ini files handled by functions READ_PARAMETER,
WRITE_PARAMETER and DELETE_PARAMETER) have some similarities, but at the same time

MicroSCADA X SYS600 10.5 75


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 6 1MRK 511 664-UEN Rev. A
Objects and files

some important differences. For some comparison of SCIL Database and parameter files, see the
table below:

Property SCIL database Parameter file


Structure Indexed Text lines
Data encoding Binary, cannot be viewed with text Plain text, can be viewed with text
editor editor
Maximum size No limit Limited by the SCIL vector length
Data item data types All SCIL data types Text only
Size of data items Unlimited About 65 000 characters
Speed of access Fast Slow, when the file is big
Concurrent access by several SCIL Yes No
programs

6.6.2 Versions GUID-E03A1E2B-4CE5-4B44-8027-BD957D3DA0D0 v1

There are two slightly different implementations of SCIL database files:

• Version 2 implementation was introduced in MicroSCADA 8.4.5.


• Version 3 implementation was introduced in MicroSCADA 9.0. For the user’s point of view, it is
equivalent to version 2, but internally it has been optimised for faster access.
• (Version 1 implementation was never used in any released product.)

The version of a SCIL database file is seen as an attribute of the result of the
DATA_MANAGER("OPEN") function call, see Section 10.16.

When MicroSCADA 9.0 or later is used, version 3 files are created by default. If a 9.0 system or later
is frequently used to create SCIL databases for an 8.4.5 system, this behavior may be overridden by
the revision compatibility switch CREATE_VERSION_2_SCIL_DATABASES in the application
attribute APL:BRC, see the System Objects manual, or in the SCIL function
REVISION_COMPATIBILITY, see Section 10.9.

When running MicroSCADA 9.0 or later, SCIL database files may be converted from version 2 to 3
(for faster access) or vice versa (for 8.4.5 compatibility) by using the DATA_MANAGER("COPY")
function, see Section 10.16.

6.6.3 Access GUID-6F1A93BC-2844-4E4A-9689-9ADF88A14844 v1

The SCIL database is divided into sections (the same way as the parameter files). The names of the
sections are free texts, they may contain any number of characters and are case-sensitive. A zero-
length section name is allowed.

A section has a value, which may be of any SCIL data type. The value may be read and written as a
whole or only a component of it is accessed at a time.

In most cases, there is a need for more structure than the sections provide. An obvious way of
getting more structure is to define the section as a list value, whose attributes may be of any data
type.

If the database is used by several SCIL programs at the same time, the structure of the data should
be carefully designed. See an example of this below.

If a section contains a value of a process object along with its time stamp and status, one possibility
is to define three attributes in the section, for example OV, RT and OS, respectively. When a SCIL
program updates the value, it has to do 3 writes into the database (unless it rewrites the whole
section).

76 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 6
Objects and files

Now the reader of the data may encounter a problem. On one hand it is possible, for example, that it
reads the new value of OV but the old values of RT and OS (if it runs faster than the writer). On the
other hand, it might be that it reads the old value of OV but the new values of RT and OS (if it runs
slower).

A solution to this problem is to define only one attribute, for example VALUE, and make it a list of
attributes OV, RT and OS. This attribute may now be read and written in one atomic operation.

SCIL databases are managed and accessed by the SCIL function DATA_MANAGER, which is
described in Section 10.16.

6.6.4 Use GUID-3D983FFF-0127-4C40-AF59-77E4AAFD02EA v1

SCIL databases are suitable for storing application specific data and sharing it in real time between
concurrent processes. The following four SCIL databases are used (and automatically created) by
the base system:

• Common purpose application database APL_DATA.SDB


• Application text database APL_TEXT.SDB
• System text database SYS_TEXT.SDB
• OPC Name Database APL_OPCNAM.SDB

For fastest possible access, these files are kept permanently open by the base system.

MicroSCADA X SYS600 10.5 77


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
78
1MRK 511 664-UEN Rev. A Section 7
Variables

Section 7 Variables GUID-17334956-9570-4F86-9E52-9161263D5786 v1

This section describes the use of variables in SCIL:

Section 7.1 General: Variable names and scope of variables


Section 7.2 Local variables
Section 7.3 Global variables
Section 7.4 Using variables
Section 7.5 Predefined picture variables

7.1 General GUID-44F33771-8B43-4F4F-BEEB-5B1FC2F30255 v1

Contrary to constants, the variables have no fixed values. A variable is a name which may be
assigned any value. After the assignment, the variable name represents this value within the scope
of the variable.

Any SCIL data type (Section 5) is allowed as a value of a variable. When speaking of the data type of
a variable, the data type of its current value is meant. The value of a variable, also its data type, may
be changed at any time by new assignment.

7.1.1 Variable names GUID-C1F61DCD-10C9-4808-8F6B-BEE047D684BC v1

The variable names may be freely chosen in accordance with the rules in Section 4.2. The variable
names may contain up to 63 characters.

7.1.2 Scope of variables GUID-4D4C8044-185F-40E6-A22A-ED5C2B0170F5 v1

There are two types of variables in SCIL language: local and global variables.

The local variables are temporary variables that are available only within the SCIL program where
they are declared. They exist only while the SCIL program is executing.

The global variables are permanent variables that are available for any program executing within the
SCIL context where they were created. They exist during the entire life time of the SCIL context (see
below).

7.2 Local variables GUID-3320827E-79DB-4564-B743-5858814C3A48 v1

Local variables are declared by #LOCAL statement (see Section 9.2) at the beginning of a SCIL
program and destroyed automatically when the program terminates.

Local variables are visible only in the SCIL program that contains the declaration. The same variable
name may be declared by several SCIL programs, each declaration denotes a new variable. If a
SCIL program recursively calls itself, each invocation has its own local variables.

Within the SCIL program, a local variable is referenced simply by its name, no special characters are
needed.

Arguments of a SCIL program act as read-only local variables in the program, see #ARGUMENT
statement in Section 9.2.

MicroSCADA X SYS600 10.5 79


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 7 1MRK 511 664-UEN Rev. A
Variables

7.3 Global variables GUID-B9861029-01BE-494C-B325-78FB49288D3C v1

Unlike local variables, global variables need no declaration. A global variable is created automatically
when it is assigned a value first time. It is deleted when the SCIL context containing the variable is
deleted, see below. Global variables may also be deleted explicitly with the #DELETE command.

A global variable is visible for all SCIL programs executing in the SCIL context during its entire life
time.

In a SCIL program, a global variable is referenced by its name prefixed by character %, when
reading its value, or by character @, when assigning it a new value.

7.3.1 SCIL contexts GUID-162D2615-1797-4335-8C50-C858EAE2A4EE v1

A SCIL context is actually an internal data structure that contains the global variables, logical paths
and logical representation libraries defined by SCIL programs executed within the context. A SCIL
context is created when certain objects start their execution and is deleted when they terminate.

The following objects execute in their own SCIL context:

• A picture (whether printed or displayed on the screen). All programs, windows and sub-pictures
within the same picture share the SCIL context of the picture. A variable defined in a window
picture, for example, can be used in the main picture, and vice versa. If window specific
variables are desired, use window attributes instead of variables (see Section 6).
• A dialog system. All dialogs and pictures within the same dialog share the SCIL context of the
main dialog or the picture container. Hence, for example, variables defined in the main dialog
can be used in all its child dialogs and dialog items. If either dialog or dialog item specific
variables are desired, use the user defined attributes (see Section 6).
• A command procedure and data object started with #EXEC or #EXEC_AFTER or by an event
channel.
• A time channel. Data objects and command procedures run by the time channel share the SCIL
context of the time channel. Hence, variables defined in command procedures may be used by
command procedures and data objects executed later by the same time channel.

A SCIL context is normally created as empty: no variables, logical paths nor logical representation
libraries defined. There are the following exceptions to this rule:

• Objects activated by #EXEC, #EXEC_AFTER, #PRINT or #LIST command inherit the logical
paths and logical representation libraries of the activating SCIL context.
• Argument variables may be passed to objects by means of #EXEC, #EXEC_AFTER and
#PRINT commands (see Section 9.2).
• Event channels and format pictures activated by process events and format pictures printed by
#LIST command start with a set of variables created from attribute values of the process
objects, so called ‘snapshot variables’.
• Pictures have a few predefined variables created automatically (see Section 7.5).

7.4 Using variables GUID-A1AA7E36-4374-4247-AC3D-0B4456C830A1 v1

7.4.1 Variable assignment GUID-15BE2CE9-89F5-41D9-8423-F264720BCD11 v1

Variables are assigned values with an assignment statement of the following syntax:
GUID-984CB87E-738D-4BA5-A06B-D0B28C7054EC v1
[@]V[component]* = expression

where 'V' is the variable name. If it is prefixed by @, a global variable is accessed, otherwise a local
variable.

80 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 7
Variables

Each 'component' addresses a component of structured data (an element or a range of elements of a
vector or an attribute of a list). See Section 5.11 for component access.

The expression, which may be of any data type, is evaluated and the value is assigned to the
variable or to its component.

(If the expression is a text constant, a global variable assignment may also be written without the
equal sign as follows:
GUID-7D1A412C-7B37-492C-8B7E-55BDF56FEA5C v1
@V character string

which is the same as the statement @V = "character string", except that in the first case lower case
letters are converted to upper case. This is an obsolete feature that is no longer recommended.)

7.4.2 Examples GUID-9471465E-C440-4754-B860-836F4552A8ED v1

Statement Explanation
@VAR = ABC:PAI The value of the process object is read from the process database
and assigned to the variable.
TEXT = "ABC:PAI" The object value is not read. The variable gets the text value
"ABC:PAI".
@LIST = PROD_QUERY(20) The variable LIST is assigned the list value formed by function
PROD_QUERY.
A.EXISTS = FALSE Attribute EXISTS of list variable A is set to FALSE.
@V = DATA:D(1 .. 20) Variable V becomes a vector containing the first 20 registered values
of the data object DATA.
V(1 .. 5) = D1:D(1 .. 5) + D2:D(1 .. 5) The first five elements in variable V are assigned the values of the
sums of the first five registered values of the data objects D1 and D2.
A = (5, 4, OBJ:POV3, CLOCK) The variable A becomes a vector of four elements.

7.4.3 Using variables in expressions GUID-E07B3E7F-2107-4589-BE41-5352DA990835 v1

After a variable has been assigned a value, this value is referred to as:
GUID-26589338-D3F0-4A50-901B-8364A7500E7A v1
[%]name[component]*

where 'name' is the variable name. If it is prefixed by %, a global variable is accessed, otherwise a
local variable or an argument.

Each 'component' addresses a component of structured data (an element or a range of elements of a
vector, or an attribute of a list). See Section 5.11 for component access.

This notation can be used as an operand in expressions. The data type of the variable determines
which operations may be carried out on it (Section 8).

7.4.4 Examples GUID-548072D9-D31C-43F3-B9AE-D4C0DF9DDAF5 v1

Statement Explanation
@NEW = 30 * %OLD The variable NEW is assigned the value of the variable OLD
multiplied by 30.
A.COUNT = A.COUNT + 1 The COUNT attribute of list variable A is incremented.
!SHOW WIN VAR The whole vector is shown in the window WIN, which must be of the
type MULTIFIELD, BAR or CURVE.
@S = %A(1) + %A(2) The sum of the elements one and two in variable A.

MicroSCADA X SYS600 10.5 81


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 7 1MRK 511 664-UEN Rev. A
Variables

7.4.5 Variable expansion GUID-6D25C5F6-6FD3-4474-B015-0E0A4BBF574B v1

Variables can also be used for forming text strings and names. By including a variable in a name or
text string, different contents can be assigned to the text or name depending on the context. To use a
variable as a part of a text or name, enclose the variable name by quotes as follows:
GUID-3E84746C-65C2-46F7-A23C-49A2DBDA408A v1
'name[.attribute]'

The value of the variable 'name' or the value of its attribute 'attribute' is regarded as a text constant
that replaces the quote notation. The value must be of data type integer, real, text, boolean (0 for
FALSE, 1 for TRUE is expanded) or time (yy-mm-dd hh:mm:ss is expanded). If a local variable by
name 'name' exists, it is used for expansion, otherwise global variable by that name.

This way of using variables is called variable expansion. Not only variables but also window
attributes and Visual SCIL object attributes can be expanded, provided that they are of proper data
type. In this case 'name' is a window or a Visual SCIL object reference.

7.4.6 Examples GUID-72047D04-AD0D-4223-A886-83F7A37AA104 v1

Statement Meaning
LN = "P_METER" The variable LN is assigned the text value "P_METER" and the
IX = 22 variable IX value 22
PRESSURE = 'LN':PAI’IX’ The variable PRESSURE is assigned the AI attribute value of the
process object P_METER with index 22.
OBJ = LIST(LN = “P_METER”, IX = 22) Same as above but using attributes.
PRESSURE = ‘OBJ.LN’:P’OBJ.IX’

7.5 Predefined picture variables GUID-1686C849-D045-414C-81E8-2BD31BCAAB33 v2

There are some picture variables with predefined names and meanings. These variables can be
used in pictures throughout the system, but their values depend on the circumstances in which they
are used. The predefined picture variable names are:

VIDEO_NR The logical monitor number of the current monitor. The variable is the same as MONn:BAN. It can
gain integer values in the range 1 ... 100. The monitor number is selected when an application
session is started. This variable should not be changed manually.
PIC_NAME The name of the picture (main picture) displayed on screen at the moment. The variable can have
text values containing a max. of 10 characters. This variable should not be changed manually.
CURSOR_PO This variable contains the coordinates of the cursor position of the last function key selection. It is
S always updated when a function key is selected, except when the system is in input mode (after
the !INPUT_VAR, !INPUT_POS or !INPUT_KEY commands). The variable is used, for example,
when building line command keys, see Section 8.
The variable is a vector with four elements:
(x, y, x_rel, y_rel)
where
x, y = the coordinates relative to the upper left corner of the picture, which is (1,1). x = 1 ... 80, y =
1 ... 48.
x_rel, y_rel = coordinates related to the upper left corner of the window where the cursor is
situated, which is = (1,1).
KEY_POS This variable contains the coordinates of the last function key selection related to the upper left
corner of the key. The variable is updated each time a function key is selected. The variable is a
vector of two elements:
(x_rel, y_rel)
Table continues on next page

82 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 7
Variables

where
x_rel, y_rel = coordinates relative to the upper left corner of the key, which is (1,1).
ENTER_POS This variable contains the coordinates of the last click on an ENTER key. The variable is updated
each time a function key containing an !ENTER command which terminates !INPUT_VAR is
pressed, no matter whether the ENTER key contains other statements or not. The variable is a
vector of four elements:
(x, y, x_rel, y_rel)
where
x, y = coordinates related to the upper left corner of the picture (=1,1).
x_rel, y_rel = coordinates related to the upper left corner of the window in where the ENTER key is
situated (= 1,1).

7.5.1 Examples GUID-E78DB86E-2A5B-43B2-AE78-76550C9B0854 v1

Statement Meaning
#EXEC EVENT_'VIDEO_NR':E An event object containing the video number is activated.
#ON EVENT_'VIDEO_NR':E !SHOW .... In combination with #ON sequences, likewise defined
with video number, the event is directed to the same
monitor.
#IF %CURSOR_POS(2) = 40 #THEN ...... A statement is executed on the condition that the
pressed line is number 40.
#PRINT 1 'PIC_NAME' The current screen picture is printed.

MicroSCADA X SYS600 10.5 83


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
84
1MRK 511 664-UEN Rev. A Section 8
Expressions

Section 8 Expressions GUID-FA6AED5B-D7B7-4A9F-B0B0-2730BBBF3B47 v1

This section describes how to compose SCIL expressions using various types of operands and
operators. Special purpose context sensitive expressions defined by SCIL Data Derivation Language
are also described.

Section 8.1 General principles


Section 8.2 Arithmetical operators
Section 8.3 Relational operators
Section 8.4 Logical operators
Section 8.5 SCIL Data Derivation LanguageSCIL Data Derivation Language (SDDLSDDL)

8.1 General principles GUID-0C6A4636-033A-49FD-B12B-67E9E2C3116D v1

8.1.1 Use GUID-ECAA9120-E1D3-416A-97A1-FC99C6755703 v1

In SCIL, expressions are used as follows:

• for value assignments (objects, attributes, variables)


• as arguments for functions and commands
• as operands in expressions

8.1.2 Composition GUID-1A19A3B3-C408-4E6B-8003-82DA341BEA5A v2

Expressions are composed of operands and operators (possibly enclosed in parentheses). The
operators are symbols for operations (for example, + : addition). The operands constitute the objects
of these operations.

8.1.3 Operands GUID-81512C3C-01D0-483F-8BE4-66F8DE4F76DD v1

An operand may be:

• a constant (Section 5)
• a variable or a component of a variable (Section 7)
• a system or application object attribute or its component (Section 6)
• an attribute of a Visual SCIL or window object or its component (Section 6)
• a function call (Section 10)
• a vector or a list aggregate (Section 5)
• a named program or a method call, provided that the program returns a value (Section 6)
• an expression enclosed in parentheses

The simplest expression is one single operand.

The data types of the operands determine which operations may be carried out on them and what
the data type of the result will be. The data compatibility rules for each operator are given in figures
below. List type operands cannot be operated upon by any operator. The list data type is therefore
omitted from the compatibility rule figures. The data type of an expression can be read with the
function DATA_TYPE (see Section 10).

MicroSCADA X SYS600 10.5 85


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 8 1MRK 511 664-UEN Rev. A
Expressions

8.1.4 Operators GUID-62A46D76-B4BA-41FA-8B3B-360ECD2EE3B0 v1

There are three types of SCIL operators:

• arithmetical operators
• relational operators
• logical operators

In SCIL expressions, they are evaluated in the order of priority mentioned below.

The operators and their usage are described in the next sections.

8.2 Arithmetical operators GUID-F5847C9B-8FE0-4FFA-B7C3-3F24CA25AA43 v1

8.2.1 Use GUID-6E613801-2EE9-406A-9569-B179D48A1F6E v1

Arithmetical operators are used for numerical calculations. As operands, they expect numeric values,
except for addition, which accepts text, bit string and byte string operands as well (Figure 10).

8.2.2 Operators GUID-8B7B612A-31C8-4213-8B64-68C21FA32227 v1

SCIL has the following arithmetical operators:

+ addition, positive sign


- subtraction, negative sign
* multiplication
/ division
** exponential operator
DIV integer division, the remainder is truncated from the result
MOD modulus operator (the remainder by integer division provided that the operators are
positive).

The operators DIV and MOD must be enclosed by spaces. For the other operators, spaces are
optional.

Signs are valid for numeric data types (integers, real numbers and vectors of integers and real
numbers) only.

8.2.3 Priority order GUID-2CB85835-BE11-4AC1-A572-0DEB3F1FBCBA v1

The order of priority for arithmetical operators, i.e. the order in which different parts of an expression
are evaluated, does not differ from that in mathematics. It is as follows (operators with the highest
priority first):
GUID-0E9F42B5-5EA1-4C1D-86D6-DA83C83D3F4C v1
1) **
GUID-24F79794-A4EA-4D55-AAAB-1B761F46F53A v1
2) / , * , DIV , MOD
GUID-B81B4B65-E927-4D90-9932-BEC8AF993CC9 v1
3) + , -

Operations with the same order of priority are evaluated from left to right.

86 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 8
Expressions

8.2.4 Compatibility rules GUID-C864C2EF-367F-46E6-844A-34F648CA5674 v1

Below are rules for which data types can be combined by means of the arithmetical operators and
the data type of the resulting value.

GUID-93E895B3-A3FE-4DB1-A2B1-090793CBEC5C V1 EN-US

Figure 10: Addition rules

GUID-99779811-2DCB-4A54-BE5B-A77BB6375A64 V1 EN-US

Figure 11: Subtraction rules


When adding a numeric (integer or a real) operand to a time operand, or subtracting it from a time
operand, the numeric operand is considered as seconds and the result is a moment of time specified
number of seconds in the future or in the past.

When two time type operands are subtracted, the result is an integer number stating the time
difference in seconds.

The result of adding two texts, two bit strings or two byte strings is the concatenation of the two
strings.

When one operand is a simple value and the other one is a vector, the operation is carried out
element by element and the result is a vector.

When both operands are vectors, the operation is carried out element by element and the result is a
vector of the length of the longer operand. If the vectors are different in length, the missing elements
of the shorter vector are regarded as zero or an empty string (depending on the data type of the odd
element) and the status of the result element is set to SUSPICIOUS_STATUS.

MicroSCADA X SYS600 10.5 87


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 8 1MRK 511 664-UEN Rev. A
Expressions

GUID-B2A27F3E-2569-444F-8ABF-28465AE6FE0F V1 EN-US

Figure 12: Multiplication rules

GUID-D7E7AEE7-015A-449D-A498-A1E37EB98B65 V1 EN-US

Figure 13: Division rules

GUID-9CB498FB-85C5-4F3D-8E7D-FC82F38A8E5F V1 EN-US

Figure 14: DIV and MOD rules


When one operand is a simple value and the other one is a vector, the operation is carried out
element by element and the result is a vector.

When both operands are vectors (allowed only in multiplication), the operation is carried out element
by element and the result is a vector of the length of the longer operand. If the vectors are different in
length, the missing elements of the shorter vector are regarded as 1 and the status of the result
element is set to SUSPICIOUS_STATUS.

A vector cannot be divided by another vector.

88 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 8
Expressions

GUID-30F5C8C6-8A03-42D7-80AD-0E21518F05BF V1 EN-US

Figure 15: Exponent rules


If both operands are integers and the right operand is non-negative, the result is an integer. For
example, (-2)**3 evaluates to integer -8.

8.2.5 Examples GUID-B2D5439C-F9DF-41E8-BE78-7846FAA6E16A v1

Below are some examples of arithmetical operations. The bit string operands are written here by
means of the BIT_SCAN function, which creates a bit string out of its text representation.

Expression Result
"A" + "B" "AB"
3**2 9
3.0**2 9.0
5 DIV 2 2
5 MOD 2 1
2*3 + 4/2 8.0
(2*3 + 4)/2 5.0
BIT_SCAN("0101") + BIT_SCAN("0011") BIT_SCAN("01010011")

8.3 Relational operators GUID-76F22A4F-13BF-4FC6-9AB0-5C70A41C277E v1

8.3.1 Use GUID-9C02EC67-A46E-4C4F-93E1-762BE7A95B05 v1

Relational operators are used for comparing expressions. The result of a comparison is always a
boolean value, i. e. the value of a relation is either TRUE or FALSE.

8.3.2 Operators GUID-44A4D60F-2DE6-4D41-9C1C-43EE1FA2FFEC v1

The following relational operators are available in SCIL:

== equal to
> greater than
< less than
<> unequal
<= less than or equal to
>= greater than or equal to

MicroSCADA X SYS600 10.5 89


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 8 1MRK 511 664-UEN Rev. A
Expressions

The relational operators have a lower order of priority than the arithmetical operators. Accordingly,
arithmetical expressions are evaluated before comparisons are carried out.

8.3.3 Compatibility rules GUID-5BF64956-1863-4B21-8F8E-95A603C0C50E v1

Figure 16 presents rules for what data types may be compared by means of relational operators.

GUID-558F4FC1-5582-4526-A0D1-6464010E269B V1 EN-US

Figure 16: Rules for relational operators


Comparison of text expressions is based on the Unicode presentation of each character, a number in
the range 0 ... 65 535. The character codes are ordered so, that the digits (0 .. 9) precede the letters,
the letters A - Z are arranged in alphabetical order and the uppercase letters A - Z precede the lower-
case letters a - z. Comparison does not follow the current locale.

Boolean values and text may be compared only with values of the same data type. Time data can be
compared to time data, integer and real values.

Bit strings are compared bit by bit starting from the leftmost bit, which is the most significant bit. If two
bit strings of different length are identical to their common length, the shorter one is considered
smaller.

Byte strings are compared numerically byte by byte (each byte has a value 0 ... 255), the first byte
being the most significant. If two byte strings of different length are identical to their common length,
the shorter one is considered smaller.

Vectors cannot be compared by relational operators.

8.3.4 Examples GUID-123E1AAE-56F2-4EF5-A546-2D2CE076E834 v1

Below are some examples of expressions containing relational operators.

Expression Result
"B" > "A" TRUE
%A - 30 == 0 TRUE, if %A == 30
OBJ:PRT + 60 >= CLOCK TRUE, as long as less than one minute has
passed since the latest registration time
BIT_SCAN("0011") < BIT_SCAN("0101") TRUE
BIT_SCAN("0101") < BIT_SCAN("010101") TRUE
BIT_SCAN("000111") < BIT_SCAN("0101") TRUE
BIT_SCAN("010100") > BIT_SCAN("0101") TRUE

90 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 8
Expressions

8.4 Logical operators GUID-E68E6FB8-80A5-4E55-9750-6AE8EC4C8D6E v1

8.4.1 Use GUID-DAB67E2D-AE88-48D7-AC8C-559ED98841F6 v1

With logical operators, boolean values can be operated upon.

8.4.2 Operators GUID-A857F808-5E73-46B1-9FBC-786B8965F87B v1

In SCIL there are the following logical operators:

AND conjunction, "both .. and"


OR disjunction, "or"
XOR exclusive or, "either, but not both"
NOT logical negation, the opposite

Logical operators have a lower order of priority than the relational operators, that is, relational
expressions are evaluated before the logical operations are carried out. Logical operator NOT takes
precedence of the other logical operators.

If an expression contains two or more different logical operators from the set (AND, OR, XOR),
parentheses are required to explicitly specify the order. See the example below.

8.4.3 Compatibility rules GUID-AC64B1CC-BC4E-4E2E-83CC-4AC76F51BE10 v1

All logical operators expect operands of boolean type. Likewise, the results of logical operations are
of boolean type.

8.4.4 Examples GUID-1941B3D5-6D08-4CE8-B349-7CF7C3C890B0 v1

Imagine that A and B are boolean data with the values shown to the left. The logical operators give
the following results:

A B A AND B A OR B A XOR B NOT A


TRUE FALSE FALSE TRUE TRUE FALSE
FALSE TRUE FALSE TRUE TRUE TRUE
TRUE TRUE TRUE TRUE FALSE FALSE
FALSE FALSE FALSE FALSE FALSE TRUE

Wrong: A == 1 AND B == 2 OR C == 3
Right: (A == 1 AND B == 2) OR C ==3
or A == 1 AND (B == 2 OR C == 3)

8.5 SCIL Data Derivation Language (SDDL) GUID-E8588EB1-D3E9-40A3-9FA5-2A7A005268DD v1

8.5.1 General GUID-5073AEB4-9381-4F8F-BA13-29DA42B6A5F8 v1

SCIL Data Derivation Language (SDDL) is a language used to describe a data value calculated from
context variables by using predefined SCIL operators and functions. The rule for calculating the data
value is given as an SDDL expression.

MicroSCADA X SYS600 10.5 91


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 8 1MRK 511 664-UEN Rev. A
Expressions

The values of context variables are defined by the context where the value is evaluated. Typically,
the context is a SYS600 object and context variables are attributes of the object. Some other context
variables may be defined by the use case, for example APL and SYS, which represent the
application and system object containing the context.

The language is designed in a way that allows for the calculation of the data value in a predictable
time and deep in the database within the database lock. Consequently, an SDDL expression can be
calculated, for example, as a part of the atomic transaction generated by an external event.

8.5.2 Relation to SCIL language GUID-DBD391D3-0196-4BBD-876D-682C2FF067FF v1

Syntactically, an SDDL expression is similar to an expression of SCIL. Context variables are used in
the same way as local variables are used in SCIL.

An SDDL expression is not allowed to access any data outside its context. Therefore, it may not
contain any direct references to MicroSCADA objects (such as MY_OBJECT:POV1) nor references
to SCIL program components (such as global variables or Visual SCIL objects). Furthermore, it may
not call any SCIL function that accesses data outside the context.

Variable expansions are not allowed in an SDDL expression.

8.5.3 Context variables GUID-43B3DE7E-75E9-4E57-9CFC-43F5733BDB93 v1

Context variables share the name and value of the attributes of the context object.

In addition to the attributes of the context object, the following predefined context variables are
declared:

APL The base system object (APL:B) of the containing application.


SYS The base system object SYS:B
TYPE The object type of the context ("P", "IX", "X", "H", "F", "D", "C", "T", "A" or "G")
SUBTYPE The subtype of the object, for example "BI", "AI", "NOD".

Context variables TYPE and SUBTYPE are available in any SDDL expression. Visibility of variables
APL and SYS depends on the use case.

8.5.4 SDDL expression properties GUID-4E14734F-925F-4573-8445-F4B86F4B136C v1

An SDDL expression is deterministic, if it always evaluates to the same value when the values of
context variables are the same. For example, a deterministic SDDL expression may not contain a
RANDOM function call. As another example, an SDDL expression containing an HOUR function call
(without arguments) is not deterministic, but HOUR(RT) is a deterministic SDDL expression.

An SDDL expression is static, if its context variables refer only to the configuration attributes of the
context object, otherwise it is dynamic.

An SDDL expression may not contain any function call that has or may have side effects. Good
examples of functions with possible side effects are OPS_CALL and DO.

8.5.5 Examples GUID-B69DEEDB-9B9F-4B65-ACF3-C80E44926AF0 v1

Example 1

SDDL expression

92 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 8
Expressions

APL.NA + ":" + LN + "." + dec(IX, 0)

defines a string data, which combines the application name, process object name and index to one
string. APL, LN and IX are context variables.

This SDDL expression could be used as the NP (Name Pattern) attribute of a logging profile object,
see the Application Objects manual.

Example 2

SDDL expression

(IL.BAY == "MyBay") and (IU == 1)

defines a boolean data, which tells whether the context object belongs to bay MyBay and is in use, or
not.

Example 3

SDDL expression

if(OS == 0, "Good", "Not so good")

results in text "Good", if the status of the context object is 0, otherwise in text "Not so good".

Example 4

SDDL expression

join(".", IE)

presents the object identifier of the object as dot separated fields.

MicroSCADA X SYS600 10.5 93


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
94
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

Section 9 SCIL statements GUID-BD22CD87-4BB1-4680-8B90-E81D38FACBE6 v1

This section describes the SCIL statements. It is divided into four sections as follows:

Section 9.1 General: The different types of SCIL statements, their arguments, and a table over all general
SCIL statements, Visual SCIL commands and picture commands.
Section 9.2 General SCIL statements: The statements listed and described.
Section 9.3 Visual SCIL commands: The Visual SCIL commands listed and described.
Section 9.4 Picture handling commands: The picture handling commands listed and described.

9.1 General GUID-589385D4-060A-4BF2-9ADE-80EC70A31D73 v1

9.1.1 Types of SCIL statements GUID-7A02BBEC-D19D-48A7-AD91-0B62BD28A196 v1

There are five main types of SCIL statements (imperative, one-line statements are normally called
commands):

• General SCIL statements. These are the basic SCIL statements that control the program flow,
assign values to variables, access various system components such as system and application
objects and files, etc. General SCIL statements are characterized by a starting # (number sign)
and they can be used in all types of SCIL programs.
• Visual SCIL Commands. These commands operate on user interface objects (Visual SCIL
objects, windows and picture functions) and often affect the visual appearance of the screen.
Visual SCIL commands are characterized by a starting period (.) and they can be used in
dialogs and pictures displayed in a VS (Visual SCIL) monitor.
• Picture commands. These commands operate on various components of pictures: windows,
picture functions, function keys, etc. Picture commands are characterized by a starting !
(exclamation mark) and allowed only in pictures.
• Primitive graphics commands. These commands are used to draw graphical elements, such as
lines, circles and text, on the screen. Primitive graphics commands can be used in pictures and
Visual SCIL objects. The graphics commands are described in Section 11.

9.1.2 Arguments GUID-AC0EA271-E312-4479-9184-E8092E99B7F5 v1

Most commands require arguments to become complete statements. The arguments specify the
command with operands or key words. In this section, the commands are written in uppercase letters
and the arguments in lowercase letters. Arguments in square brackets [] are optional. Argument
enclosed by []* may be repeated a number of times or it may be omitted. There must be at least one
space character between a command and its arguments.

9.1.3 Overview GUID-D7205EE0-8F6B-41A6-AF26-1DE68B1F1FF9 v1

Table 2: General SCIL statements and Visual SCIL commands.

Statement Brief Description Page


Assignment statement Assigns a value to a variable. Section 9.2.1.1
#ARGUMENT Declares arguments of the program. Section 9.2.1.2
#BLOCK , #BLOCK_END Compounds statements into one. Section 9.2.1.3
#CASE, #CASE_END Multibranched conditional execution. Section 9.2.1.4
Table continues on next page

MicroSCADA X SYS600 10.5 95


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

Statement Brief Description Page


#CLOSE_FILE Closes a keyed file. Section 9.2.5.1
#CREATE Creates a new application or base system object. Section 9.2.2.1
#CREATE_FILE Creates and opens a new keyed file. Section 9.2.5.2
#DELETE Deletes an application object. Section 9.2.2.2
#DELETE_FILE Deletes a file. Section 9.2.5.3
#DO Executes the SCIL program given as an argument. Section 9.2.1.5
#ELSE Conditional execution. Section 9.2.1.8
#ELSE_IF Conditional execution. Section 9.2.1.8
#ERROR CONTINUE, #ERROR Defines the error handling policy. Section 9.2.1.6
EVENT #ERROR IGNORE, #ERROR
STOP
#ERROR RAISE Raises a SCIL error. Section 9.2.1.7
#EXEC Queues an application object for execution. Section 9.2.2.3
#EXEC_AFTER Queues an application object for execution after a time delay. Section 9.2.2.4
#GET Updates process object values. Section 9.2.2.5
#IF Conditional execution. Section 9.2.1.8
#INIT_QUERY Initiates a process query. Section 9.2.2.6
#LIST Prints process object data. Section 9.2.3.1
#LOCAL Declares local variables of the program. Section 9.2.1.9
#LOOP, #LOOP_END Executes a sequence of statements in a loop. Section 9.2.1.10
#LOOP_EXIT Interrupts a loop. Section 9.2.1.12
#LOOP_WITH, #LOOP_END Executes a loop a number of times. Section 9.2.1.11
#MODIFY Changes an application object definition. Section 9.2.2.7
#ON Declares a program block to be executed when an event occurs. Section 9.2.1.13
#ON ERROR Defines an error handler. Section 9.2.1.14
#ON KEY_ERROR Defines a key error handler. Section 9.2.1.15
#OPEN_FILE Opens a keyed file. Section 9.2.5.4
#OTHERWISE Multibranched conditional execution. Section 9.2.1.4
#PATH Defines a logical path. Section 9.2.4.1
#PAUSE Takes a pause. Section 9.2.1.16
#PRINT Prints a picture. Section 9.2.3.2
#READ Reads a data record from a keyed file. Section 9.2.5.5
#READ_KEYS Reads the keys of a keyed file. Section 9.2.5.6
#READ_NEXT Reads a data record from a keyed file. Section 9.2.5.7
#READ_PREV Reads a data record from a keyed file. Section 9.2.5.8
#REMOVE Deletes a data record from a keyed file. Section 9.2.5.9
#RENAME_FILE Renames a file. Section 9.2.5.10
#REP_LIB Defines a logical representation library. Section 9.2.4.2
#RETURN Stops the program execution and returns a value to the caller. Section 9.2.1.17
#SEARCH Initialises a search among objects. Section 9.2.2.8
#SET Assigns a value to an attribute of an object. Section 9.2.2.9
#SET_TIME Sets the system time. Section 9.2.1.18
Table continues on next page

96 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

Statement Brief Description Page


#WHEN Multibranched conditional execution. Section 9.2.1.4
#WRITE Writes a data record into a keyed file. Section 9.2.5.11
Method call Calls a method. Section 9.3.2.1
.CREATE Creates a Visual SCIL object. Section 9.3.1.1
.DELETE Deletes a Visual SCIL object. Section 9.3.1.2
.LOAD Loads a Visual SCIL object. Section 9.3.1.3
.MODIFY Modifies one or more attributes of a Visual SCIL object. Section 9.3.2.2
.SET Assigns a value to a user interface object attribute. Section 9.3.2.3

Table 3: Picture commands

Command Brief Description Page


!CLOSE Closes the monitor. Section 9.4.1.1
!CSR_ BOL, !CSR_EOL, ! These commands move the data entry cursor. Section 9.4.3.1
CSR_LEFT, !CSR_RIGHT
!ENTER Completes data entry. Section 9.4.3.2
!ERASE Erases a window from the screen. Section 9.4.2.1
!FAST_PIC Adds and removes fast picture definitions in semi-graphic monitors. Section 9.4.1.2
!INPUT_KEY Reads function key information. Section 9.4.3.2
!INPUT_POS Reads the mouse or cursor position. Section 9.4.3.3
!INPUT_VAR Reads an input value from the user. Section 9.4.3.4
!INT_PIC Displays an alarm picture. Section 9.4.1.3
!LAST_PIC Displays the previous picture. Section 9.4.1.4
!NEW_PIC Displays a picture. Section 9.4.1.5
!RECALL_PIC Recalls a stored picture name. Section 9.4.1.6
!RESET Deletes variables in a picture. Section 9.4.4.2
!RESTORE Stops the function key from blinking. Section 9.4.1.7
!RUBOUT, !RUBOUT_BOL, ! Delete input data. Section 9.4.3.5
RUBOUT_CUR, !RUBOUT_EOL
!SEND_PIC Copies the picture (semi-graphic) to a printer. Section 9.4.4.1
!SHOW Shows a window. Section 9.4.2.2
!SHOW_BACK Shows the picture background of a window. Section 9.4.2.3
!STORE_PIC Stores the present picture name. Section 9.4.1.8
!TOGGLE_MOD Insert/typeover. Section 9.4.3.5
!UPDATE Defines the update time interval. Section 9.4.1.9
!WIN_BG_COLOR Specifies the color of the background behind the window. Section 9.4.2.4
!WIN_CREATE Creates a window. Section 9.4.2.5
!WIN_INPUT Assigns a window an expression. Section 9.4.2.6
!WIN_LEVEL Specifies the level parameter of the window. Section 9.4.2.7
!WIN_NAME Creates a new window. Section 9.4.2.8
!WIN_PIC Selects a picture to be shown in the window. Section 9.4.2.9
!WIN_POS Positions a window. Section 9.4.2.10
!WIN_REP Selects a library representation for a window. Section 9.4.2.11

MicroSCADA X SYS600 10.5 97


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

9.2 General SCIL statements GUID-DBA71881-950B-4523-8BE4-9471DD88EA7A v1

9.2.1 Basic SCIL statements GUID-4F5214E7-5436-43E5-A369-865D8D561729 v1

These statements define the structure and hence, the flow of the program. They are also used to
declare arguments and local variables of the program and to assign values to variables.

Structured SCIL statements (#BLOCK, #CASE, #IF, #LOOP, #LOOP_WITH, #ON and a method call)
may be nested to depth of 300. For example, a loop may contain a block, which contains another
loop that calls a method, which contains a case statement, etc., to the structural depth of 300
statements.

9.2.1.1 [@]name[component]* = value GUID-9F900BC6-6223-4D16-A59D-AA8289DF4046 v2

Assigns a value to a variable.

'name' The name of the variable


'component' Component of structured data, see Section 5
'value' Any type expression

This statement replaces the current value of a variable or a component of a variable by a new value.
With the @ prefix, 'name' refers to a global variable, otherwise a local variable is referred to.

Examples:

@X = Y ;Local variable Y is copied to global variable X


Y = %X ;Global variable X is copied to local variable Y
@X(5)= 1 ;The 5th element of global vector variable X is set
Y.A = 0 ;Attribute A of (list type) local variable Y is
Y.A.B(1 .. 5) = cleared
0 ;The 5 first elements of vector attribute B of
;list attribute A of local variable Y are cleared

9.2.1.2 #ARGUMENT name [,name]* GUID-6B074EE1-6967-4C4B-85EF-73F91548E1CF v1

Declares arguments of the program.

'name' Any valid SCIL name, the name of the argument.

The #ARGUMENT statement names the arguments to be passed to the program by the caller (in the
order they should be given by the caller). All arguments may be listed in one statement, or several
subsequent #ARGUMENT statements may be written. The two ways are equivalent as long as the
arguments are declared in same order.

Arguments may be freely named using up to 63-character long identifiers. Arguments and global
variables may have a same name. If an argument has a name of a predefined SCIL language
element, such as a SCIL function, the predefined meaning is hidden and it cannot be used within that
SCIL program. For example, if a SCIL program declares an argument named MAX, the predefined
SCIL function MAX is no more available in the program.

The #ARGUMENT statements must be located at the beginning of program, before any other
statements. Within the program, the argument name 'name' may be used as if it were a read-only
local variable.

98 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

When a SCIL program that has declared its arguments is called by another SCIL program, the
number of arguments supplied by the caller is checked. If the caller does not supply a value to each
named argument, a SCIL error SCIL_ACTUAL_ARGUMENT_MISSING is raised. On the other hand,
additional arguments are allowed. They may be handled by the called program using SCIL functions
ARGUMENT_COUNT and ARGUMENT, see the example below.

Example:

This example shows how a method with two obligatory and one optional argument may be
implemented.

; Calling sequence of this method:


; MY_METHOD(A, B [,C])
; Default value for the optional argument C is 0.

#ARGUMENT A, B
#LOCAL C = 0
#IF ARGUMENT_COUNT == 3 #THEN C = ARGUMENT(3)

9.2.1.3 #BLOCK[statement]* #BLOCK_END GUID-B5CBBB71-4334-4D23-A14E-A9B43F47D638 v2

Compounds statements into one.

'statement' Any SCIL statements.

#BLOCK compounds a number of statements into one statement. It is usually used within structured
statements (IF, CASE, ON) in places where a single statement is required by the syntax.

Example:

#IF A > B #THEN #BLOCK


#IF A - B > 10 #THEN #BLOCK
!SHOW WIN "THE VALUE TOO LARGE"
TOO_LARGE = TRUE
#BLOCK_END
#ELSE !SHOW WIN "CHECK!"
#BLOCK_END
#ELSE !SHOW WIN "OK"

9.2.1.4 #CASE value, [ #WHEN selector statement]*, [ #OTHERWISE statement],


#CASE_END GUID-C4C7D728-2115-4C08-BEFE-78E217F4AD01 v2

Multibranched conditional execution.

The statement selects (at most) one of listed SCIL statements for execution. The selection is based
on a case value, which is compared to 'selectors' of each branch.

'value' A value of type integer, real, boolean, time, text or bit string.
'selector' The selector is a comma-separated list of items that select the branch for execution. An item
may be given as:
1. A single value of type integer, real, boolean, time, text or bit string.
2. A vector of such values. In this case 'value' is compared to each element of the vector
to find a match.
3. A range of such values, v1 .. v2. The range may be semi-open:

Table continues on next page

MicroSCADA X SYS600 10.5 99


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

v1 .. means values greater or equal to v1


.. v2 means values less or equal to v2.
'statement' Any SCIL statement.

The 'value' is compared to each 'selector' item of the #WHEN commands. The first matching #WHEN
statement is executed and the rest of the #CASE statement to the matching #CASE_END is skipped.
If no matching #WHEN statement is found, the #OTHERWISE statement (if any) is executed.

There may be several selectors that match the case value, but only the first branch is executed. No
error is generated, in case no branch is selected.

Examples:

#CASE C
#WHEN "A".."Z", "a" .. "z" #BLOCK
IS_A_LETTER = TRUE
#CASE C
#WHEN "A", "E", "I", "O", "U", "Y", -
"a", "e", "i", "o", "u", "y" IS_A_VOWEL = TRUE
#OTHERWISE IS_A_VOWEL = FALSE
#CASE_END
#BLOCK_END
#OTHERWISE IS_A_LETTER = FALSE
#CASE_END

#CASE D
#WHEN 0,3,6,8,9 SHAPE = "NO STRAIGHT LINES IN THIS DIGIT"
#WHEN 1,2,4..5,7 SHAPE = "CONTAINS STRAIGHT LINES"
#WHEN .. -1 #BLOCK
WISE_GUY = TRUE
SHAPE = "DON'T TRY TO FOOL ME"
#BLOCK_END
#OTHERWISE SHAPE = "ONE DIGIT ONLY, PLEASE"
#CASE_END

#CASE DATA_TYPE(D)
#WHEN "INTEGER" T = 1
#WHEN "REAL" T = 2
#OTHERWISE !SHOW W "SIMPLE NUMERIC DATA EXPECTED"
#CASE_END

9.2.1.5 #DO program GUID-4389BC34-9DE8-4CDE-9885-4C7655787E81 v1

Executes the SCIL program given as an argument.

'program' A text or a text vector containing the statement or the program to be executed.

The #DO command is used to execute a SCIL program stored outside the current program context
(picture, dialog, command procedure) or created on-the-fly.

The program is executed as a subroutine of the calling program, contrary to the #EXEC command,
which queues the specified object for later execution.

#DO command cannot pass arguments to the called program, nor does it support return values from
the called program. Use function DO instead.

Example:

#LOCAL PROG = TEXT_READ("ABC.TXT")


#IF PROG.STATUS == 0 #THEN #DO PROG.TEXT
;The SCIL program in the file ABC.TXT is executed.

100 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

#DO ABC:C
;The program (IN attribute) of the command procedure ABC is executed.

9.2.1.6 #ERROR IGNORE, #ERROR CONTINUE, #ERROR STOP, #ERROR EVENT GUID-40CADD2F-C2C5-4FCD-AFBC-A347668FC579 v1

Defines the error handling policy.

IGNORE means that the program execution continues regardless of errors. The error handling
programs are not activated and no error message is produced.
CONTINUE means that an error handler is activated or an error message is produced, but the
program execution continues.
STOP means that an error handler is activated or an error message is produced and the
execution of the program containing the error is aborted. The statement of an active
#ON ERROR command is executed (see below).
EVENT means that the execution of the program containing the error is aborted, but no error
message is produced. The statement of an active #ON ERROR command is executed
(see below). Not available in the methods of dialogs.

An #ERROR command applies only to the program or #ON block in which it is executed.

The status code of the most recent error occurred in the program can be read with the STATUS
function, Section 10.

If no ERROR command has been executed in a program, the following default policies are applied:

Background and draw programs: CONTINUE


Start programs: STOP when displayed, IGNORE when printed
Update programs: IGNORE
Exit Programs: IGNORE
Key programs: STOP
Named programs: STOP
Command procedures: STOP
#ON blocks: IGNORE
Methods of VS objects: STOP (IGNORE in the delete method)
Error handling programs: IGNORE

In error handling programs, the error handling policy is always IGNORE, regardless of possible
#ERROR commands. In delete methods of Visual SCIL objects all errors are ignored.

9.2.1.7 #ERROR RAISE [status] GUID-EBE6A9EF-2B42-4FB5-8518-5E283B26077A v2

Raises a SCIL error.

'status' Integer expression. The status code to be activated. Default: the latest error code
occurred in the program.

The command is mainly used within error handling blocks (#ON ERROR or #ON KEY_ERROR
blocks) in order to activate an error status in the program. In error handling blocks, 'status' can be
omitted, whereby the activated status is the most recent error status that has occurred in the
program. Outside an error handling block, the command interrupts the program execution.

Example:

MicroSCADA X SYS600 10.5 101


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

#ON ERROR #BLOCK


#IF STATUS == STATUS_CODE("SCIL_APL_APL_COMMUNICATION_TIMEOUT") #THEN -
!SHOW INFO "Timeout"
#ELSE #ERROR RAISE
#BLOCK_END

9.2.1.8 #IF condition1 #THEN statement1, [ #ELSE_IF condition2 #THEN


statement2]*, [ #ELSE statement3] GUID-87350B3E-0BE8-4749-8B7E-3BCD20FF983A v1

Conditional execution.

'condition1'
'condition2' Boolean type expressions
'statement1'
'statement2'
'statement3' Any SCIL statements.

If 'condition1' is TRUE, 'statement1' is executed and the rest of the #IF statement is skipped.
Otherwise, if any 'condition2' is TRUE, the corresponding 'statement2' is executed and the rest is
skipped. If none of 'condition1' or 'condition2' is TRUE, 'statement3' is executed.

Examples:

#LOCAL HOUR, SHIFT


#IF HOUR >= 7 AND HOUR < 15 #THEN SHIFT = "MORNING"
#ELSE_IF HOUR >= 15 AND HOUR < 23 #THEN SHIFT = "EVENING"
#ELSE SHIFT = "NIGHT"

9.2.1.9 #LOCAL name [= value] [,name [= value]]* GUID-E81ECAA7-4341-4F6D-9647-118D75E78353 v1

Declares local variables of the program.

'name' Any valid SCIL name, the name of the local variable.
'value' Any type expression, the initial value of the variable.

The #LOCAL statement names the local variables to be used in the program. All local variables may
be listed in one statement, or several subsequent #LOCAL statements may be written. The two ways
are equivalent. Variables may be declared in any order.

Local variables may be freely named using up to 63-character long identifiers. Local and global
variables may have a same name. If an argument has a name of a predefined SCIL language
element, such as a SCIL function, the predefined meaning is hidden and it cannot be used within that
SCIL program. For example, if a SCIL program declares a local variable named MAX, the predefined
SCIL function MAX is no more available in the program.

The name of local variable may not be formed by using variable expansion. The following is not valid:

#LOCAL 'LN'_MAX

The #LOCAL statements must be located at the beginning of program, after #ARGUMENT
statements (if any) but before any other statements.

Within the SCIL program, local variables are referred to simply by their name. No special characters
(such as @ and % for global variables) are needed. Syntactically, local variables may be used
wherever a global variable reference is allowed.

102 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

Additionally, in every SCIL command that takes a variable name as its parameter, a local variable
name may be used (but not an argument name, because arguments are read-only). The list of such
SCIL commands follows:

#LOOP_WITH var = low .. high


#OPEN_FILE n apl file keylength
#READ n key data1 [data2]
#READ_KEYS n vector [key1 [key2]]
#READ_NEXT n key data1 [data2]
#READ_PREV n key data1 [data2]
.MOUSE x, y, [,button [,buttons [,RELATIVE]]]
!INPUT_KEY keytext var
!INPUT_POS var
!INPUT_VAR [picture path]window variable [max_length]

The SCIL interpreter first finds out whether a local variable by the given name exists. If it does, the
local variable is used, if not, a global variable by the name is used.

The local variables exist only while the program is executed. When the program terminates, all its
local variables are destroyed and the memory space allocated for them is freed.

Example:

This example illustrates the use of local variables and arguments (which may be taken as read-only
local variables).

#ARGUMENT A, B, LN
#LOCAL X, Y = A + B ;Initial value of Y is the sum of arguments A and B
#LOCAL I
#LOCAL V = VECTOR()

X = %X ;Global X is copied to local X


X = MIN(X, Y)

#SET 'LN':PBO1 = 1 ;Argument LN is expanded to object name

#LOOP_WITH I = 1 .. 10 ;Local I used as a loop counter


V(I) = .CALCULATE_SOMETHING(I, X, Y)
#LOOP_END

9.2.1.10 #LOOP [condition], [statement]*, #LOOP_END [max] GUID-44360D2E-AA3B-473F-87D1-5C3462A56629 v1

Executes a sequence of statements in a loop.

'condition' A boolean expression, a precondition for entering the body of the loop. Default value:
TRUE.
'statement' Any SCIL statements, the body of the loop.
'max' The maximum number of times the loop is iterated. An integer expression. Default
value: 1000.

The body of the loop is executed repeatedly as long as the 'condition' is TRUE, or until the loop is
interrupted in one of the following ways:

MicroSCADA X SYS600 10.5 103


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

• Statement #LOOP_EXIT (see below) is executed in the loop body. This is no error situation.
• The maximum number of loop iterations is reached. In this case, error
SCIL_MAX_LOOP_COUNT_EXCEEDED is raised.
• An emergency interruption is done from another SCIL program (in another monitor). In this case
error SCIL_PROGRAM_EXTERNALLY_TERMINATED is raised.

An emergency interruption is done in one of the following ways:

• Loops in pictures and VS objects are interrupted by the statement:

#SET MONn:BMS

where 'n' is the monitor number.

• Loops in command procedures are interrupted by the statement:

#SET APLn:BRSm

where 'n' is the application number and 'm' represents the number of the queue that
runs the command procedure. This number may be found by reading the APLn:BRO
(Running Objects) attribute, it is encoded as follows:
'm' = 1: time channel queue
'm' = 2: event channel queue
'm' = 3 ... 32: parallel queue 1 ... 30 (the PQ attribute of the command procedure)

• Loops in format pictures are interrupted by the statement:

#SET APLn:BPSm

where
'n' is the application number,
'm' = 1 for process printouts and
'm' = 2 for report printouts.

Example:

#LOCAL I = 0, OBJ, NAMES = VECTOR()


#SEARCH 1 0 "P" "A"
OBJ = NEXT(1)
#LOOP OBJ.IU >= 0 AND I < 50
I = I + 1
NAMES(I) = OBJ.LN
OBJ = NEXT(1)
#LOOP_END
!SHOW OBJECTS NAMES
;Up to 50 process object names are shown in the window OBJECTS.

9.2.1.11 #LOOP_WITH var = low .. high, [statement]*, #LOOP_END GUID-A1DF6CF9-8BE0-4E40-B790-B7C27F64B905 v1

Executes a loop a number of times.

104 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

'var' The name of the control variable of the loop. The name refers to a local variable by that
name, if such a variable is declared, otherwise to a global variable.
'low' The value of the control variable at the first loop execution, an integer expression.
'high' The value of the control variable at the last loop execution, an integer expression.
'statement' Any SCIL statements, the body of the loop.

The body of the loop is executed repeatedly a number of times, calculated as 'high' - 'low' + 1. Each
time the loop is completed, the variable 'var' is incremented by one. If 'high' is less than 'low', the
body is not executed at all.

The loop may be interrupted before 'var' reaching 'high' in the following ways:

• Statement #LOOP_EXIT (see below) is executed in the loop body. This is no error situation.
• An emergency interruption is done from another SCIL program (in another monitor). In this case
error SCIL_PROGRAM_EXTERNALLY_TERMINATED is raised. See command #LOOP above
for details of emergency interruption.

Example:

#LOOP_WITH I = 1 .. LENGTH(%V)
!SHOW WIN'I' %V(%I)
#LOOP_END
;Each element of the vector variable V is shown in a separate window.

9.2.1.12 #LOOP_EXIT GUID-5CCE6B25-BF45-4855-9B49-556CB5197F12 v1

Interrupts a loop.

The statement interrupts the innermost loop (#LOOP or #LOOP_WITH) it is textually located in.

Example:

I = 0
#LOOP
I = I + 1
!SHOW LOOP_NR I
!SHOW QUESTION "CONTINUE? (Y/N)"
!INPUT_VAR ANSWER ANSWER
#IF ANSWER == "N" #THEN #LOOP_EXIT
#LOOP_END

9.2.1.13 #ON event [statement] GUID-1B0A83C5-2224-4C9F-B9C5-8A0876B24D20 v1

Declares a program block to be executed when an event occurs.

'event' An event object notation.


'statement' Any SCIL statement.

#ON command stores the 'statement' as the event program for 'event' in the current user interface
object (main picture, window picture, picture function or Visual SCIL object). Later, the 'statement' will
be executed each time the event object is activated. If 'statement' is omitted, the previous #ON
command for the same event object is cancelled.

Only one event program for a particular event is stored in each user interface object, second #ON
command for the same event replaces the first one. However, each window picture, picture function
or VS object may have its own event program for each event.

MicroSCADA X SYS600 10.5 105


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

This command can be used only in user interface programs. It has no effect in command procedures.
Only events from the current application can be caught.

In Visual SCIL objects, it is recommended to define event programs as event methods of the object
(instead of #ON blocks) using the Dialog Editor.

Examples:

#ON TEMP:E1 !SHOW W TEMP:PAI1


;When the event object TEMP:E1 is activated, the value of the process
object
;TEMP is shown in the window W.

#ON TEMP:E1
;The former statement is cancelled.

#ON SWITCH:E2 #BLOCK


!SHOW SWITCH SWITCH:PBO2
!SHOW TIME TIMES(SWITCH:PRT2)
#BLOCK_END
;The block is executed when the event object SWITCH:E2 is activated.

9.2.1.14 #ON ERROR [statement] GUID-E967AD77-10F3-4CFA-A78F-4227EF2D8127 v1

Defines an error handler.

'statement' A SCIL statement to be executed when an error occurs.

The command defines a statement, or block of statements, to be executed each time an error occurs,
in the cases where the error handling is defined by #ERROR STOP or #ERROR EVENT (see
above). The command is valid only for the program or #ON block in which it has been executed. The
#ON ERROR command takes precedence over the #ON KEY_ERROR command (see below).

Example:

#ON ERROR !SHOW MESSAGE STATUS


;The window MESSAGE is shown when an error occurs.

9.2.1.15 #ON KEY_ERROR [statement] GUID-A0FCEAD7-93A3-4694-9F0C-21DC80B2CBE8 v1

Defines a key error handler.

'statement' A SCIL statement to be executed when an error occurs.

The command defines a statement, or a block of statements, to be executed in a picture each time
an error occurs in a function key program. The command applies only to the window picture where it
has been executed. If there is no key error handler in a picture, the error handler of its parent picture
is used, if any. The #ON ERROR command (see above) takes precedence over the #ON
KEY_ERROR command.

Example:

#ON KEY_ERROR !SHOW MESSAGE "FUNCTION KEY ERROR"

9.2.1.16 #PAUSE interval GUID-5D3482D8-2C97-4197-8ABA-50D264864F65 v1

Takes a pause.

106 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

'interval' Time interval in seconds given as a real expression.

This command is used to momentarily suspend the program execution.

Be careful when using this command in command procedures! The pause delays the
execution of all the other objects in the same queue as well.

Examples:

#PAUSE 3.5
;The system waits for 3.5 seconds before the next statement is executed.
#PAUSE %T
;The length of the pause is specified by the variable T.

9.2.1.17 #RETURN [value] GUID-3151F956-EE1A-4937-A741-D270C3807548 v1

Stops the program execution and returns a value to the caller.

'value' Any SCIL expression.

#RETURN command is used in named programs, methods and programs executed with the DO
function (see Section 10) to stop execution and return a value to the caller.

The #RETURN command without 'value' may be used in any SCIL program to exit the program.

A program encountering no #RETURN statement returns a value with data type "NONE".

Example:

;Suppose you have the following named programs:

;Named program ADD:


#ARGUMENT A, B
#RETURN A + B

;Named program MULTI_ADD:


#LOCAL I, TOTAL = 0
#LOOP_WITH I = 1 .. ARGUMENT_COUNT
TOTAL = TOTAL + ARGUMENT(I)
#LOOP_END
#RETURN TOTAL

;After the following named program calls:


S = .ADD(1, 0.5)
M = .MULTI_ADD(1, 2, 3, 4)
;S has the value 1.5 and M 10.

9.2.1.18 #SET_TIME time GUID-DDF0C25C-4334-465D-BCCD-6ECA583CBF17 v1

Sets the system time.

'time' Time given in the format YY-MM-DD HH:MM:SS (if SYS:BTF = 0), DD-MM-YY
HH:MM:SS (if SYS:BTF = 1) or MM-DD-YY HH:MM:SS (if SYS:BTF = 2).
The seconds may be omitted.

The command sets the time of the system clock. If the computer has an external clock, the command
has no relevance.

MicroSCADA X SYS600 10.5 107


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

This command is more or less obsolete. Use functions SET_SYS_TIME,


SET_LOCAL_TIME or SET_UTC_TIME instead (see Section 10).
This command is not allowed in read-only mode.

9.2.2 Application and system object commands GUID-C814285F-8E09-4D1B-8D87-0369BC4DC305 v1

9.2.2.1 #CREATE object [=attributes] GUID-5018F474-F13A-430A-984F-8435AD665C4A v1

Creates a new application or base system object.

'object' An object notation. Object types allowed are the application objects P, H, X, F, D, C, T,
A, G and V, and the system objects B.
'attributes' A list type expression.

The command creates a new object of the given type, with the given name (and index, if a process
object) and assigns it the attribute values of 'attributes'.

If a process object notation for a process object of a predefined type is given without an index, a
group with the given name is created. A group is automatically created when an indexed process
object of a predefined type is created.

To make a copy of an existing object, use functions FETCH, PHYS_FETCH, NEXT or PREV (Section
10).

An error is raised if the object already exists, or if the assigned 'attributes' do not match the actual
object type. In read-only mode, only V objects can be created.

The command is mainly used in tool pictures and configuration programs.

Example:

#CREATE ABC:P1 = LIST(BI = 0, UN = 20, OA = 1, OB = 2)


;A binary input type process object is created with a physical address.

9.2.2.2 #DELETE object GUID-1870CFF1-3494-4FD2-A9BA-6CD4349E7184 v1

Deletes an application object.

'object' An object notation of type P, H, X, F, D, C, T, A, G or V. A variable object notation (type


V) may contain an attribute name.

The given object is deleted. If a variable object notation contains an attribute name, the attribute, not
the entire object, is deleted. In read-only mode, only V objects and their attributes can be deleted.

Using a variable object notation, any global variable may be deleted, see the example below.

A process object group (process object notation without an index) may be deleted only if it does not
contain any process objects. A time channel may be deleted only if no object is connected to it. A
scale or an event handling object can be deleted only if no process objects use it. An free type object
(F) can be deleted only if all process objects of the corresponding type have been deleted. A logging
profile can be deleted only if no objects use it.

Examples:

@TMP = 1
#DELETE TMP:V
;The variable TMP is deleted

108 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

#DELETE A:P1
;The process object A with index 1 is deleted.

#DELETE A:P
;The process object group A is deleted (possible only if there are no
objects ;in the group).

#DELETE V:VAB
;The attribute AB of the global variable V is deleted.

9.2.2.3 #EXEC object [(variable_list)] GUID-3F81A4E9-C8FD-4661-AEB4-F52468335A8D v1

Queues an application object for execution.

'object' An application object notation of type D, C, T, A or E.


'variable_list' A list of variable assignments separated by commas.

This command queues an application object (data object, command procedure, time channel, event
channel or event object) for execution. Because the object does not necessarily execute immediately,
the subsequent statements should not assume that the object has been completed. See Section 6.3
for the overview of application objects, or the Application Objects manual for details.

Any number of argument variables may be passed in 'variable_list' to the activated object (except for
event objects that do not take any arguments).

When executed by a command procedure, #EXEC command may fail by status


REPF_EXECUTION_QUEUE_FULL if the maximum queue length (attribute APL:BQM(2) or
APL:BQM(3)) has been reached (see the System Objects manual).

This command is not available in read-only mode.

Examples:

#EXEC TASK:C (@LN = "DEFG", @IX = 1)


;The command procedure TASK is queued for execution.

#EXEC DATA:D (@A = %B + 2)


;The data object DATA is updated.

#EXEC EVENT:E1
;An event object named EVENT is activated.

9.2.2.4 #EXEC_AFTER delay object [(variable_list)] GUID-9247DA4C-F1D0-4B84-994D-72E87F90C38B v1

Queues an application object for execution after a time delay.

'delay' The delay time in seconds given as and integer or real expression.
'object' An object notation of type D, C, T, A or E.
'variable_list' A list of variable assignments separated by commas.

The command works like #EXEC (see above), but the execution is delayed for 'delay' seconds.

External applications are not supported. For example, the command #EXEC_AFTER 60
EXTERNAL:5C fails if application 5 is an external application. As a work-around, create a local
command procedure, say LOCAL, which contains only the command #EXEC EXTERNAL:5C and
queue it for execution: #EXEC_AFTER 60 LOCAL:C

MicroSCADA X SYS600 10.5 109


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

#EXEC_AFTER command may fail by status REPF_EXECUTION_QUEUE_FULL if the maximum


queue length (attribute APL:BQM(4)) has been reached (see the System Objects manual).

This command is not available in read-only mode.

Example:

#EXEC_AFTER 10 TASK:C (@LN = "DEFG", @IX = 1)


;The command procedure TASK is started after 10 seconds.

9.2.2.5 #GET object GUID-A7C2BD74-02D6-4123-A581-3D6110742625 v1

Updates process object values.

'object' A process object notation or an STA system object notation with the attribute ME or
DA.

The command reads the specified process object value(s) or a memory address or an address range
from the station and updates the process database. For process objects, the attribute may be
omitted. It is then assumed to be OV. The command is valid only for process objects corresponding
to physical objects in stations on ANSI X.3 lines.

This command is not available in read-only mode.

Examples:

#GET A:PBI
#GET B:PBI(1 .. 4)
#GET STA1:SME(1003^ .. 1010^)
;The binary object A, the four first indices of the binary object B and
;the memory address area 1003 to 1010 from station 1 are updated in the
process
;database.

9.2.2.6 #INIT_QUERY n [condition] GUID-A7928C6A-C405-42E0-9B94-5AD772C97EE2 v2

Initiates a process query.

'n' Text expression, either "A", "P" , "L", "H" or "E":


"A" (Alphabetical) The entire process database is searched in alphabetical order.
"P" (Physical) The entire process database is searched in the order of the
physical addresses of objects (UN + OA + OB).
"L" (alarm List) The alarm list is searched in reverse time order, the latest
alarms first. The alarm list contains all alarming and
unacknowledged process objects in time order according to the
alarm time (the AT and AM attributes).
Table continues on next page

110 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

"H" (History) The history buffer is searched in time order, the oldest events
first. A history buffer is an obsolete way of storing event history,
selected by the application attribute APL:BHP value
"EVENT_LOG".
"E" (Event) The history buffer is searched in reverse time order, the latest
events first. See "H" above.
'condition' A boolean type expression which selects the objects to be included in the query. The
condition is comprised of relations and logical operators. The relations have an attribute as
the left operand. All attributes (including CA) can be used. The objects that fulfil the condition
are included in the query. Wildcard characters % and * can be used in conjunction with text
attributes. % matches any character, * matches any sequence of characters (including a zero
length sequence).
The condition is evaluated in read-only mode.

This command only selects the objects included in the query. The objects along with some of their
attribute values are then listed by function PROD_QUERY (Section 10). Only one query at a time
may be active within the SCIL context. Only own application may be queried.

Examples:

#INIT_QUERY "A"
;The process query includes all objects in alphabetical order.

#INIT_QUERY "P" UN == 5
;The objects of unit 5 in address order.

#INIT_QUERY "A" LN == "K*"


;Process objects beginning with K.

#INIT_QUERY "L" (UN == 5) AND (AR == 0)


;Unacknowledged alarms from unit 5.

This command is more or less obsolete. Use more powerful SCIL functions
APPLICATION_OBJECT_LIST and APPLICATION_OBJECT_ATTRIBUTES instead of
type "A" and "P" queries and function HISTORY_DATABASE_MANAGER (operating on
the history database) instead of type "H" and "E" queries (operating on the history buffer).

9.2.2.7 #MODIFY object = attributes GUID-00408A39-08C0-4B71-89CC-6616BE475F4F v2

Changes an application object definition.

'object' An application object notation. Allowed object types are P, H, X, F, D, C, T, A, G and V.


'attributes' A value of data type list.

The object is assigned the attribute values of the list expression 'attributes'. Modifying the LN
attribute of an object (or the IX attribute of a process object) effectively renames the object.

In read-only mode, only V objects can be modified.

Examples:

#LOCAL V = LIST(HR = 24, TC = "TC_1H")


#MODIFY DEF:D = V
;The HR and TC attributes of the data object DEF are changed.

#MODIFY PROC:P2 = LIST(AE = 1,AN = "A_1")


;The process object PROC, index 2, is connected to the event channel A_1.

#MODIFY ABC:P2 = LIST(LN = "DEF")


;The process object is renamed, i.e. moved from group ABC to DEF.

MicroSCADA X SYS600 10.5 111


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

9.2.2.8 #SEARCH n apl type order [start [condition]] GUID-8D7CB706-32D8-44A7-9941-B5AA47407155 v2

Initialises a search among objects.

'n' The identification number of the search. An integer expression 1 ... 10 that identifies the
search within the SCIL context.
'apl' Logical application number. Integer expression, 0 ... 250. 0 = the own application. The
application must be local.
'type' The object type, "P", "H", "X", "F", "D", "C", "T", "A" or "G" given as a text expression.
'order' The search order given as a text expression:
"A" Alphabetical order. Searching through the object names in alphabetical
order (no index). Regarding process objects, only group names are
included in the search.
"I" Index order (only for process objects of predefined types). Searching
through the individual objects of a process object group.
"P" Address order (only for process objects).
"E" Execution order. The execution order within a time channel. 'type' can be
either "D" or "C". Whichever given, the search still applies to both data
objects and command procedures.

'start' The starting point of the search. Depending on 'order', the parameter has the following
values:
Order "A" An object name as a text expression. If omitted, the search starts from the
first name.
Order "I" A name or (name,index), where 'name' is the name of the object given as a
text expression and 'index' is the index of process object as an integer. If
'index' is omitted, the browsing starts from the first index.
Order "P" A unit or (unit,address) or (unit, address, bit address), where 'unit' is the
unit number, 'address' is the word address and 'bit address' is the bit
address, each given as an integer expression.
Order "E" A time channel or (time channel, type, name), where 'time channel' is the
name of the time channel and 'type' and 'name' are the name and type of
the connected object from which the search starts, each given as text
expressions. If only the time channel name is given, the search starts from
the object with the highest priority. Both data objects and command
procedures are included.
The argument 'start' is obligatory when 'order' is "I" or "P", and when a condition is appended
to the statement. If 'order' is "A" or "E", 'start' can be given as an empty string (" ").
Note, that the first NEXT or PREV function call after the #SEARCH command uses the 'start'
argument as it reference: If an object specified by 'start' exists, that object is not returned by
the call.
'condition' A boolean type expression which selects the objects to be included in the browsing. The
condition is comprised of relations and logical operators. The relations have an attribute as
the left operand. All attributes can be included in the expression. Vector type attributes are
referenced by the item index. List types are referenced using the list items' attribute name.
The objects that fulfill the condition are included in the search. Wildcard characters % and *
can be used in conjunction with text attributes. % matches any character, * matches any
sequence of characters (including a zero length sequence).
The condition is evaluated in read-only mode.

This command only selects the objects included in the search. The objects along with their
configuration attribute values are then listed by functions NEXT and PREV (Section 10). Up to 10
searches at a time may be active within the SCIL context.

This command is more or less obsolete. Use more powerful SCIL functions
APPLICATION_OBJECT_LIST and APPLICATION_OBJECT_ATTRIBUTES instead.

112 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

Examples:

#SEARCH 1 0 "P" "A"


;All process objects in alphabetical order are included in search number
1.

#SEARCH 2 2 "T" "A"


;Browsing through all time channels in alphabetical order.

#SEARCH 3 1 "P" "P" (4, 1000^) LN == "B*"


;The search refers to those objects of station 4 which have an address
1000
;(octal number) and begin with B. The search is performed in address
order.

#SEARCH 4 0 "D" "E" "10MIN"


;Searching among those data objects and command procedures which are
connected
;to the time channel 10MIN.

9.2.2.9 #SET object_attribute [= value] GUID-112B7274-A2F6-45F9-B696-D4404B248EFA v1

Assigns a value to an attribute of an object.

'object_attribute' An object notation of type P, H, X, F, D, C, T, A, G, B, S or V including the attribute to


be set. See Section 6.
'value' A value of the type specified by the attribute. Default = 1.

With this command all types of system and application objects, except event objects, may be given
values through their attributes. For real process objects of output type, setting the OV attribute
implies control of the process via NET.

Depending on the object type and the attribute, the object notation may be indexed by a single index
or an index range. If the object notation has an index range, the 'value' may be a vector or of a
simple data type. If it is a vector, its elements list the values to be assigned. If it is simple data, all
indices receive the same value.

Data object and process object notations may be used without an attribute. It is then assumed to be
the OV attribute.

In read-only mode, only V objects can be set by this command. The attributes which are described as
read-only in the attribute descriptions (Application Objects and System Objects manuals) cannot be
set with the #SET command.

Examples:

#SET SWITCH:PBO1 = 1
;The switch is set to 1. If the object is in AUTO state, the command is
passed
;out to the process.

#SET STA3:SME(3121^0 .. 3121^7) = 0


;All storage bits in the given range are set to zero.

#SET TASK:CIU = 1
;The command procedure TASK is taken into use.

#SET DATA:DOV5 = 10.0


;The fifth history value of the data object is set to 10.0.

#SET A:AON = "B"


;The event channel A is connected to the object B.

MicroSCADA X SYS600 10.5 113


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

#SET PRI1:BLP = 72
;The number of lines per page is set to 72 for printer 1.

9.2.3 Printout commands GUID-C9579F63-BF0B-4CAF-8179-AF71CF0B7DAB v1

9.2.3.1 #LIST printer object [(variable list)] GUID-10ADA69A-7EA9-4228-97CB-B1673466F704 v1

Prints process object data.

'printer' Logical printer number. Integer expression, 1 ... 20.


'object' A process object notation.
'variable list' A list of variable assignments, separated by commas.

The format picture of the process object is output to the printer. If the process object is given with an
index, the physical format picture (PF) is written, otherwise the logical format picture of the group
(LF) is used. For process objects of user-defined types, the command always prints the physical
format picture (PF).

The start program of the picture, exclusive of the picture commands, is executed before printout.
Only those windows which have an expression are printed. Curves and bars are not printed.
Depending on the printer definition in the base system (the PRIn:BOD attribute), the printout may be
stored on disk.

The variable list, which may be omitted, defines the variables used in the printed picture (in windows
or in start programs). The variable list may assign a value to a variable called FORM_FEED, which
determines the paper form feed, see the #PRINT command. In conjunction with #LIST command, the
default value of FORM_FEED is 0, which means that the printer starts a new page only when the
previous one is full.

In addition to the variables of 'variable list', the #LIST command automatically defines a set of
variables which get their names as well as their values from attributes (snapshot variables). If the
process object is given with an index, these attributes may be (depending on the object type and
definition): LN, IX, OV, BI, BO, DB, DI, DO, AI, AO, PC, BS, OE, AL, AS, OS, SE, SP, OF, AZ, RT,
RM, AT, AM and CA. For user-defined object types also other attributes may also be transferred to
variables. The corresponding variables may be used in the physical format. If the process object is
given without an index, only the LN attribute is passed in this way to the logical format. The variable
values given in the variable list have precedence of these automatically generated variables.

This command is not available in read-only mode.

Examples:

#LIST 3 TEMP:P (@A = 30)


;The logical format of the process object group is printed to printer 3.

#LIST 1 LEVEL:P7 (@FORM_FEED = 2)


;The physical format of the process object is printed to printer 1. E.g.
the
;variable LN has the value "LEVEL", and the variable IX the value 7. The
;printer starts a new page before, but not after the printout.

9.2.3.2 #PRINT printer picture [(variable list)] GUID-542E332A-473A-4A54-A061-AA624E8054AE v1

Prints a picture.

114 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

'printer' Logical printer number. Integer expression, 1 ... 20.


'picture' The picture to be printed, specified as:
[path/] picture name
where
'picture name' is the name of the picture and
'path' is a logical path name.
If 'path' is omitted, the default path names are used. See the #PATH command, Section
9.2.4.
'variable list' A list of variable assignments, separated by commas.

This command is used when a paper printout of a picture is needed, for example, a report picture.
The start program of the picture, excluding the picture commands, is executed before the print
process. Only those windows which have an expression are printed. Curves and bars are not printed.
Depending on the printer definition in the base system (the PRIn:BOD attribute), the printout may be
stored on disk.

The variable list, which may be omitted, defines the variables used in the printed picture (in windows
or in start programs). In addition, the variable list may assign a value to a predefined variable called
FORM_FEED, which controls the form feed during printing. The FORM_FEED parameter can have
the following values:

0 Form feed only when the page is full (the page length is determined by the PRIn:BLP attribute,
where 'n' is a physical printer number)
1 Form feed before (if not already done) and after printout
2 Form feed before printout (if not already done)
3 Form feed after printout

In conjunction with #PRINT command, the default value of FORM_FEED is 1.

This command is not available in read-only mode.

Examples:

#PRINT 1 REPORT (@VAR = TEMP:PAI(1..20))


;The picture named REPORT is output to printer 1. The printer starts a
new
;page both before and after the printout.

#LOOP_WITH N = 1 .. 20
#PRINT 1 FORM_'N' (@FORM_FEED = 0)
#LOOP_END
;The pictures FORM_1 ... FORM_20 are printed without form feed.

9.2.4 Path commands GUID-E8506AC6-64D1-4E01-9A58-5116DB8B88EB v1

9.2.4.1 #PATH name [dir [, dir]*], #PATH name + dir [, dir]*, #PATH name - [dir [,
dir]*] GUID-0D200733-BB82-4132-9367-0CFFE808C751 v2

Defines a logical path.

MicroSCADA X SYS600 10.5 115


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

'name' A logical path name, up to 10 characters.


'dir' A directory name in the SCIL file name format (starting with /) or in the operating
system format, see Section 6.5.1 for valid directory names. A trailing / or \ is stripped
off, so the path can be written either with or without it. Up to 255 directories are allowed
in the command. If a directory does not exist, it is automatically created. However, if the
word NO_CREATE is included in the directory list, the subsequent directories are not
created. If they do not exist, the error FILE_DIRECTORY_DOES_NOT_EXIST is
raised.

Logical path names can be used in all commands where files are called by name, for example,
together with picture names. Each path name may correspond to several directories, which are given
in the search order and separated by commas. When a file is requested with the path name, it is first
searched for in the first directory of the path, then in the next one, etc. If a path name is used when a
new file is created, the new file will be stored in the first directory of the path name.

A #PATH command without any sign defines a global path. Such a path definition is monitor specific
when executed in a picture or dialog. If executed in a command procedure, it applies to all command
procedures. If executed in a printed picture, it applies to all pictures printed with #PRINT. If the
directory list is omitted, all directories of the path name are removed, but the path name remains.
Global paths should be defined only once, for example in the start picture or dialog. System and
application specific paths should be defined by using the base system attributes SYS:BPH and
APL:BPH, respectively (see the System Objects manual).

A #PATH command with a + or - sign defines local and temporary paths by adding directories to, or
removing them from, the path definition. Local paths are valid only in the SCIL context where they
are defined and take precedence over the global paths with the same name. A + sign means that the
directories are added to the beginning of the directory list of the path name. A - sign means that the
directories are removed from the directory list. If the directory list is omitted, the - sign removes all
locally defined directories from the path name. (Note: as a terminating - sign means that the
statement is continued on the next line, and in this case should be typed as two subsequent minus
signs followed by an empty line, see the example below).

When an object invokes another one using #EXEC, #EXEC_AFTER, #PRINT or #LIST command,
both the global and local path definitions are inherited as local path definitions in the activated object.
If, for example, a picture program starts a command procedure, the paths of the picture will be local
paths in the command procedure and, hence, take precedence over the global command procedure
paths.

The latest definition of a path is valid. Hence, by defining paths locally (with + and -), you ensure that
no inherited definitions will override the desired path definitions.

The following automatically defined path names are used as default paths:

LAN_ /LAN/ACTIVE/LAN_
SYSO /LAN/ACTIVE/SYSO
PICG /LAN/ACTIVE/PICG
SYS_ /SYS/ACTIVE/SYS_
APL_ /APL/application/APL_
FORM /APL/application/FORM
PICT /APL/application/PICT

These default path names are valid everywhere, though the corresponding directories may be
changed globally or locally. A file called without any path name is stored or sought in the directory/
directories defined by the default path name which coincide with the first four characters in the file
name. If no other path name suits, PICT is used. Visual SCIL main dialogs constitute an exception to
this case. This is described in the Visual User Interface Design manual.

Defined paths can be read with the path functions, see Section 10.

116 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

Example:

#PATH PROCESS + /APL/APPL1/PICT, NO_CREATE, /APL/APPL2/PICT


;A local logical path named PROCESS is created. If the directory
;/APL/APPL1/PICT does not exist, it is created, but if the directory
;/APL/APPL2/PICT does not exist, it is not created.

!NEW_PIC PROCESS/PICTURE
;The picture named PICTURE is first sought for in the application APPL1,
;then in application APPL2.

#PATH PROCESS + /APL/APPL3/PICT


!NEW_PIC PROCESS/PICTURE
;Now the directories are sought in order APPL3, APPL1, APPL2.
#PATH PROCESS - -

;empty line
;The local path definition is removed.

#PATH OWN + D:\OWN\DATAFILES


; The directory name given in operating system format.

9.2.4.2 #REP_LIB library [file [, file]*], #REP_LIB library + [file [, file]*], #REP_LIB
library - [file [, file]*] GUID-45D79206-FD02-49F3-AD78-15BF451E8775 v1

Defines a logical representation library.

'library' A logical library name, up to 10 characters.


'file' A representation library file name, see Section 6.5.1 for valid file names. Up to 255
representation library files can be included in the command.

Logical library names can be used everywhere, where library representations are requested. Each
library name may correspond to several library files, given in the search order and separated by
commas. When a library representation is requested, it is first sought for in the first library, then in the
next one, etc. If a library name is used when a new library representation is created, the new
representation will be stored in the first file of the logical library.

A #REP_LIB command without any sign defines a global library name. Such a name is monitor
specific, when executed in a picture or dialog. If executed in a printed picture, it applies to all pictures
printed with #PRINT. If the file list is omitted, all files defined for the library name are removed, but
the library name is preserved. Global libraries should be defined only once, for example in the start
picture or dialog. System and application specific representation libraries should be defined by using
the base system attributes SYS:BRL and APL:BRL, respectively (see the System Objects manual).

A #REP_LIB command with a + or - sign defines local and temporary library names by adding files to
or removing files from the given library name. Local representation libraries are valid only in the SCIL
context where they are defined and take precedence over the global libraries with the same name. A
+ sign means that files are added to the beginning of the file list of the library name. A - sign means
that files are removed from the list. If the file list is omitted from the command, the minus sign
removes all locally added files from the actual library name. (Note: as a terminating - sign means that
the statement is continued on the next line, this case should be typed as two subsequent minus signs
followed by an empty line, see the example below).

When an object invokes another one using #EXEC, #EXEC_AFTER, #PRINT or #LIST command,
both the global and local representation library definitions are inherited as local library definitions in
the activated object. If, for example, a picture program starts a printout, the representation libraries of
the picture will be local libraries in the format picture and, hence, take precedence over the global
libraries.

The latest definition of a library name is valid. Hence, by defining library names locally (with + and -),
you ensure that no inherited definitions will override the desired library name definitions.

MicroSCADA X SYS600 10.5 117


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

If no library name is given, a representation is searched for in the library called DEFAULT. Unless
changed with a #REP_LIB command, the library name DEFAULT corresponds to the files:

1. /APL/application/APL_STAND.PIR

2. /LAN/ACTIVE/LAN_/LAN_STAND.PIR

in this search order.

Defined library names can be read with the replib functions, see Section 10.

Example:

#PATH PATH + /APL/APPL2/PICT


#REP_LIB PROCESS PATH/MYLIB
!WIN_REP WINDOW PROCESS/MYREP
;The library representation MYREP, which is to be shown in the window
WINDOW,
;is sought from the file MYLIB in the application APPL2.

9.2.5 File handling commands GUID-82DD2096-1F7A-4DE0-A4A5-98BBE559A72A v1

This section lists and describes the commands used to access SYS600 keyed files. Keyed files are
general purpose files that may be read and written concurrently by several SCIL programs. Each
data record contains a unique key that is used to identify the record. Data records may be read and
written sequentially, or directly specifying the key value. See Section 6.5.4 for details.

9.2.5.1 #CLOSE_FILE n GUID-A8C2426D-84BE-4F19-A29B-0B48EA1F60C0 v1

Closes a keyed file.

'n' File number. The file number assigned to the file when opened with the #OPEN_FILE
or #CREATE_FILE command. Integer expression, 1 ... 10.

Closes the file defined by 'n'. This command should be used when the file is no longer used. Open
files are automatically closed when the SCIL context is deleted.

Example:

#CLOSE_FILE 2
;The file opened as number 2 is closed.

9.2.5.2 #CREATE_FILE n apl file keylength GUID-0030BE33-05A5-4FD4-B971-018201D9C621 v1

Creates and opens a new keyed file.

'n' File number. A number that identifies the file within the SCIL context. Integer
expression, 1 ... 10.
'apl' Logical application number, integer expression 0 ... 250. 0 is the own application. The
application must be local.
'file' Text or byte string expression, the name of the file. See Section 6.5.1 for file naming.
'keylength' The key length. Integer expression, 1 ... 253.

The command creates a keyed file with the given key length and opens the file. When no longer used
it should be closed with the #CLOSE_FILE command, see above.

This command is not available in read-only mode.

118 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

Example:

#CREATE_FILE 3 0 "RTU5" 5
;A file called RTU5 with the key length 5 is created and opened in the
current ;application.

9.2.5.3 #DELETE_FILE apl file GUID-A1EA63BB-39E4-4D47-AE60-FFA8D5A6438C v1

Deletes a file.

'apl' Logical application number. Integer expression, 0 ... 250. 0 = the current application.
The application must be local.
'file' Text or byte string expression, the name of the file. See Section 6.5.1 for file naming.

The command deletes the named file in the given application. This command can be used to delete
any file, not just keyed files.

This command is not available in read-only mode.

Example:

#DELETE_FILE 3 "RTU52" ;The file RTU5 in application 3 is deleted.

9.2.5.4 #OPEN_FILE n apl file keylength GUID-3005D476-09D3-4B3F-B1F2-161FB88AEEEC v1

Opens a keyed file.

'n' File number. A number that identifies the file within the SCIL context. Integer
expression 1 ... 10.
'apl' Logical application number, integer expression 0 ... 250. 0 = the current application.
The application must be local.
'file' Text or byte string expression, the name of the file. See Section 6.5.1 for file naming.
'keylength' The name of the variable to receive the key length (integer value 1 ... 253) used in the
file. If a local variable by that name exists, it is used, otherwise a global variable.

The command opens a keyed file. Up to 10 files can be open at the same time in the SCIL context.

When the file is no longer used, it should be closed with the #CLOSE_FILE command, see above.

Example:

#OPEN_FILE 2 1 "APL_/RTU3" L
;The file RTU3 in application 1 is opened. The variable L will
contain ;the key length.

9.2.5.5 #READ n key data1 [data2] GUID-581239BC-D62E-4685-8D9D-30A0166B0962 v1

Reads a data record from a keyed file.

'n' File number. The file number assigned to the file when opened with the #OPEN_FILE
or #CREATE_FILE commands (see above). Integer expression, 1 ... 10.
'key' The key of the record to be read. A text expression containing 'keylength' characters.
'data1', 'data2' The names of variables to receive the data. If local variables by these names exist,
they are used, otherwise global variables.

MicroSCADA X SYS600 10.5 119


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

The command reads the contents of the record defined by 'key' and puts it as a text into one or two
variables, 'data1' (up to 255 characters) and 'data2' (the rest of the contents if the length of the record
exceeds 255 characters).

Example:

#READ 2 RTU_KEY(X:POA1) V1 V2
;The record corresponding the process object X in the opened file number
2 is
;read. The RTU_KEY function is described in .

9.2.5.6 #READ_KEYS n keys [key1 [key2]] GUID-EFB8266E-22AE-4C98-894C-592BEC979551 v1

Reads the keys of a keyed file.

'n' File number. The file number assigned to the file when opened with the #OPEN_FILE
or #CREATE_FILE commands (see above). Integer expression, 1 ... 10.
'keys' The name of the variable to receive the keys. If a local variable by that name exists, it
is used, otherwise a global variable.
'key1' The first key to be read. A text expression containing up to 'keylength' characters (see
the #OPEN_FILE command above). Not obligatory.
'key2' The last key to be read. A text expression containing up to 'keylength' characters. Not
obligatory.

The command reads the keys of the file defined by 'n' and stores them in the variable 'keys'. Up to 2
000 000 keys are read, starting from 'key1' and ending with 'key2'. If 'key2' is omitted the keys are
read to the end of the file, or until the vector is full (2 000 000 keys). If 'key1' and 'key2' are omitted,
the keys of the entire file, up to 2 000 000, are read.

Example:

#READ_KEYS 2 V "A" "B"


;Reads the keys starting with letter "A" (supposing that key length is >
1).

9.2.5.7 #READ_NEXT n key data1 [data2] GUID-3F0C25BB-60C7-48A6-AAC3-65B18B7AAF9F v1

Reads a data record from a keyed file.

'n' File number. The file number assigned to the file when opened with the #OPEN_FILE
or #CREATE_FILE commands (see above). Integer expression, 1 ... 10 .
'key' A reference record key. A text expression.
'data1', 'data2' The names of variables to receive the data. If local variables by these names exist,
they are used, otherwise global variables.

The command reads the contents of the record next to 'key' and places it as text in one or two
variables, 'data1' (up to 255 characters) and 'data2' (the rest of the contents if the length of the record
exceeds 255 characters).

Example:

#READ_NEXT 2 RTU_KEY(A:POA1) V1 V2
;The record following process object A1 is read. The RTU_KEY function is
;described in .

120 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

9.2.5.8 #READ_PREV n key data1 [data2] GUID-9153DB35-3B4D-4B0F-9981-41A0E22E42BD v1

Reads a data record from a keyed file.

'n' File number. The file number assigned to the file when opened with the #OPEN_FILE
or #CREATE_FILE commands (see above). Integer value, 1 ... 10.
'key' A reference record key. A text expression.
'data1', 'data2' The names of variables to receive the data. If local variables by these names exist,
they are used, otherwise global variables.

The command reads the contents of the record previous to 'key' and places it as text in one or two
variables, 'data1' (up to 255 characters) and 'data2' (the rest of the contents if the length of the record
exceeds 255 characters).

Example:

#READ_PREV 2 RTU_KEY(A:POA1) V1 V2
;The record previous to the process object A is read. The RTU_KEY
function is
;described in .

9.2.5.9 #REMOVE n key GUID-2AB18487-BF34-43DA-B0BE-F340EBD3E949 v1

Deletes a data record from a keyed file.

'n' File number. The file number assigned to the file when opened with the #OPEN_FILE
or #CREATE_FILE commands (see above). Integer value, 1 ... 10.
'key' The key of the record to be deleted. A text containing 'keylength' characters (see the
#OPEN_FILE command above).

The command deletes the chosen record. The deletion cannot be undone.

This command is not available in read-only mode.

Example:

#REMOVE 2 RTU_KEY(D:POA5)
;The record configuring the process object D is deleted.

9.2.5.10 #RENAME_FILE apl old new GUID-2030B787-BE3E-4F17-81C3-EF2BB32519EA v1

Renames a file.

'apl' Logical application number. Integer value, 0 ... 250. 0 is the current application. The
application must be local.
'old' Text or byte string expression, the name of the file to be renamed. See Section 6.5.1
for file naming.
'new' Text or byte string expression, the new file name.

The command renames the file 'old' to 'new'. If 'new' already exists, an error is raised.

This command may be used to rename any file, not just keyed files.

This command is not available in read-only mode.

Example:

MicroSCADA X SYS600 10.5 121


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

#RENAME_FILE 0 "W89" "W90;The file W89 in the current application is


renamed to W90.

9.2.5.11 #WRITE n data1 [data2] GUID-5A9BFD62-B743-4B86-95C6-F5B58367EC0D v1

Writes a data record into a keyed file.

'n' File number. The file number assigned to the file when opened with the #OPEN_FILE
or #CREATE_FILE command (see above). Integer 1 ... 10.
'data1', 'data2' Two text values containing the data to be written.

The command writes a record to the file defined by 'n'. 'data1' contains as a text the key of the record
and data to be written, up to 255 characters. The rest of the data to be written, if any, is in 'data2'.
The key is included as the first characters in 'data1'.

If there is a record by the same key in the file, it is overwritten.

This command is not available in read-only mode.

Example:

#WRITE 2 V1 V2
;The data of the variables V1 and V2 is written in the file opened as
number 2.

9.3 Visual SCIL commands GUID-80C49E55-E472-43F6-BB83-C0B7D14F412F v1

The Visual SCIL commands creates, loads and deletes the Visual SCIL objects and handles the
attributes of the Visual SCIL objects. The Visual SCIL objects are superficially described in Section 6
of this manual. They are described in more detail in Visual SCIL User Interface Design and Visual
SCIL Objects manuals.

9.3.1 Loading, creating and deleting Visual SCIL objects GUID-5B8C83D1-551A-4403-BA5C-70FCA44C5BD7 v1

9.3.1.1 .CREATE object = type [(attribute = value [,attribute = value]*)] GUID-B8B84C67-4C9A-470C-93BA-74E2C84A01BE v1

Creates a Visual SCIL object.

'object' The name of the object or an object reference including the path (see Section 6).
Giving a path means that the object is created as the last child in the object chain. The
object name must be unique among the objects with the same parent.
'type' The name of the Visual SCIL object type. See the Visual SCIL Objects manual.
'attribute' The name of an attribute which is assigned the subsequent value. If no predefined
attribute with the given name exists, the attribute is created as a user defined attribute.
'value' The value assigned to the attribute. If the attribute is predefined, the value must be of
the correct data type (see the Visual SCIL Objects manual). If the attribute is user
defined, the value may be of any data type.

The .CREATE command creates the object and loads it into the dialog system. Unless an object path
is given, the object will be the child object of the object containing the .CREATE command.

The predefined attributes which are not assigned values in the attribute list are given default values.
After an object has been created, its attributes can be changed with the .MODIFY and .SET
commands, see below.

122 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

The .CREATE command is normally used for creating objects whose appearance is dynamically
defined, based on some run time information. It must also be used for creating objects of the ready-
built types which are not accessed in the Dialog Editor. The .LOAD command described below is
used for loading dialogs and dialog items drawn in the editor.

Generally, methods cannot be written with this command. However, if the object has action methods,
these can be written with attributes, see the Visual SCIL Objects manual. Except for this type of
methods, objects created with .CREATE will only have the predefined methods with predefined
contents.

Examples:

.create CANCEL = VS_BUTTON(_TITLE = "Cancel", _NOTIFY = vector(".delete


DLG"))
;The statements above creates a button with the label text Cancel and the
;NOTIFY program .delete DLG (deletes the dialog DLG).

.create ROOT\DLG = VS_DIALOG( -


_GEOMETRY = LIST(X=100, Y=100, W=220, H=110))

.create ROOT\DLG\GROUP = VS_CONTAINER( -


_GEOMETRY = LIST(X=5, Y=5, W=100, H=100))

.create ROOT\DLG\GROUP\ROWS = VS_CHECK_BOX( -


_TITLE = "Check 1", -
_GEOMETRY = LIST(X=5, Y=5, W=80, H=20))

.create ROOT\DLG\GROUP\COLUMNS = VS_CHECK_BOX( -


_TITLE = "Check 2", -
_GEOMETRY = LIST(X=5, Y=30, W=80, H=20))

.create ROOT\DLG\CONTAINER = VS_CONTAINER( -


_GEOMETRY = LIST(X=115, Y=5, W=100, H=100))

.create ROOT\DLG\CONTAINER\OK = VS_BUTTON( -


_TITLE = "OK", -
_GEOMETRY = LIST(X=5, Y=5, W=50, H=25))

.create ROOT\DLG\CONTAINER\CANCEL = VS_BUTTON( -


_TITLE = "Cancel", -
_GEOMETRY = LIST(X=5, Y=35, W=50, H=25))

.create ROOT\DLG\CONTAINER\HELP = VS_BUTTON( -


_TITLE = "Help", -
_GEOMETRY = LIST(X=5, Y=65, W=50, H=25))

.set ROOT\DLG._OPEN = TRUE

The example above creates a dialog containing two containers, each of which contains dialog items.
The last statement makes the dialog visible on screen.

9.3.1.2 .DELETE object GUID-995FA50C-682F-4EC4-B36A-D20CDD0487B6 v1

Deletes a Visual SCIL object.

'object' The object name, possibly including a path (see Section 6).

Deleting a Visual SCIL object means that it is removed from the screen (if shown) and from the
dialog system. When an object is deleted, all its children are deleted as well.

When an object is deleted, its Delete method, if any, is executed.

Examples:

MicroSCADA X SYS600 10.5 123


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

.DELETE DIALOG1 ;Deletes the object DIALOG1 and all its child objects.

.DELETE ROOT ;Deletes the entire dialog system (This is


a ’suicide’)

9.3.1.3 .LOAD object = type(, file , name [, attribute = value]*) GUID-D5F3CD52-A2DD-441B-B761-F9079B691E29 v1

Loads a Visual SCIL object.

'object' The Visual SCIL object reference (name and possibly path) of the loaded object.
This argument determines the name of the loaded object and its situation in the object
hierarchy. If the object reference is given with an object path, the loaded object will be
created as the last child in the object chain. If no path is given, only object name, the
object will be the child object of the object containing the .LOAD command. The object
name can be freely chosen, as long as it is unique among all objects with the same
parent.
'type' The name of the Visual SCIL object type. The Visual SCIL object types are listed and
described in the Visual SCIL Objects manual.
'file' Text. The name of the file where the object is stored, including the path. Path is not
needed if the file is situated in the directory defined as the default path of the main
dialog of the dialog system. The default path is defined by the attribute
_DEFAULT_PATH when loading the main dialog.
'name' Text. The name under which the object is stored in the file. The name is given in the
dialog editor.
'attribute' An attribute name.
'value' A value assigned to the attribute.

This command is used for loading objects built in the dialog editor and stored in files. It loads the
specified object as a Visual SCIL object with the given name. If a loaded dialog or dialog item
contains other dialog items, they are also loaded. The contained dialog items will be known as Visual
SCIL objects with the names they were given in the dialog editor. The loaded object is incorporated
with all its child objects into the existing object hierarchy.

When loaded, the create methods of the objects are executed (see the Visual SCIL User Interface
Design manual). If the load command contains attribute definitions, the attributes are set after the
create methods.

A stored dialog, dialog item or image can be concurrently loaded several times in parallel under
different object names or in different contexts.

Example:

.load DIALOG = VS_DIALOG("MYFILE.VSO", "MYDIALOG", _OPEN = TRUE)

In the example above, the dialog stored as MYDIALOG in the file MYFILE is loaded as a Visual SCIL
object of type VS_DIALOG. As the visibility attribute _OPEN is set to TRUE, the dialog is shown
immediately. The command loads the complete contents of the dialog MYDIALOG.

9.3.2 Handling Visual SCIL attributes and methods GUID-776A6789-1B88-4DBC-AA36-15ECAB33367B v1

9.3.2.1 [object].method [(argument [,argument]*)] GUID-9975CEF2-BEEB-452E-B3B1-0D93E759B53C v1

Calls a method.

124 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

'object' A Visual SCIL object reference or a picture reference (see Section 6). THIS object, if
omitted.
'method' A method name.
'argument' Up to 32 arguments of any data type.

Calls the specified method in the specified object, optionally with arguments. The result value
returned by the called method, if any, is ignored.

9.3.2.2 .MODIFY object = list GUID-46A69EE7-FE93-453E-BC9A-080322B52548 v1

Modifies one or more attributes of a Visual SCIL object.

'object' A Visual SCIL object reference, possibly including an object path.


'list' A list type expression, containing the attribute names and their new values. If an
attribute name does not exist as a predefined attribute, it is created as a user defined
attribute. For predefined attributes, the value should be of an appropriate data type. For
user-defined attributes, any value will do.

Example:

.create CANCEL = VS_BUTTON


.modify CANCEL = list(_TITLE = "Cancel", _NOTIFY = vector(".delete DLG"))

9.3.2.3 .SET [object].attribute[component]* = value GUID-EA21F37D-A4F2-48C3-B8BC-8049A16D56F6 v1

Assigns a value to a user interface object attribute.

'object' A Visual SCIL object reference or a picture reference (see Section 6). THIS object, if
omitted.
'attribute' An attribute name.
'component' Component of a structured value, see Section 5. Only components of user-defined
attributes may be set, the predefined attributes must be written as a whole.
'value' The value given to the attribute or its component. If the attribute is predefined, the
value must be of an allowed data type (see the attribute descriptions in the Visual SCIL
Objects manual). If the attribute is user defined, any data type is allowed.

The command assigns the given attribute or its component the given value. If the object is visible
when the .SET command is issued, the assignment may cause an immediate change of the
appearance of the object.

When referencing Visual SCIL attributes, an error is raised if the attribute does not exist. When
referencing a window attribute, the attribute is defined if it does not exist.

User defined attributes will always have the data type of the value last assigned to the attribute.

Examples:

Moving a button:

.SET BUTTON._GEOMETRY = (20, 20, 20, 20)

Defining or modifying window attributes:

.SET PIC_FUNC_1/WINDOW_2.RESIZED = TRUE


.SET .COUNTER(2) = 0

MicroSCADA X SYS600 10.5 125


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

9.4 Picture handling commands GUID-CBF4434F-0718-4C6D-A1E5-43FBE0E1067B v1

The picture handling commands can be used only within SYS600 pictures. They are not allowed in
dialogs or in command procedures.

9.4.1 General picture handling commands GUID-7C4A1262-2DAF-4A3E-89B5-5FC971A2A89A v1

9.4.1.1 !CLOSE GUID-A67DB643-7785-4697-8C98-BD7F3FDEB329 v1

Closes the monitor.

On full graphic operator consoles, the command ends the application session by closing the kernel
process of the monitor (PICO).

On a semi-graphic monitor, the command empties the screen from pictures and makes it turn black.
The monitor can be refreshed by clicking the mouse, which loads the SYS600 start picture on
screen. If there are pictures in the monitor alarm picture queue when the !CLOSE command is
issued, the monitor screen is not emptied but instead the oldest alarm picture in the queue is
displayed on screen. If an alarm occurs while the monitor is kept closed, and the monitor in question
is defined as an alarm monitor for the object, the alarm picture is immediately displayed.

9.4.1.2 !FAST_PIC[picture], !FAST_PIC-[picture], !FAST_PIC[-][picture],[-]


[picture], ... GUID-6E944D0B-200C-4571-A4CE-52621D2F514A v1

Adds and removes fast picture definitions in semi-graphic monitors.

'picture' A picture specified as:


[path/] picture name
where:
'picture name is the picture name exclusive the extension, and
'path' is a logical path name.
If 'path' is omitted, the default path names are used. See the PATH command, Section
9.2.4.
Default: The present picture

The command applies only to semi-graphic monitors and has no effect in full graphic
monitors.

The first command model marks the picture as a fast picture. When the picture is subsequently
erased from the screen, it is saved as a fast picture. This means that every dynamic part of the
picture is saved in the form it had when the picture was erased. Updating is, however, terminated as
in the case of ordinary pictures. When the picture is again displayed on the screen, it has the same
appearance as when it was previously erased and updating starts from this state. The start program
of the picture is no further executed.

The second command model, where the picture name is preceded by a minus sign, removes the fast
picture definition. Henceforth, the picture is no longer stored as fast picture. Several fast picture
definitions at a time can be added and removed as shown in the third command model above. Note:
if 'picture' is omitted, the minus sign at the end of the line will denote that the statement is continued
on the next line. To avoid this, type two subsequent minus signs and an empty line as shown in the
example below.

126 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

Fast pictures are monitor specific, i.e. a picture may be a fast picture in one monitor but not in the
others.

The fast pictures are continuously stored in the main memory. If there is insufficient main memory
storage space in the computer, a large number of fast pictures may delay the handling of the ordinary
ones.

All fast picture definitions are cancelled when the system is exited or the application state is changed.
After a fast picture has been edited in the picture editor it functions in the normal way until it is stored
again.

Example:

!FAST_PIC MYPIC
;Next time the picture MYPIC is exited it is stored as a fast picture.
!FAST_PIC - -
;empty line
;The fast picture definition of the current picture is cancelled.
Hereafter
;it functions as an ordinary picture.

9.4.1.3 !INT_PIC GUID-7B4B3A4D-E321-41D1-8336-8AF5080A096C v1

Displays an alarm picture.

Incoming alarms are added to a monitor (application session or window) specific alarm picture
queue. This command displays the oldest alarm picture in the queue. At the same time the name of
the picture is removed from the alarm picture queue. If the alarm picture queue is empty, the
command has no effect.

In other respects, the command works like !NEW_PIC.

9.4.1.4 !LAST_PIC GUID-72D9A1BF-F7BC-442A-8B83-37754D93CEFE v1

Displays the previous picture.

This command causes the picture handling process to go one step backwards in the queue built up
by !NEW_PIC, see Figure 17, and display that picture. If this picture is no longer available (for
example has been deleted or is locked by Picture Editor), the previous picture in the queue is
displayed. Finally, if there are no available pictures in the queue, an error is raised and no picture
change occurs.

In other respects, the command works like !NEW_PIC.

9.4.1.5 !NEW_PIC picture GUID-906E04A5-5C45-4DEF-B0C5-A19E91F29D29 v1

Displays a picture.

'picture' The picture to be displayed, specified as


[path/] picture name
where:
'picture name is the picture name exclusive the extension, and
'path' is a logical path name.
If 'path' is omitted, the default path names are used. See the PATH command, Section
9.2.4.

MicroSCADA X SYS600 10.5 127


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

The picture with the given name, if it exists, is displayed on screen. First the background becomes
visible. After that, possible draw and start programs are executed (unless the picture is stored as fast
pictures, see Section). If the named picture does not exist, an error message is produced.

When a picture is displayed, its picture name is automatically placed as the last item in a monitor
specific queue of shown pictures, which is maintained by the picture handling unit. If the picture
name already is in the queue, all subsequent picture names are removed from the queue, and the
picture name in its former position is thereafter the last item in the queue, see Figure 17.

If 'path' is omitted, the picture is searched for in the directories defined by the default path name valid
for the actual picture name, see the #PATH command, Section 9.2.4.

An error status is produced if the picture does not exist.

Examples:

!NEW_PIC MYPIC
;The picture named MYPIC is shown on screen. The picture is searched for
in
;the directory/directories defined by the path name PICT.
!NEW_PIC OWNPIC/MYPIC
;The picture MYPIC is searched for in the directory/directories defined
by the
;path name OWNPIC.

GUID-AB8121B8-F146-4291-8655-517F7234A26F V1 EN-US

Figure 17: The picture queue. Each monitor or picture container has its own picture queue.

9.4.1.6 !RECALL_PIC GUID-4E255EB4-8FAB-4E51-AF60-0790940216A6 v1

Recalls a stored picture name.

The picture, the name of which is stored by !STORE_PIC (see below), is displayed on screen. The
command functions like !NEW_PIC.

The command has no effect if !STORE_PIC has not been used.

9.4.1.7 !RESTORE GUID-C8A20D78-E5BA-4559-9989-DD2A953C2AE7 v1

Stops the function key from blinking.

128 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

When a function key has been pressed, it may be marked by blinking (depending on the key
definition). This command stops the blinking of all function keys on the entire screen.

9.4.1.8 !STORE_PIC GUID-FECA47EB-173D-4C68-B636-A7E59C71ED5A v1

Stores the present picture name.

The name of the present picture is stored and it can later be retrieved with the command !
RECALL_PIC.

Only one name at a time may be stored in this way. When the command is used again, the previous
picture name is removed.

9.4.1.9 !UPDATE interval GUID-EAD9AC80-FF7D-4F1D-A63E-D75B76CAE7A6 v1

Defines the update time interval.

'interval' Time interval in seconds given as a positive real expression.


The value of 'interval' is automatically rounded to an accuracy of 0.1 seconds.

If there is an update program in the picture, it is executed repeatedly with this interval as long as the
picture is displayed on screen, or until a new !UPDATE command is issued. After the update program
has been executed to the completion, it restarts when the time interval given by this command has
elapsed. Subsequent !UPDATE commands may change the time interval. The most recently given
time interval is valid. If 0 is given as a time interval, the updating ceases until a new interval other
than 0 is given.

When an !UPDATE command is issued, the update program is immediately executed once (provided
that the interval is unlike 0). The next execution takes place at a synchronization time. After that
execution restarts cyclically with the given interval. The time interval between the first and second
execution may be shorter than the interval given with the !UPDATE command.

In MicroSCADA revision 8.2 no synchronization was done. If the changed policy causes troubles at
an upgrade, the revision compatibility switch DO_NOT_SYNCHRONIZE_PICTURE_UPDATE may
be used. See the System Objects manual for details.

The main picture, its window pictures and picture functions may have different updating intervals.

Examples:

!UPDATE 5
;The update program is restarted when five seconds have elapsed since the
;previous execution.
!UPDATE ;The updating interval is assigned the value of the variable A.

9.4.2 Window handling commands GUID-E244CC37-E361-4643-B0CE-54FAB51DC834 v2

Windows can be defined using the Picture Editor or the !WIN_CREATE or !WIN_NAME commands
together with the !WIN_POS, !WIN_PIC, !WIN_REP, and !WIN_INPUT commands. Windows are
displayed on screen with the !SHOW and !SHOW_BACK commands and erased from screen with
the !ERASE command.

When a window is displayed, it is placed on top of its parent picture (see the picture hierarchy in
Section 6). Windows which are children of the same parent are arranged according to their level
parameter which can be changed with the !WIN_LEVEL command. Windows with the same parent
and the same window level are stacked in the order they were first shown with the !SHOW command
so that the newest window is placed on top. The updating of a window with !SHOW has no effect on
the stacking order. However, when a shown window is moved by !WIN_POS, it is raised to become

MicroSCADA X SYS600 10.5 129


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

the topmost window among the windows with the same level and the same parent. When the level of
a displayed window is updated with the !WIN_LEVEL command, the window is stacked as the
topmost window among the windows with the same level and the same parent.

The stacking order is the same whether the child window is totally contained within its parent or not.

9.4.2.1 !ERASE [picture path]window GUID-81CC0CF4-4A90-4A92-A606-2EC6992DE929 v1

Erases a window from the screen.

'window' The name of the window to be erased.


'picture path' A picture path according to the format described in Section 6. If omitted, the window is
sought from the picture or picture function where the command was issued. If the
window is not found there, the window is sought from the entire picture.

The command erases the named window from the screen. If the window is of type PICTURE, a
possible exit program is executed when the window is erased. If it contains windows, these windows
are erased, too.

Examples:

!ERASE MESSAGE
;The window MESSAGE is erased.
!ERASE TREND/COLUMN
;The window COLUMN in the window (or picture function) TREND is erased.

9.4.2.2 !SHOW [picture path]window [expression] GUID-04AF5308-3FD3-489E-A5A0-14E091AC1E69 v1

Shows a window.

'window' The name of the window to be shown.


'picture path' A picture path according to the format described in Section 6. If omitted, the window is
searched from the picture or picture function where the command was issued. If the
window is not found there, the window is searched from the entire picture.
'expression' The expression to be shown in the window. Not obligatory.

The window is displayed on screen at the location determined by the window definition. The value of
the expression is calculated before the window is displayed.

If the expression is given by the !SHOW command, the expression in the window definition is
disregarded. If the expression is omitted here, you may define it by the command !WIN_INPUT. Only
as the last alternative, the expression is taken from the window definition. If the window is defined as
PICTURE or FIGURE, the expression is disregarded.

If the window is of PICTURE type, possible background, draw and start programs are executed when
the picture is shown. The update program is executed in the interval given in the window picture,
which may differ from that of the main picture.

An error status is produced if the window cannot be found.

Windows are erased with the !ERASE command.

Examples:

!SHOW MESSAGE "ENTER PASSWORD:"


;The text ENTER PASSWORD: is shown in the window called MESSAGE.
!SHOW TREND/COLUMN %MAX
;The variable MAX is shown in the window COLUMN of the window TREND.

130 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

9.4.2.3 !SHOW_BACK [picture path]window [expression] GUID-55192A47-6FFA-4A57-B394-3762ED1767B1 v1

Shows the picture background of a window.

'window' The name of the window to be shown.


'picture path' A picture path according to the format described in Section 6. If omitted, the window is
sought from the picture or picture function where the command was issued. If the
window is not found there, the window is sought from the entire picture.
'expression' The expression to be shown in the window. Not obligatory.

This command shows the picture background of a window picture. The background of the picture
functions included in the picture are shown as well. The background and draw programs of the
picture are executed. No other programs are executed. No windows are shown and the function keys
do not function.

If the window is of some other type than PICTURE, the command works like !SHOW.

An error status is produced if the window cannot be found.

The window background is erased with the !ERASE command.

Example:

!SHOW_BACK SCHEME
;The picture background of the window SCHEME is displayed.

9.4.2.4 !WIN_BG_COLOR [picture path]window color GUID-788CE40E-3911-4B46-A0D3-424880AD25FF v1

Specifies the color of the background behind the window.

'window' The name of the window.


'picture path' A picture path according to the format described in Section 6. If omitted, the window is
sought from the picture or picture function where the command was issued. If the
window is not found there, the window is sought from the entire picture.
'color' The requested background color given as a named color, a vector of RGB values or a
reference, see Section 11. Default color: the color defined by the MONn:BWC attribute
(see the System Objects manual).

When a window is displayed, the background color can be seen for a moment until the window is
drawn on screen. Likewise, when a window is erased, the background color appears for a moment
until the background behind the window is redrawn on screen. By choosing an appropriate
background color for the window, disturbing color switches can be avoided.

The window background used in the monitor is specified by the base system attribute MONn:BWC.
By means of the !WIN_BG_COLOR command, the SCIL programmer can choose the background
color of individual windows. The command may be given before or after the window is shown for the
first time.

When a window is shown for the first time, the background color is set to the color defined by the
MON:BWC attribute, if not otherwise defined by the !WIN_BG_COLOR command. Later changes of
WC do not affect the background color.

The !WIN_BG_COLOR command is not applicable to semi-graphic monitors.

9.4.2.5 !WIN_CREATE [picture path]window GUID-E65F68FF-FADA-4D95-9ABF-73C5671CF310 v1

Creates a window.

MicroSCADA X SYS600 10.5 131


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

'window' The name of the window


'picture path' A picture path according to the format described in Section 6. If omitted, the window is
created in the picture or picture function where the command was issued.

The command creates a new window during the picture handling. Once the window has been
created with this command, it can be assigned a position with the !WIN_POS command (default
position: the upper left corner of the picture), a representation with !WIN_REP (library representation)
or !WIN_PIC (picture), and an expression with the !WIN_INPUT or !SHOW command. Similar to
windows created in the picture editor, windows created with !WIN_CREATE are shown with the !
SHOW command.

!WIN_CREATE first checks whether the window already exists. If no picture reference is given, the
window is searched only within the current picture. If the window already exists, and if it is an
ordinary window, the command does not produce any result. If the window exists as a Motif widget,
its X background is mapped as a SYS600 window background to enable SCIL graphics to be drawn
on it.

The created window exists as long as the picture is displayed on screen, or stored as fast picture
(semi-graphic monitors).

Use !WIN_CREATE instead of !WIN_NAME in cases where !WIN_NAME might have undesired side-
effects.

9.4.2.6 !WIN_INPUT [picture path]window expression GUID-528745E9-6E79-4E7B-BD69-07FF7C8ECE79 v1

Assigns a window an expression.

'window' The name of the window.


'picture path' A picture path according to the format described in Section 6.
'expression' The expression to be shown in the window.

The command assigns the window an expression which is stored as long as the picture is displayed
on screen or stored as a fast picture. The expression is evaluated every time the window is shown
with the !SHOW command.

With this command the window expression may be changed during the program execution. The last
given expression is valid. Hence, if the expression given with !WIN_INPUT is intended to be used, no
expression should be given with the !SHOW command.

If 'picture' is omitted, the window is sought from the picture or picture function where the command
was issued. If the window is not found there, the window is sought from the entire screen. An error
status is produced if the window cannot be found.

Example:

!WIN_INPUT LINE "TRY AGAIN:"


!SHOW LINE
;The text TRY AGAIN: is shown in the window LINE.

9.4.2.7 !WIN_LEVEL [picture path]window level GUID-273FEC3D-D107-4374-BA54-067C0F9C4FFD v1

Specifies the level parameter of the window.

132 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

'window' The name of the window.


'picture path' A picture path according to the format described in Section 6.
'level' An integer value in the range -100 ... +100. -100 = the window is placed on bottom,
+100 = the window is placed on top. Default value = 0. Instead of values, the following
two predefined constants can be used: ON_BOTTOM ( = -100) and ON_TOP (= +100).

The command specifies the level of the window in relation to other windows on the same level in the
picture hierarchy (see Section 6). See the general part of this sub-section.

9.4.2.8 !WIN_NAME [picture path]window GUID-F3C9C10A-AC61-4902-9522-C258CC2653C0 v1

Creates a new window.

'picture path' A picture path according to the format described in Section 6.


'window' The name of the window.

The command has the same function as the !WIN_CREATE command, except for the following:

If no picture reference is given, the !WIN_NAME command searches throughout the whole main
picture. If a window with the given name is found, no new window is created.

Example:

!WIN_NAME A
!WIN_POS A (1,1)
!WIN_PIC A A_PIC
!SHOW A ;A window A is created and placed in the upper left corner. The
picture A_PIC
;is shown in the window.

9.4.2.9 !WIN_PIC [picture path]window picture GUID-90A3DFD1-86A0-410A-BE05-2AC686A97E0B v1

Selects a picture to be shown in the window.

'picture path' A picture path according to the format described in Section 6.


'window' The name of the window in which the picture will be shown.
'picture' The name of the picture to be shown in the window, specified as
[path/] picture name
where:
'picture name is the picture name exclusive the extension, and
'path' is a logical path name.
If 'path' is omitted, the default path names are used. See the PATH command, Section
9.2.4.

With this command you can change the picture name during program execution. The latest issued
picture name is the valid one. The name of the window picture is stored as long as the main picture is
displayed on screen or stored as a fast picture. The command entails that the picture name in the
window definition is ignored.

If 'picture path' is excluded, the window is sought from the picture or picture function where the
command was issued. If the window is not found there, the window is sought from the entire screen.
An error status is produced if the window cannot be found.

Example:

MicroSCADA X SYS600 10.5 133


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

!WIN_PIC AREA TABLE


!SHOW AREA
;The picture TABLE is shown in the window AREA.

9.4.2.10 !WIN_POS [picture path]window pos GUID-B7B86F8A-421C-4EC7-A947-6F9630943D9E v2

Positions a window.

'window' The name of the window to be positioned.


'picture path' A picture path according to the format described in Section 6.
'pos' The new window position as a vector with two positive integer elements. The first
element is the X-position (horizontal coordinate, 1 ... 80) and the second one the Y-
position (vertical coordinate, 1 ... 48). If 'pos' contains more than two elements (for
example, the variable generated with the !INPUT_POS command), these elements are
ignored.

The upper left corner of the window 'window' is positioned to the semi-graphic character position
specified by 'pos'.

If the window is currently shown, it is immediately erased from the old location and displayed at the
new one. The window is placed on the top of all windows with the same level parameter and the
same parent. The new location is stored as long as the main picture is displayed on screen or stored
as a fast picture.

If 'picture' is excluded from the command, the window is sought from the picture or picture function
where the command was issued. If the window is not found there, the window is sought from the
entire screen. An error status is produced if the window cannot be found.

Examples:

!WIN_POS ABC (1,1)


;The window ABC is moved to the upper left corner of the main picture.
!SHOW INFO "POINT OUT A NEW LOCATION"
!INPUT_POS POS
!WIN_POS FIG %POS
;The window FIG is moved to the position pointed out with the mouse.

9.4.2.11 !WIN_REP [picture path]window representation GUID-585BA2E4-598F-4066-9C42-C3937AFA8CB5 v1

Selects a library representation for a window.

'picture path' A picture path according to the format described in Section 6.


'window' The name of the window to be assigned a library representation.
'representation' The library representation to be used in the window specified as:
[library/] representation
where:
'representation' is the name of the representation, and
'library' is a logical library name.
If library name is omitted, the representation is sought from the library DEFAULT. See
the command #REP_LIB in Section 9.2.4.

With this command the representation to be used in the window may be changed during the program
execution. The most recently given representation is valid. The given representation name is stored
as long as the main picture is displayed or stored as a fast picture. The command entails that the
representation given in the window definition is ignored.

134 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

If 'picture' is excluded from the command, the window is sought from the picture or picture function
where the command was issued. If the window is not found there, the window is sought from the
entire screen. An error status is produced if the window cannot be found.

Examples:

!WIN_REP LINE PASSWORD


!SHOW LINE
;The representation PASSWORD states the form for what is to be shown in
the
;window LINE. The representation is sought from the file(s) defined by
the
;library name DEFAULT.
!WIN_REP LINE ENG/PASSWORD
!SHOW LINE
;The same as above, but the representation is sought from the file(s)
defined
;by the library name ENG.

9.4.3 Input commands GUID-CAD344A2-4E24-4D36-AD0E-8A039F91E0E0 v1

9.4.3.1 !CSR_LEFT, !CSR_RIGHT, !CSR_BOL, !CSR_EOL GUID-CF1EB7D8-DB64-494D-81F2-520DB36431DA v1

These commands move the data entry cursor.

!CSR_LEFT moves the data entry cursor one step to the left and !CSR_RIGHT one step to the
right. !CSR_BOL moves the cursor to the beginning of the input field, !CSR_EOL to the end of the
input field.

These commands may be used only after the !INPUT_VAR command, and have no effect if this
command has not been issued.

9.4.3.2 !ENTER GUID-79F49EA2-AC58-420A-810C-DF4592C16800 v1

Completes data entry.

After an !INPUT_VAR command has been executed, the system waits for character inputs until it
gets an !ENTER command, or the ENTER key on the keyboard is pressed. If the program containing
the !ENTER command (usually a function key program) contains other statements after !ENTER,
these are executed. Then the program execution continues with the statements following after !
INPUT_VAR.

The command has no effect if no !INPUT_VAR command has been issued.

!INPUT_KEY keytext var


Reads function key information.

'keytext' This argument states the kind of information to be read:


PROGRAM The program
HEADER The function key header
HELP The function key help text
‘var' A variable name. The variable will contain the selected information as a text vector. If a local
variable by the name exists, it is used, otherwise a global variable.

The chosen information of the clicked function key is read and placed in the variable 'var'. The
variable becomes a vector, the length of which is determined by the chosen information.

MicroSCADA X SYS600 10.5 135


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

After this command has been executed, no other commands are executed until a function key has
been clicked.

The execution of this command may be interrupted by input timeout (attribute APL:BIT), status
PICO_INPUT_TIMEOUT.

Example:

!INPUT_KEY HELP V
!SHOW HELP %V
;After the !INPUT_KEY command has been executed, the system waits until a
;function key is pressed. If this has a help text, the text will be shown
in
;the window HELP.

9.4.3.3 !INPUT_POS var GUID-08A3B4DB-02FD-4564-A8B9-B2781D017A6E v1

Reads the mouse or cursor position.

'var' The name of a variable. If a local variable by the name exists, it is used, otherwise a
global variable.

The command reads the coordinates of the subsequent click on the mouse, or the corresponding
keyboard operation, and stores the coordinates in the given variable. After this command has been
executed, no other commands are executed until a position has been pointed out with the mouse.

The variable 'var' becomes a vector with four integer elements:


GUID-4795F299-6A7F-4C2F-A9A3-E75D1E921AED v1
(x,y,x_rel,y_rel)

where:

'x,y' are the coordinates for the cursor position in relation to the upper left corner of the
screen which is (1,1). The value range of the x-coordinate is 1 ... 80. The value
range of the y-coordinate is 1 ... 48.
'x_rel,y_rel' are the coordinates of the cursor position in relation to the upper left corner (=
(1,1)) of the window where the !INPUT_POS command is executed. These
coordinates may have negative values.

The execution of this command may be interrupted by input timeout (attribute APL:BIT), status
PICO_INPUT_TIMEOUT.

Examples:

!INPUT_POS V
;The position of the following push on the mouse is read and assigned to
the
;variable V.
!WIN_POS WINDOW %V
;The window WINDOW is moved to the position determined by the variable V
(only
;the first two elements are noted, i.e., the first coordinate pairs).

9.4.3.4 !INPUT_VAR [picture path]window variable max_length GUID-6B4245E5-F04C-4CD9-8588-563D6450D680 v1

Reads an input value from the user.

136 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 9
SCIL statements

'window' Window name of the input field.


'picture path' A picture reference according to the format described in Section 6.
'variable' Name of the variable to which the input is assigned. If a local variable by the name
exists, it is used, otherwise a global variable.
'max_length' Maximum length of the input string (in fullgraphic input fields)

This command allows the user to assign a value to a variable during operation. The window name
states in which window the value is echoed. The statement is executed only if the window is defined
and is of FIELD type. The window definition determines the data type of the variable (integer, real or
text) as well as the number of decimals (if real data).

After this command, the system waits for an input in the form of characters, from the keyboard or a
function key program, until it gets an !ENTER command or the Enter/Line Feed key of the keyboard
is pressed. No commands are handled other than those affecting the character input.

Lower case letters are converted to upper case letters. The Nordic letters Å, Ä, Ö, and the German Ü
are converted to the corresponding SYS600 semi-graphic characters, i.e., the ASCII codes [ , \ ,
and ].

This command is not allowed in update programs.

The execution of this command may be interrupted by input timeout (attribute APL:BIT), status
PICO_INPUT_TIMEOUT.

Example:

!INPUT_VAR WIND V
;The value of the variable V is read from the window WIND.

9.4.3.5 !RUBOUT, !RUBOUT_CUR, !RUBOUT_BOL, !RUBOUT_EOL GUID-C9AC401F-636D-4BE8-BCD2-5AE2D7D5D03D v1

Delete input data.

!RUBOUT deletes the character to the left of the input cursor.

!RUBOUT_CUR deletes the character in the current position of the cursor.

!RUBOUT_BOL deletes the beginning of the line until, but not including, the cursor.

!RUBOUT_EOL deletes the end of line starting from the cursor position.

The commands may be used only after the !INPUT_VAR command, and they have no effect if this
command has not been issued.

!TOGGLE_MOD
Insert/typeover.

Shifts from type-over (default) to insert and vice versa. The command may be used only after the !
INPUT_VAR command and has no effect if this command has not been issued.

9.4.4 Miscellaneous picture commands GUID-15D64E4A-65B1-41C7-B49D-7F393E57D86D v1

9.4.4.1 !SEND_PIC device number GUID-2FB03BE5-D52D-4357-A865-A4799D12AD1A v1

Copies the picture (semi-graphic) to a printer.

MicroSCADA X SYS600 10.5 137


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 9 1MRK 511 664-UEN Rev. A
SCIL statements

'device' Device name = LPT (line printer).


'number' Logical printer number. Integer expression, 1 ... 20.

The semi-graphic portions of the picture, in its current format, is copied to a printer (hardcopy). The
printer starts a new page both before and after the printout.

Depending on the printer definition in the base system (the PRIn:BOD attribute), the printout may be
stored on disk.

Example:

!SEND_PIC LPT 1

9.4.4.2 !RESET GUID-05CB7572-12D0-49D2-B7AB-CABDCCE481C1 v1

Deletes variables in a picture.

All variables assigned before this command, except for those of the start program, are deleted. At the
same time the command !RESTORE (Section 9.4.1) is executed.

Example:

@PROFIT = 350000
!SHOW WIND %PROFIT
;350000 is shown in the window WIND.
!RESET
!SHOW WIND %PROFIT
;An error message is displayed.
#ON ERROR !RESET
;The variables are deleted when an error occurs.

138 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Section 10 Functions GUID-0CEADF7B-A3CB-48AA-8A6F-1E7ABA676C54 v1

This section describes the predefined SCIL functions. The section is organized into the following
sections:

Section 10.1 General


Section 10.2 Generic functions
Section 10.3 Arithmetic functions
Section 10.4 Time functions
Section 10.5 String functions
Section 10.6 Bit functions
Section 10.7 Vector handling functions
Section 10.8 List handling functions 10.8
Section 10.9 Functions related to program execution
Section 10.10 Functions related to the run-time environment
Section 10.11 Functions related to the programming environment
Section 10.12 Language functions
Section 10.13 Error tracing functions
Section 10.14 Database functions
Section 10.15 Network Topology Functions
Section 10.16 File handling functions
Section 10.17 File management functions
Section 10.18 Communication functions
Section 10.19 CSV (Comma Separated Value) functions CSV functions
Section 10.20 DDE client functions
Section 10.21 DDE server functions
Section 10.22 ODBC functions
Section 10.23 OPC Name Database functions
Section 10.24 OPC functions
Section 10.25 RTU functions
Section 10.26 Printout functions
Section 10.27 User session functions
Section 10.28 Miscellaneous functions

Besides the SCIL functions described in this section, there are also some functions for handling full
graphic elements, which are described in Section 11.

10.1 General GUID-B0D56346-6E89-4080-BDC6-649E8B13FBBC v1

10.1.1 Function calls GUID-1EA5C7ED-8D18-4908-A324-68E453FBB3F4 v1

SCIL provides a number of standard functions, which return values according to a predetermined
algorithm. Function calls are used as operands in expressions (see example 8-1).

A function call has the following format:

MicroSCADA X SYS600 10.5 139


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

GUID-F48C056E-4696-4146-A3B8-9C777FA351A9 v1
function(argument(s))

The argument list consists of one or more expressions, separated by commas. If the function does
not take any arguments, only the function name is used or an empty argument list () may be given.
The expected data types of the arguments, as well as the data type of the result, are fixed by the
actual function. The data type of the result determines how the function call may be used in
expressions (see Section 8.)

Whenever a function expects a real type argument, an integer argument will do as well. It is implicitly
converted to real value before the function is called. Also, when a vector argument with real type
elements is expected, integer elements are accepted as well, unless otherwise noted.

Many functions operate either on a single argument value or a vector of argument values. When a
vector argument is used, each element of the resulting vector has its own status. Consequently, the
function call executes without an error even if one or more of the elements of the argument vector
are bad.

Several functions expect a predefined text type argument. They are called text keywords in the
descriptions of functions. These arguments are case-insensitive. As an example, function LOCATE
takes an optional argument by keyword value "ALL". Though not mentioned in the description,
argument values "all", "All" and even "aLL" are accepted as well.

In the function descriptions in this section, the data types of the arguments, as well as the data type
of the resulting value, are given for each function. Arguments within square brackets [] are optional.
Notation []* means that the argument within the square brackets is optional but may appear more
than one times. If not otherwise stated, all arguments can be arbitrary SCIL expressions of the
specified data type.

Examples:

The following examples illustrates the use of functions:

!SHOW TIME TIMES(OBJ:PRT)


;The latest registration time for the object is written out as a text in
the
;window called TIME.

#IF ODD(%I) #THEN #SET S:PBO(%I) = 0


;If the variable I is an odd number, the function ODD gets the value TRUE
and
;the #SET statement is executed.

SUM = PICK(A:D(1 .. 1000),I) + PICK(B:D(1 .. 1000),I)


;Corresponding indices of the data objects A and B are summed. The
indices are
;determined by the variable I.

!SHOW PEAK HIGH(POWER:DOV(1 .. 1000))


;The peak power is shown in the window PEAK.

10.1.2 Overview GUID-40F81F02-91C4-43B5-A4EB-E9AC46736FC3 v2

The following table lists all SCIL functions. The last column (labeled "S") states whether the function
has side-effects or not. The following notation is used:

• When the cell is empty, the function has no side-effects.


• Letter S denotes that the function has side-effects. Consequently, it can not be used in read-only
mode.
• Letter P denotes that the function has potential side-effects, but only with certain argument
values.

140 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Table 4: SCIL functions and the tasks they perform

Function Brief Description Page S


ABS(arg) The absolute value. Section 10.3.1
ADD_INTERLOCKED(object, index, amount) Modifies the UV or SV attribute of a SYS or an Section 10.28.1 s
APL object.
AEP_PROGRAMS(apl) Lists the running Application Extension Section 10.10.1
Programs of an application.
APPEND(v, data) Appends data to a vector. Section 10.7.1
APPLICATION_ALARM_COUNT(apl [, filter]) Counts the alarms and warnings of an Section 10.14.13
application.
APPLICATION_ALARM_LIST(apl, lists Lists the alarms and warnings of an Section 10.14.14
[,attributes [, order [, filter [, max_count]]]]) application.
APPLICATION_OBJECT_ATTRIBUTES(apl, Reads the values of specified attributes of Section 10.14.2
type, objects, attributes) given application objects.
APPLICATION_OBJECT_COUNT(apl, type Counts application objects that fulfil given Section 10.14.3
[,order [,direction [, start [,condition]]]]) conditions.
APPLICATION_OBJECT_EXISTS(apl, type, Checks whether an application object exists. Section 10.14.4
name [,condition [,verbosity]])
APPLICATION_OBJECT_LIST(apl, type Lists application objects that fulfil given Section 10.14.5
[,order [,direction [,start [,condition [,attributes conditions.
[,max]]]]])
APPLICATION_OBJECT_SELECT(apl, type, Selects from a list of objects the ones that fulfil Section 10.14.6
names, condition [,verbosity]]) the given condition.
ARCCOS(arg) Arcus cosinus. Section 10.3.2
ARCSIN(arg) Arcus sinus. Section 10.3.3
ARCTAN(arg) Arcus tangens. Section 10.3.4
ARGUMENT(n) Nth argument of the program call. Section 10.9.1
ARGUMENT_COUNT The total number of arguments of the program Section 10.9.2
call.
ARGUMENTS All arguments of the program call as a vector. Section 10.9.3
ASCII(n) The Unicode character corresponding to the Section 10.5.1
numeric character code.
ASCII_CODE(c) The numeric Unicode code of the character Section 10.5.2
argument.
ATTRIBUTE_EXISTS(list, attribute) Checks whether a list contains given Section 10.8.1
attribute(s).
AUDIO_ALARM(alarm_class, on_or_off) Sets and resets the specified audio alarm(s). Section 10.28.2 S
BASE_SYSTEM_OBJECT_LIST(type Lists the base system objects that fulfil the Section 10.14.7
[,condition [,attributes [,apl]]]) given condition.
BCD_TO_INTEGER(bcd) Converts BCD coded numbers to integers. Section 10.5.3
BIN(b) Represents bit strings and integers as text in Section 10.5.4
binary format.
BIN_SCAN(string) Creates an integer or real value out of its Section 10.5.5
binary text representation.
BINARY_SEARCH(v, value) Searches an ordered vector by its element Section 10.7.2
contents.
BIT(a, b) The bit value of a given bit in a bit string or Section 10.6.1
integer.
BIT_AND(a1, a2) Bitwise logical AND of the arguments. Section 10.6.2
BIT_CLEAR(a [,b]*) Sets given bits to 0. Section 10.6.3
Table continues on next page

MicroSCADA X SYS600 10.5 141


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Function Brief Description Page S


BIT_COMPL(a) Logical bit complement of the argument. Section 10.6.4
BIT_MASK([b1 [,b]]*) Bit mask with given bits set to 1. Section 10.6.5
BIT_OR(a1, a2) Bitwise logical OR of the arguments. Section 10.6.6
BIT_SCAN(string) Creates a bit string out of its text Section 10.5.6
representation.
BIT_SET(a [,b]*) Sets given bits to 1. Section 10.6.7
BIT_STRING(length [,b]*) Creates a bit string by setting given bits to 1 Section 10.6.8
and the other ones to 0.
BIT_XOR(a1, a2) Bitwise logical XOR (exclusive OR) of the Section 10.6.9
arguments.
CAPITALIZE(text) Capitalizes a text. Section 10.5.7
CASE(selector, w1, v1 [, wi, vi]* [, Selects one of the arguments according to the Section 10.2.1
"OTHERWISE", vo]) selector argument value.

CHOOSE(v) Chooses the first non-empty argument. Section 10.2.2


CHOOSE(v1, v2, [vi]*)

CLASSIFY(v, n, low, high) Classifies the elements of a vector into size Section 10.7.3
classes and returns the counts of each class.
CLOCK The present SYS time with a one-second Section 10.4.2
resolution.
COLLECT(v, delimiter) Collects text fields into a text. Section 10.5.8
COMPILE(source) Runs the SCIL compiler. Section 10.11.1
CONSOLE_OUTPUT(text [,severity Writes a message into the system error log Section 10.10.2 S
[,category]]) (SYS_LOG.CSV) and into the notification
window.
COS(arg) The cosine of the argument. Section 10.3.5
CSV_TO_SCIL(csv, start, field_info [,option]) Converts a CSV file format record into SCIL Section 10.19.1
data.
CUMULATE(v) Accumulates the elements of the argument Section 10.7.4
vector.
DATA_FETCH(apl, name, index1 [,step Reads history records of a data object. Section 10.14.16
[,count]]), DATA_FETCH(apl, name, time1,
time2 [,step [,shift]]), DATA_FETCH(apl,
name, time1 [,step [,count [,shift]]]),
DATA_FETCH(apl, name, indices)
DATA_MANAGER(function [,argument]*) SCIL database management. Section 10.16.1 P
DATA_MANAGER("CLOSE", handle) Closes a SCIL database when no longer used. Section 10.16.5
DATA_MANAGER("COPY", handle, new_file Makes a copy of an open SCIL database into Section 10.16.4 S
[, version]) another file.
DATA_MANAGER("CREATE", file) Creates a new SCIL database and opens it for Section 10.16.2 S
use.
DATA_MANAGER("CREATE_SECTION", Creates a new (empty) section in a SCIL Section 10.16.7 S
handle, section) database.
DATA_MANAGER("DELETE", handle, Deletes a component from a SCIL database. Section 10.16.11 S
section, [,component]*)
DATA_MANAGER("DELETE_SECTION", Deletes a section, both the name and the Section 10.16.8 S
handle, section) contents, from SCIL database.
DATA_MANAGER("GET", handle, section Reads data from SCIL database. Section 10.16.9
[,component]*)
DATA_MANAGER("LIST_SECTIONS", Lists the sections of a SCIL database in Section 10.16.6
handle) alphabetic order.
Table continues on next page

142 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Function Brief Description Page S


DATA_MANAGER("OPEN", file) Opens an existing SCIL database. Section 10.16.3
DATA_MANAGER("PUT", handle, section, Writes data to SCIL database. Section 10.16.10 S
data [,component]*)
DATA_STORE(apl, name, data, index1 Writes historical records of a data object. Section 10.14.17 S
[,step]), DATA_STORE(apl, name, data,
indices)
DATA_TYPE(expression) The data type of the argument Section 10.2.3
DATE[(time [,"FULL"])] The date (year, month and day) as text. Section 10.4.3
DAY[(time)] The day of month. Section 10.4.4
DDE_CONNECT(service, topic) Opens a connection to an external application. Section 10.20.1 S
DDE_DISCONNECT(connection_id) Closes the DDE connection. Section 10.20.2 S
DDE_EXECUTE(connection_id, statement Executes a statement in a remote application. Section 10.20.5 S
[,timeout])
DDE_POKE(connection_id, item, value Sets the value of 'item' in a remote application. Section 10.20.4 S
[,timeout])
DDE_REAL(real, separator) Creates a DDE style real number with a user Section 10.21.2
defined decimal separator.
DDE_REQUEST(connection_id, item Requests data from a remote application. Section 10.20.3 S
[,timeout])
DDE_VECTOR(vector, decimal_separator, Creates a DDE style list with a user defined list Section 10.21.1
list_separator) separator.
DEC(value [,length [,decimals]]) Represents integer and real values as text. Section 10.5.9
DEC_SCAN(string) Creates an integer or a real value out of its Section 10.5.10
decimal text representation.
DELETE_ATTRIBUTE(list, attribute) Deletes attribute(s) from a list. Section 10.8.2
DELETE_ELEMENT(v, index [,index2]) Deletes individual elements of a vector. Section 10.7.5
DELETE_PARAMETER(file, section [,key]) Deletes a parameter from a parameter file. Section 10.16.12 S
DIRECTORY_MANAGER("COPY", source, Copies a directory and all its contents into a Section 10.17.14 S
target) new directory.
DIRECTORY_MANAGER("COPY_CONTENT Copies the files of a directory into another Section 10.17.15 S
S", source, target [,filter [,subdirectories directory. Optionally, the subdirectories are
[,overwrite]]]) recursively copied as well.
DIRECTORY_MANAGER("CREATE", Creates a directory or a hierarchy of Section 10.17.10 S
directory [,recursion]) directories.
DIRECTORY_MANAGER("DELETE", Deletes one or more directories and all the Section 10.17.11 S
directory) directories and files contained in them.
DIRECTORY_MANAGER("DELETE_CONTE Deletes files and directories contained in a Section 10.17.12 S
NTS", directory [,filter [,subdirectories]]) given directory.
DIRECTORY_MANAGER("EXISTS", Checks the existence of one or more Section 10.17.13
directory) directories.
DIRECTORY_MANAGER("GET_ATTRIBUTE Returns attribute information from one or more Section 10.17.18
S", directory) directories.
DIRECTORY_MANAGER("LIST", directory Lists the directories contained in a given Section 10.17.9
[,filter [,recursion] [,hidden]]) directory.
DIRECTORY_MANAGER("MOVE", directory, Moves a directory to another directory. Section 10.17.16 S
target)
DIRECTORY_MANAGER("RENAME", Renames a directory. Section 10.17.17 S
directory, name)
DO(program [,a]*) Executes the SCIL program given as an Section 10.9.4 P
argument.
Table continues on next page

MicroSCADA X SYS600 10.5 143


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Function Brief Description Page S


DOW[(time)] The day of week. Section 10.4.5
DOY[(time)] The day of year . Section 10.4.6
DRIVE_MANAGER("EXISTS", drive) Checks the existence of one or more drives. Section 10.17.5
DRIVE_MANAGER("GET_ATTRIBUTES", Returns some information from drives. Section 10.17.7
tag)
DRIVE_MANAGER("GET_DEFAULT") Returns the default drive, i.e. the drive Section 10.17.6
assumed if an absolute path does not contain
the drive.
DRIVE_MANAGER("LIST") Returns the drives available in the system. Section 10.17.4
DUMP(data [,line_length]) Represents data as text in SCIL expression Section 10.2.4
syntax.
EDIT(text, key) Simple text editing. Section 10.5.11
ELEMENT_LENGTH(vl) The lengths of vector elements and list Section 10.2.5
attributes.
END_QUERY Tells whether a process object query is Section 10.14.19
completed.
ENVIRONMENT(variable) Retrieves an operating system environment Section 10.10.3
variable value.
EQUAL(v1, v2, [,status_handling Compares two SCIL values for equality. Section 10.2.6
[,case_policy]])
ERROR_STATE Returns the current error handling policy. Section 10.9.5
EVALUATE(expression) Evaluates an expression given as text in SCIL Section 10.2.7 P
syntax.
EVEN(arg) Tells whether the argument is even. Section 10.3.6
EXP(arg) The exponential function. Section 10.3.7
FETCH(apl, type, name [,index]) Fetches the configuration attributes of an Section 10.14.9
object.
FILE_LOCK_MANAGER(function, file) Locks and unlocks files. Section 10.16.13 S
FILE_MANAGER("COPY", source, target Copies the contents of a file to another file. Section 10.17.23 S
[,overwrite])
FILE_MANAGER("DELETE", file) Deletes one or more files. Section 10.17.21 S
FILE_MANAGER("EXISTS", file) Checks the existence of one or more files. Section 10.17.22
FILE_MANAGER("GET_ATTRIBUTES", file) Returns attribute information from one or more Section 10.17.26
files.
FILE_MANAGER("LIST", directory [,filter Lists the files contained in a given directory. Section 10.17.20
[,recursion] [, hidden]])
FILE_MANAGER("MOVE", file, target) Moves a file to another directory. Section 10.17.24 S
FILE_MANAGER("RENAME", file, name) Renames a file. Section 10.17.25 S
FIND_ELEMENT(v, value [,start_index Searches a vector by its element contents. Section 10.7.6
[,case_policy]])
FM_APPLICATION_DIRECTORY[(path)] Creates a directory tag out of an application Section 10.17.28
relative directory path.
FM_APPLICATION_FILE(path) Creates a file tag out of an application relative Section 10.17.29
file path.
FM_COMBINE(tag1 [,tagi]*, tagn) Combines two or more drive, directory or file Section 10.17.30
tags to create a new directory or file tag.
FM_COMBINE_NAME(name, extension) Combines a proper file name and an extension Section 10.17.31
to a file name.
Table continues on next page

144 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Function Brief Description Page S


FM_DIRECTORY(path [,check]) Creates a directory tag out of a directory path Section 10.17.32
or checks a directory path.
FM_DRIVE(name [,check]) Creates a drive tag out of a drive name or Section 10.17.33
checks a drive name.
FM_EXTRACT(tag, component) Extracts a component from one or more Section 10.17.34
directory or file tags.
FM_FILE(path [,check]) Creates a file tag out of a file path or checks a Section 10.17.35
file path.
FM_REPRESENT(tag [,option]*) Converts one or more drive, directory or file Section 10.17.36
tags into an OS dependent text representation.
FM_SCIL_DIRECTORY(name [,check]) Creates a directory tag out of a SCIL directory Section 10.17.37
name or checks a SCIL directory name.
FM_SCIL_FILE(name [,option] [,option]) Creates a file tag out of a SCIL file name or Section 10.17.38
checks a SCIL file name.
FM_SCIL_REPRESENT(tag [,case]) Converts one or more directory or file tags into Section 10.17.39
a SCIL name text representation.
FM_SPLIT_NAME(file) Extracts the proper name and the extension Section 10.17.40
from one or more file names.
GENERATE_HISTORY_EVENT(LN, IX, MT, Generates an event into the history database. Section 10.14.37
DATA)
GET_STATUS(data) Returns the status code(s) of a value. Section 10.2.8
HEX(n) Represents an integer as text in hexadecimal Section 10.5.12
format.
HEX_SCAN(string) Creates an integer or a real value out of its Section 10.5.13
hexadecimal text representation.
HIGH(v) The largest (HIGH) or the smallest (LOW) Section 10.7.7
element in a vector.
HIGH_INDEX(v) The index of the largest or smallest element in Section 10.7.8
a vector.
HIGH_PRECISION_ADD(n1 [,n]*) Adds up two or more high precision numbers. Section 10.3.8
HIGH_PRECISION_DIV(n1, n2) Divides a high precision number by another. Section 10.3.9
HIGH_PRECISION_MUL(n1, n2) Multiplies two high precision numbers. Section 10.3.10
HIGH_PRECISION_SHOW(n [,decimals]) Displays a high precision number in various Section 10.3.11
formats.
HIGH_PRECISION_SUB(n1, n2) Subtracts a high precision number from Section 10.3.12
another.
HIGH_PRECISION_SUM(v) Calculates the sum of the high precision Section 10.3.13
number elements of a vector.
HISTORY_DATABASE_MANAGER("CLOSE" Closes a session to the history database of an Section 10.14.23
, session) application.
HISTORY_DATABASE_MANAGER("GET_PA Returns the current values of parameters. Section 10.14.32
RAMETERS", session)
HISTORY_DATABASE_MANAGER("OPEN" Opens a session to the history database of an Section 10.14.22
[,apl]) application.
HISTORY_DATABASE_MANAGER("QUERY" Performs a history database query. Section 10.14.33
, session, count [,start])
HISTORY_DATABASE_MANAGER("READ", Reads all the attributes of an event. Section 10.14.34
session, event)
HISTORY_DATABASE_MANAGER("SET_AT Sets the attributes whose values are to be Section 10.14.31
TRIBUTES", session, attributes) returned by the query.
Table continues on next page

MicroSCADA X SYS600 10.5 145


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Function Brief Description Page S


HISTORY_DATABASE_MANAGER("SET_C Sets the EX attribute of the specified event. Section 10.14.35 S
OMMENT", session, event, comment)
HISTORY_DATABASE_MANAGER("SET_C Sets the condition for requested events. Section 10.14.30
ONDITION", session, condition)
HISTORY_DATABASE_MANAGER("SET_DI Sets the search direction. Section 10.14.28
RECTION", session, direction)
HISTORY_DATABASE_MANAGER("SET_DI Sets the location of database files. Section 10.14.25
RECTORY", session, directory)
HISTORY_DATABASE_MANAGER("SET_O Sets the listing order. Section 10.14.27
RDER", session, order)
HISTORY_DATABASE_MANAGER("SET_PE Sets the time period of the database query. Section 10.14.24
RIOD", session, begin [,end])
HISTORY_DATABASE_MANAGER("SET_TI Sets the maximum time a query may last. Section 10.14.29
MEOUT", session, timeout)
HISTORY_DATABASE_MANAGER("SET_WI Sets the time window of the query. Section 10.14.26
NDOW", session, begin, end)
HISTORY_DATABASE_MANAGER("WRITE", Writes an event into the history database. Section 10.14.36 S
session, data)
HOD[(time)] Hours passed since the beginning of the day. Section 10.4.7
HOUR[(time)] The hour. Section 10.4.8
HOY[(time)] Hours passed since the beginning of the year. Section 10.4.9
HR_CLOCK SYS time in seconds and microseconds. Section 10.4.10
IF(condition, truevalue, falsevalue) Selects one of two arguments according to a Section 10.2.9
given condition.
INSERT_ELEMENT(v, pos, contents) Inserts new elements into a vector. Section 10.7.9
INTEGER_TO_BCD(int [,digits]) Represents an integer value as a BCD coded Section 10.5.14
bit string
INTERP(v, x) Interpolates a value from a curve. Section 10.7.10
INVERSE(v, n, low, high) Inverts a curve. Section 10.7.11
IP_PROGRAMS Lists the running Integrated Programs in the Section 10.10.4
system.
JOIN(delimiter [, a]*) Joins text fields into a text. Section 10.5.15
KEYED_FILE_MANAGER(function, file File maintenance function. Section 10.16.14 P
[,output_file [,key_size] [,version]])
LENGTH (arg) The length of the argument. Section 10.2.10
LIST([attribute = expression, [attribute = List created out of given attribute name/value Section 10.8.3
expression]*])] pairs.
LIST_ATTR(list) Names of attributes of a list. Section 10.8.4
LN(arg) Natural logarithm. Section 10.3.14
LOCAL_TIME The present local time. Section 10.4.11
LOCAL_TIME_ADD(time, s [,ms]) Adds seconds and milliseconds to given local Section 10.4.12
time.
LOCAL_TIME_INFORMATION[(time)] Gives information on given local time. Section 10.4.13
LOCAL_TIME_INTERVAL(from, to) The length of the time interval between two Section 10.4.14
local times.
LOCAL_TO_SYS_TIME(time) Converts local time to SYS time. Section 10.4.15
LOCAL_TO_UTC_TIME(time) Converts local time to UTC time. Section 10.4.16
LOCATE(string1, string2 [,"ALL"]) Locates a text string in a text. Section 10.5.16
Table continues on next page

146 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Function Brief Description Page S


LOGICAL_MAPPING(otype, number [, apl]) Maps physical (base system) object numbers Section 10.14.41
to logical object numbers.
LOW(v) The largest (HIGH) or the smallest (LOW) Section 10.7.7
element in a vector.
LOWER_CASE(text) Converts text to lower case. Section 10.5.17
LOW_INDEX(v) The index of the largest or smallest element in Section 10.7.8
a vector.
MAX(arg1 [,arg]*) The largest value in the argument list. Section 10.3.15
MAX_APPLICATION_NUMBER Maximum number of application objects. Section 10.11.2
MAX_BIT_STRING_LENGTH Maximum number of bits in a bit string type Section 10.11.3
value.
MAX_BYTE_STRING_LENGTH Maximum number of bytes in a byte string type Section 10.11.4
value.
MAX_INTEGER Largest positive integer value. Section 10.11.5
MAX_LINK_NUMBER Maximum number of link objects. Section 10.11.6
MAX_LIST_ATTRIBUTE_COUNT Maximum number of attributes in a list. Section 10.11.7
MAX_MONITOR_NUMBER Maximum number of monitor objects. Section 10.11.8
MAX_NODE_NUMBER Maximum number of node objects. Section 10.11.9
MAX_OBJECT_NAME_LENGTH Maximum length of application and Visual SCIL Section 10.11.10
object names.
MAX_PICTURE_NAME_LENGTH Maximum length of picture names. Section 10.11.11
MAX_PRINTER_NUMBER Maximum number of printer objects. Section 10.11.12
MAX_PROCESS_OBJECT_INDEX Maximum number of process objects in a Section 10.11.13
process object group.
MAX_REPRESENTATION_NAME_LENGTH Maximum length of representation names. Section 10.11.14
MAX_STATION_NUMBER Maximum number of station objects. Section 10.11.15
MAX_STATION_TYPE_NUMBER Maximum number of station type objects. Section 10.11.16
MAX_TEXT_LENGTH Maximum number of characters in a text type Section 10.11.17
value.
MAX_VECTOR_LENGTH Maximum number of elements in a vector. Section 10.11.18
MAX_WINDOW_NAME_LENGTH Maximum length of window and picture Section 10.11.19
function names.
MEAN(v) The mean value of the elements of a vector. Section 10.7.12
MEMORY_POOL_USAGE(pool) The amount of memory allocated from a Section 10.10.5
memory pool.
MEMORY_USAGE(keyword, arg) The amount of pool memory allocated for the Section 10.9.6
argument.
MERGE_ATTRIBUTES(left, right) Merges two lists into one. Section 10.8.5
MIN(arg1 [,arg]*) The smallest value in the argument list. Section 10.3.16
MIN_INTEGER Smallest negative integer value. Section 10.11.20
MINUTE[(time)] The minute. Section 10.4.17
MONTH[(time)] The number of the month. Section 10.4.18
NAME_HIERARCHY(names, order, syntax [, Constructs the tree hierarchy formed by given Section 10.14.39
arg4 [, arg5]]) fully qualified hierarchical names.
NETWORK_TOPOLOGY_MANAGER(subfun Manages the network topology functionality of Section 10.15.1 P
ction [, arg]* [, apl]) an application.
Table continues on next page

MicroSCADA X SYS600 10.5 147


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Function Brief Description Page S


NETWORK_TOPOLOGY_MANAGER("DELE Deletes a model from the application. Section 10.15.12 S
TE", model)
NETWORK_TOPOLOGY_MANAGER("EXPO Exports a model from the application Section 10.15.11
RT", model)
NETWORK_TOPOLOGY_MANAGER("IMPO Imports a new model or updates an existing Section 10.15.10 S
RT", modeldata) model.
NETWORK_TOPOLOGY_MANAGER("LEVE Lists the application specific (voltage) levels of Section 10.15.4
LS", schema) the schema.
NETWORK_TOPOLOGY_MANAGER("MOD Returns information about a model. Section 10.15.7
EL", model)
NETWORK_TOPOLOGY_MANAGER("MOD Lists the imported network topology models of Section 10.15.6
ELS") the application.
NETWORK_TOPOLOGY_MANAGER("SCHE Returns information about a schema. Section 10.15.3
MA", schema)
NETWORK_TOPOLOGY_MANAGER("SCHE Lists the supported network topology schemas. Section 10.15.2
MAS")
NETWORK_TOPOLOGY_MANAGER("SET_ Sets the application specific (voltage) levels of Section 10.15.5 S
LEVELS", schema, levels) the schema.
NETWORK_TOPOLOGY_MANAGER("STAR Starts/stops calculation of a model. Section 10.15.8 S
T", model),
NETWORK_TOPOLOGY_MANAGER("STOP
", model)
NETWORK_TOPOLOGY_MANAGER("VALID Validates a model. Section 10.15.9
ATE", modeldata)
NEXT(n) Fetches the configuration attributes of an Section 10.14.10
object within a search result.
OBJECT_ATTRIBUTE_INFO(apl, type Returns the properties of application or system Section 10.11.21
[,subtype [,selection]]) object attributes.
OCT(n) Represents an integer as text in octal format. Section 10.5.18
OCT_SCAN(string) Creates an integer or a real value out of its Section 10.5.19
octal text representation.
ODD(arg) Tells whether the argument is odd. Section 10.3.17
OPC_AE_ACKNOWLEDGE(apl, ln, ix, ack_id Acknowledges a condition in an OPC A&E Section 10.24.1 S
[, comment [, cookie, active_time]]) server.
OPC_AE_NAMESPACE(nodenr [, clsid1 [, Lists the name space of an OPC A&E server. Section 10.24.2
root]]), OPC_AE_NAMESPACE(nodename,
clsid2 [, root [, user, password]])
OPC_AE_REFRESH(apl, unit) Requests a refresh from an external OPC A&E Section 10.24.3 S
server.
OPC_AE_SERVERS(nodenr), Lists the OPC A&E servers found in a network Section 10.24.4
OPC_AE_SERVERS(nodename [, user, node.
password])
OPC_AE_VALIDATE(apl, unit) Cross-checks a process database and the Section 10.24.5
name space of an OPC A&E server.
OPC_DA_NAMESPACE(nodenr [, clsid1 [, Lists the OPC item hierarchy of an OPC Data Section 10.24.6
root]]), OPC_DA_NAMESPACE(nodename, Access server.
clsid2 [, root [, user, password]])
OPC_DA_REFRESH(apl, unit, group [, wait]) Requests a refresh of an item group from an Section 10.24.7 S
external OPC DA server.
OPC_DA_SERVERS(nodenr), Lists the OPC Data Access servers found in a Section 10.24.8
OPC_DA_SERVERS(nodename [, user, network node.
password])
Table continues on next page

148 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Function Brief Description Page S


OPC_NAME_MANAGER(function, apl OPC Name Database maintenance. Section 10.23.1 P
[,argument]*)
OPC_NAME_MANAGER("DELETE", apl, Deletes a name from the OPC Name Section 10.23.5 S
name) Database.
OPC_NAME_MANAGER("GET", apl, name) Reads the definition of a name from the OPC Section 10.23.4
Name Database.
OPC_NAME_MANAGER("LIST", apl) Lists the OPC item names found in the OPC Section 10.23.2
Name Database.
OPC_NAME_MANAGER("PUT", apl, name, Creates a new name in the OPC Name Section 10.23.3 S
definition) Database or overwrites an existing one.
OPS_CALL(command [,nowait]), Executes an operating system command. Section 10.9.7 S
OPS_CALL(command [,option1 [,option2]])
OPS_NAME[([major [,minor]])] Returns the name of the operating system. Section 10.10.6
OPS_PROCESS(command [,directory Starts an external program as a separate Section 10.9.8 S
[,option1 [,option2]]]) process.
PACK_STR(source, type [,length Creates a text, a bit string or a byte string out Section 10.5.20
[,byte_order]]) of its elements.
PACK_TIME(year, month, day, hour, minute, Creates a SCIL time data value out of its Section 10.4.19
second) components.
PAD([string, ]filler, length) Pads a text with a filler string to the given Section 10.5.21
length.
PARSE_FILE_NAME(name [,file]) Converts SCIL path names and file names to Section 10.16.15
operating system file names.
PATH(name) The directories contained in a logical path. Section 10.16.16
PATHS(level) The logical paths defined on a specified level. Section 10.16.17
PHYS_FETCH(apl, unit, address Fetches the configuration attributes of a Section 10.14.11
[,bit_address]) process object
PHYSICAL_MAPPING(otype, number [, apl]) Maps logical object numbers to physical (base Section 10.14.42
system) object numbers.
PICK(v, indices) Picks up specified elements from a vector. Section 10.7.13
PREV(n) Fetches the configuration attributes of an Section 10.14.10
object within a search result.
PRINT_TRANSPARENT(data [,log]) Sends printout to a printer. Section 10.26.1 S
PRINTER_SET Returns the target printer numbers. Section 10.26.2
PROD_QUERY(n) Returns attributes of objects selected by a Section 10.14.20
process object query.
RANDOM(n1, n2) Generates a random number. Section 10.3.18
READ_BYTES(file [,start [,length]]) Reads a binary file. Section 10.16.18
READ_COLUMNS(file, pos, width [,start Reads a text file as columns. Section 10.16.19
[,count]])
READ_PARAMETER(file, section, key Reads a parameter from a parameter file. Section 10.16.20
[,default])
READ_TEXT(file [,start [,number]]) Reads a text file. Section 10.16.21
REGISTRY(function, key, value_name) Reads the registry maintained by Windows Section 10.10.7 P
operating system.
REMOVE_DUPLICATES(v [,status_handling Removes duplicate elements of a vector. Section 10.7.14
[,case_policy]])
REP_LIB(name) The files contained in a logical representation Section 10.16.22
library.
Table continues on next page

MicroSCADA X SYS600 10.5 149


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Function Brief Description Page S


REP_LIBS(level) The logical library names defined on a Section 10.16.23
specified level.
REPLACE(text, string, new_string) Replaces text strings by another string. Section 10.5.22
REVERSE(v) Reverses the order of elements of a vector. Section 10.7.15
REVISION_COMPATIBILITY(issue [,enable]) Selects the compatibility issues to be used in Section 10.9.9
the context.
ROUND(arg [,decimals])) Rounds off a real value. Section 10.3.19
RTU_ADDR(key) Returns a list with the address of the object in a Section 10.25.1
certain record.
RTU_AINT(i) Converts an integer to ASCII characters Section 10.25.2
(according to the RP570 protocol).
RTU_AREAL(r) Converts a real number to four ASCII Section 10.25.3
characters (float DS801).
RTU_ATIME [(t [,msec])] Converts time data (operating system time) to Section 10.25.4
ASCII (RTU200 time).
RTU_BIN(h) Converts HEX-ASCII numbers given as a text Section 10.25.5
to binary numbers in text form.
RTU_HEXASC(b) Converts binary numbers given as a text to Section 10.25.6
hex-ascii numbers as a text.
RTU_INT(a) Converts two ASCII characters (2's Section 10.25.7
complement RP570) to an integer.
RTU_KEY(oa) Returns the search key for a record in an Section 10.25.8
RTU200 configuration file.
RTU_MSEC(atime) Returns the milliseconds of the 6-byte RTU Section 10.25.9
time string 'atime'.
RTU_OA(type, ba) Returns the object address. Section 10.25.10
RTU_REAL(a) Converts 4 ASCII characters (float DS801) to a Section 10.25.11
real number.
RTU_TIME(a) Converts ASCII (RTU200 time) to SYS600 time Section 10.25.12
data.
SCALE(v, scale_object [,direction]) Scales a value using a scale object. Section 10.28.3
SCIL_HOST Returns the type and number of the process Section 10.10.8
that is running this SCIL code.
SCIL_LINE_NUMBER Tells the current line number within the SCIL Section 10.13.1
program.
SCIL_TO_CSV(data [,option]*) Converts SCIL data into a CSV file format Section 10.19.2
record.
SECOND[(time)] The second. Section 10.4.20
SELECT(source, condition [,wildcards]) Selects the elements of a vector or a list of Section 10.7.16
vectors that fulfil given condition.
SEPARATE(text, delimiter) Extracts fields of a text. Section 10.5.23
SET_CLOCK(time) Sets the SYS time. Section 10.4.21
SET_EVENT_LIST_USER_NAME(name) Sets the name that is displayed in User Name Section 10.27.1
column of the event list.
SET_LANGUAGE(language) Sets the current language of the SCIL context. Section 10.12.4
SET_LOCAL_TIME(time) Sets the local time of the system. Section 10.4.22 S
SET_RANDOM_SEED(seed) Sets the seed number of the random number Section 10.3.20
generator.
SET_STATUS(source, status) Modifies the status code of SCIL data. Section 10.2.11
Table continues on next page

150 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Function Brief Description Page S


SET_SYS_TIME(time) Sets the SYS time of the system. Section 10.4.23 S
SET_UTC_TIME(time) Sets the UTC time of the system. Section 10.4.24 S
SHADOW_FILE(file_name [,"DELETED"]) Queues a file for shadowing. Section 10.16.24 S
SHUFFLE(n) Shuffles integers 1 to n into a random order. Section 10.7.17
SIN(arg) The sine of the argument. Section 10.3.21
SORT(v, [start, [length]]) Sorts a vector. Section 10.7.18
SPACOM(message) Communicates with a SPACOM unit connected Section 10.18.1 S
to a COM port.
SPREAD(v, indices, new_value) Replaces vector elements by a new value. Section 10.7.19
SQL_BEGIN_TRANSACTION(connection_id) Marks the beginning of a transaction. Section 10.22.6 S
SQL_COMMIT(connection_id) Commits a transaction the start of which was Section 10.22.7 S
marked with SQL_BEGIN_TRANSACTION.
SQL_CONNECT(source, user, password) Opens an ODBC connection to a data source. Section 10.22.1 S
SQL_DISCONNECT(connection_id) Closes the ODBC connection defined by the Section 10.22.2 S
argument.
SQL_EXECUTE(connection_id, SQLstring Executes an SQL statement. Section 10.22.3 S
[,timeout])
SQL_FETCH(statement_id) Fetches a row of data from a result set Section 10.22.4 S
obtained by SQL_EXECUTE.
SQL_FREE_STATEMENT(statement_id) Frees the specified statement and stops Section 10.22.5 S
processing associated with the statement.
SQL_ROLLBACK(connection_id) Rolls back a transaction started with Section 10.22.8 S
SQL_BEGIN_TRANSACTION.
SQRT(arg) The square root of the argument. Section 10.3.22
STATUS The status code of the last error in the Section 10.9.10
program.
STATUS_CODE(mnemonic) The numeric value of a mnemonic status code Section 10.11.22
name.
STATUS_CODE_NAME(code) The mnemonic name of a numeric status code. Section 10.11.23
SUBSTR(string, start [,length]) Extracts a substring from a text, bit string or Section 10.5.24
byte string value.
SUM(v), SUM_POS(v), SUM_NEG(v) The sum of all or the positive or the negative Section 10.7.20
elements of a vector.
SYS_TIME The present SYS time. Section 10.4.25
SYS_TIME_ADD(time, s [,ms]) Adds seconds and milliseconds to given SYS Section 10.4.26
time.
SYS_TIME_INTERVAL(from, to) The length of the time interval between two Section 10.4.27
SYS times.
SYS_TO_LOCAL_TIME(time) Converts SYS time to local time. Section 10.4.28
SYS_TO_UTC_TIME(time) Converts SYS time to UTC time. Section 10.4.29
TEXT_READ(file [,start [,number]) Reads a text file or a part of it. Section 10.16.25
TIME[(time [,"FULL"])] Date and time as text, excluding seconds. Section 10.4.30
TIME_SCAN(string [,resolution [,option1 Interprets a date/time text string. Section 10.4.31
[,option2]]])
TIME_ZONE_RULES[(rule)] Reads and sets the time zone rules of the Section 10.4.32 S
system.
TIMEMS[(time [,msecs] [,"FULL"])] Date and time as text, including seconds and Section 10.4.33
milliseconds.
Table continues on next page

MicroSCADA X SYS600 10.5 151


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Function Brief Description Page S


TIMEOUT(millisecs) Changes the communication time-out. Section 10.18.2
TIMES[(time [,"FULL"])] Date and time as text, including seconds. Section 10.4.34
TOD[(time)] Time of day as text, excluding seconds Section 10.4.35
TODMS[(time [,msecs])] Time of day as text, including seconds and Section 10.4.36
milliseconds.
TODS[(time)] Time of day as text, including seconds. Section 10.4.37
TRACE_BEGIN(filename [,append] Starts trace logging. Section 10.13.2 S
[,time_tags] [,no_cyclics])
TRACE_END Stops trace logging. Section 10.13.3 S
TRACE_PAUSE Pauses trace logging. Section 10.13.4 S
TRACE_RESUME Resumes trace logging. Section 10.13.5 S
TRANSLATE(text [,language]) Translates texts defined in Visual SCIL objects. Section 10.12.5
TRANSLATION(id [,language]) Translates texts by using text databases. Section 10.12.6
TREND(v, n) Returns the last (‘newest’) elements of a Section 10.7.21
vector.
TRUNC(arg [,decimals]) Truncates a real value. Section 10.3.23
TYPE_CAST(source, type) Views data as if it were of different data type. Section 10.2.12
UNLOCK_PICTURE(picture) Unlocks a locked picture. Section 10.28.4 S
UNPACK_STR(source [,length [,byte_order]]) Splits a text, a bit string or a byte string to a Section 10.5.25
vector of its elements.
UPPER_CASE(text) Converts text to upper case. Section 10.5.26
USM_ADDRESS Tells the address of the workplace computer Section 10.27.2
where the user logged in.
USM_AOR_DATA Reads the AoR(Area of Responsibility) related Section 10.27.3
data of the user session.
USM_AUTHORIZATION_LEVEL(group) Reads the authorization level of the user in a Section 10.27.4
given authorization group.
USM_AUTHORIZATION_LEVEL_FOR_OBJE Reads the authorization level of the user for Section 10.27.5
CT(group, object_name, object_index) controlling a process object.
USM_AUTHORIZATIONS Reads the authorizations of current user. Section 10.27.6
USM_CHANGE_PASSWORD(old_password, Changes the password of the user. Section 10.27.7
new_password)
USM_IS_NEW_APPLICATION Tells whether the current application is a new Section 10.27.8
one.
USM_LOGIN(name, password) Logs in a user starting a new session or silently Section 10.27.9
joins an existing session as a sub-session.
USM_LOGOUT Logs out the user. Section 10.27.10
USM_PASSWORD_CHANGE Tells the status of the password. Section 10.27.11
USM_PASSWORD_POLICY Reads the password policy of the application. Section 10.27.12
USM_RELEASE_USER_SESSIONS Releases user login sessions. If optional Section 10.27.13
parameter 'session nr' is not provided, all user
sessions of the specified 'user' are released.
USM_SELECT_ROLE(role) Selects the role for the starting session. Section 10.27.14
USM_SESSION_ATTRIBUTES Reads the Monitor Pro session attributes. Section 10.27.15
USM_SESSION_ID Tells the id of current session. Section 10.27.16
USM_SESSIONS Lists the active sessions in the system. Section 10.27.17
USM_USER_LANGUAGE Tells the user's preferred language. Section 10.27.18
Table continues on next page

152 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Function Brief Description Page S


USM_USER_NAME Tells the name of current user. Section 10.27.19
USM_USER_ROLE Tells the name of the role that the user has Section 10.27.20
selected at login.
USM_USER_ROLES Lists the roles that the user may select from Section 10.27.21
after a successful login.
UTC_TIME The present UTC time. Section 10.4.38
UTC_TIME_ADD(time, s [,ms]) Adds seconds and milliseconds to given UTC Section 10.4.39
time.
UTC_TIME_INTERVAL(from, to) The length of the time interval between two Section 10.4.40
UTC times.
UTC_TO_LOCAL_TIME(time) Converts UTC time to local time. Section 10.4.41
UTC_TO_SYS_TIME(time) Converts UTC time to SYS time. Section 10.4.42
VALIDATE(as, string) Validates a text string as a SCIL object name. Section 10.11.24
VALIDATE_OBJECT_ADDRESS(apl, pt, un, Validates an object address. Section 10.11.25
oa [,subaddress] [, self])
VARIABLE_NAMES Lists the names of global variables defined in Section 10.9.11
the SCIL context.
VECTOR [([element1 [,element]*)] Creates a vector out of given elements. Section 10.7.22
WEEK(time)] The number of the week within a year. Section 10.4.43
WRITE_BYTES(file, data [,append]) Writes a binary file. Section 10.16.26 S
WRITE_COLUMNS(file, pos, width, data Writes a text file as columns. Section 10.16.27 S
[,append] [,encoding])
WRITE_PARAMETER(file, section, key, value Writes a parameter into a parameter file. Section 10.16.28 S
[, encoding])
WRITE_TEXT(file, text [,append] [,encoding]) Writes a text file. Section 10.16.29 S
YEAR(time)] The year. Section 10.4.44

10.2 Generic functions GUID-7F7D9760-FAC5-4873-A9B5-5364CF06E6C2 v1

10.2.1 CASE(selector, w1, v1 [, wi, vi]* [, "OTHERWISE", vo])


GUID-CB4B5C48-5AFE-4737-B098-2FF74BEC0340 v1

Selects one of the arguments according to the selector argument value.

'selector' Any value of type integer, real, boolean, time, text or bits string.
'w1' , 'wi' Values of a type compatible to 'selector', or a vector of such values. Up to 13 'w'
arguments may be given.
'v1', 'vi', 'vo' Any values.

"OTHERWISE" An optional text keyword.


Value: If 'selector' equals one of the 'wi' arguments, the resulting value is the corresponding 'vi'
argument. If not, the values is 'vo', if "OTHERWISE" argument given.

The error status SCIL_NO_MATCH_IN_CASE_FUNCTION is returned, if no match is found and


"OTHERWISE" branch is not given.

Example:

The following example gives display names to some SCIL status code values:

MicroSCADA X SYS600 10.5 153


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

CASE(%STATUS, 0, "Good", 1, "Faulty", 2, "Obsolete", 3, "Invalid time", -


10, "Not sampled", "Otherwise", "Unexpected status")

10.2.2 CHOOSE(v), CHOOSE(v1, v2, [vi]*)


GUID-0287DA2A-33FB-4A16-BE98-65684E3E9341 v1

Chooses the first non-empty argument.

'v' A vector of any number of type compatible elements.


'v1', 'v2', 'vi' Up to 32 type compatible arguments.

Value: The first 'non-empty' element in the vector, or the first 'non-empty' argument in the
argument list.

The meaning of 'empty' by data types:

Integer 0
Real 0.0
Boolean FALSE
Time 1978-01-01 00:00:00
Text ""
Bit string BIT_STRING(0)
Byte string Empty byte string (length 0)
Vector VECTOR()
List LIST()

Example:

The following example evaluates to the ON attribute value of process object PO:P10, if ON is
defined. If not, the result is the value of the OI attribute, if OI is defined. The result is "No id", if both
ON and OI are empty.

CHOOSE(PO:PON10, PO:POI10, "No id")

10.2.3 DATA_TYPE(expression) GUID-EBDDDB2F-44E8-44C1-B26E-2022BC5FB613 v1

The data type of the argument

The function returns the data type of the argument, or value "NONE" if the expression cannot be
evaluated. Consequently, it can be used to check an expression, for example the existence of a
variable.

'expression' An expression of any data type.


Value: Text. The data type of the expression:
"INTEGER"
"REAL"
"BOOLEAN"
"TEXT"
"TIME"
"BIT_STRING"
"BYTE_STRING"
Table continues on next page

154 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

"VECTOR"
"LIST"
"NONE" (= the expression is wrong or undefined)

Example:

DATA_TYPE(CLOCK) == "TIME"
#IF DATA_TYPE(DATA:DOV) == "NONE" #THEN .......

10.2.4 DUMP(data [,line_length]) GUID-6FD6712B-1F2F-4F89-987E-4CC429FE272E v1

Represents data as text in SCIL expression syntax.

This function creates a text vector that represents the contents of any SCIL data in SCIL expression
syntax. The status code of each data item (unless 0) is also dumped.

'data' An expression of any data type.


'line_length' An integer, 80 ... 65 535. Maximum line length in the resulting text vector. Default is 80.
Value: A text vector.

This function can be used to store any SCIL data structure in a text file.

The contained control characters (codes 0 - 31) are dumped as 'ASCII(code)'.

See function EVALUATE for the reverse operation.

10.2.5 ELEMENT_LENGTH(vl) GUID-1A1CAAD6-FD12-4EB5-ACBB-C3474A061987 v1

The lengths of vector elements and list attributes.

'vl' Vector or list value.


Value: Vector or list containing the lengths of components of 'vl'.

If the argument 'vl' is a vector, the value of the function call is an integer vector of the same length,
the nth element of the resulting value containing the length of nth element of 'vl'.

If the argument 'vl' is a list, the value of the function call is a list having the same attributes as 'vl',
each containing the length of the corresponding attribute of 'vl'.

Example 1:

#LOCAL LINES, LINE_LENGTHS


LINES = READ_TEXT("c:\sc\stool\misc\languages.txt") ;A text file is read
LINE_LENGTHS = ELEMENT_LENGTH(LINES) ;LINE_LENGTHS contains the length of

;each line

10.2.6 EQUAL(v1, v2, [,status_handling [,case_policy]]) GUID-3F109478-A60F-4E5C-B166-4E7799FE9ED7 v1

Compares two SCIL values for equality.

MicroSCADA X SYS600 10.5 155


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'v1' First value of any type.


'v2' Second value of any type.
'status_handling' Text keyword value, either "CONSIDER_STATUS" or "IGNORE_STATUS"), default =
"IGNORE_STATUS"
'case_policy' Text keyword value, either "CASE_SENSITIVE" or "CASE_INSENSITIVE", default =
"CASE_SENSITIVE"
Value: Boolean value TRUE if 'v1' is equal to 'v2', otherwise FALSE.

The arguments 'status_handling' and 'case_policy' may be given in any order.

Two values are considered equal if all the following conditions are met:

• The value types are the same.


• The values are the same.
• The status values are the same (when "CONSIDER_STATUS") or else both are valid (<=
LAST_VALID_STATUS) (when "IGNORE_STATUS").

Text values are compared for equality according to the argument 'case_policy'.

The test for equality is recursive, i.e. if the value is a vector or list, its components are tested for
equality.

Example:

EQUAL(1,1) ;returns TRUE


EQUAL(1,1.0) ;returns FALSE (different
EQUAL(RANDOM(1,10),RANDOM(1,10)) types)
EQUAL("ABC","abc") ;returns TRUE or FALSE
EQUAL("ABC","abc","case_insensitive") ;returns FALSE
;returns TRUE

10.2.7 EVALUATE(expression) GUID-13C09796-63FE-4301-BD29-1AB0CDEB0212 v1

Evaluates an expression given as text in SCIL syntax.

'expression' A text or text vector value containing the SCIL expression to be evaluated. If a text
vector is given, other lines but the last one must end with a continuation character (-).
Value: The result of the evaluation, which may be of any data type.

See function DUMP for the reverse operation.

For any value v, EVALUATE(DUMP(v)) results to v, except for one case: real numbers
may slightly lose their precision.

Example:

The following example shows how to store any data value (such as a complicated list) in a disk file
and then read it back:

#LOCAL WRITE_STATUS = WRITE_TEXT("DUMP.TXT",DUMP(V))


#IF WRITE_STATUS == 0 #THEN W = EVALUATE(READ_TEXT("DUMP.TXT"))

156 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.2.8 GET_STATUS(data) GUID-C73C8BEC-4A83-4CD4-A3F1-7BD336F04473 v1

Returns the status code(s) of a value.

'data' A value of any data type.


Value: If 'data' is of a simple data type, the function returns an integer value. If it is a vector,
the function returns an integer vector containing the status codes of each element of
the argument vector. If it is a list, the function returns a list with the same attribute
names, each attribute containing the status code of the corresponding argument
attribute.

See function SET_STATUS for the reverse operation.

10.2.9 IF(condition, truevalue, falsevalue) GUID-0D71D169-BF14-49B6-B9D9-AB63567B11D1 v1

Selects one of two arguments according to a given condition.

'condition' A boolean value.


'truevalue' A value of any data type.
'falsevalue' A value of any data type.
Value: If 'condition' is TRUE, 'truevalue', else 'falsevalue'.

Example:

The following example evaluates to "Work" or "Weekend" according to the current day of week:

IF(DOW <= 5, "Work", "Weekend")

10.2.10 LENGTH (arg) GUID-07DECF7F-C06F-48B9-9309-985AAB2C6A5D v1

The length of the argument.

'arg' A value of any data type.


Value: Integer value. According to the data type of the argument, the following is returned:
Integer 1
Real 1
Boolean 1
Time 1
Text The number of characters in the text.
Bit string The number of bits in the string
Byte string The number of bytes in the byte string
Vector The number of elements in the vector.
List The number of attributes in the list.

Examples:

LENGTH(340) == 1
LENGTH("ABCD") == 4
LENGTH(" ") == 1
LENGTH("") == 0

MicroSCADA X SYS600 10.5 157


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.2.11 SET_STATUS(source, status) GUID-9A2C92CB-D923-4035-952D-6A4023C6567C v1

Modifies the status code of SCIL data.

'source' A value of any data type.


'status' An integer expression, 0 ... 65 535, or a vector or a list of such integers.
Value: Same data type as 'source'.

The function merges the contents of 'source' argument and the status code(s) 'status' as follows:

• If 'source' is of a simple data type, 'status' must be an integer value.


• If 'source' is a vector, 'status' may be an integer or an integer vector. If 'status' is an integer, the
status of each element of 'source' is set to 'status'. If 'status' is a vector, the status of nth element
of 'source' is set to the nth element of 'status'. If the vector 'status' is shorter than the vector
'source', the 'source' is modified only up to the length of 'status'. If 'status' is longer than 'source',
the extra elements are ignored.
• If 'source' is a list, 'status' may be an integer or a list value. If 'status' is an integer, the status of
each attribute of 'source' is set to 'status'. If 'status' is a list, the status of 'source' attribute NN is
set to the value of 'status' attribute NN. The attributes of 'status' that do not exist in 'source' are
ignored. The attributes of 'source' that do not exist in 'status' are unaffected.

If a value is assigned a status code >= 10, the value itself is lost. If a value in 'source' has a status
code >= 10, and it is assigned a status code <10, the value is initialized by integer zero.

See function GET_STATUS for the reverse operation.

Examples:

@V = SET_STATUS(%V, 2)
;Status code 2, OBSOLETE_STATUS, is set to the variable V.

@A = SET_STATUS(%A,GET_STATUS(%B))
;The status of the variable A is copied from the variable B.

10.2.12 TYPE_CAST(source, type) GUID-E1904C79-16BC-4675-84B5-B419C242C2C8 v2

Views data as if it were of different data type.

'source' The source data to be viewed. Integer, real, time, boolean, text, bit string or byte string.
'type' Text keyword specifying the result data type:
"INTEGER", "REAL", "TIME", "BOOLEAN", "TEXT", "BIT_STRING" or
"BYTE_STRING"
See the compatibility rules below.
Value: A value of data type specified by 'type'.

This function interprets the memory bit pattern of a value as if it were of another data type. The
following data type compatibility rules apply:

• Bit patterns of INTEGER, REAL, TIME and BOOLEAN data can be viewed as INTEGER, REAL,
TIME or BOOLEAN data.
• Bit patterns of TEXT, BIT_STRING and BYTE_STRING data can be viewed as TEXT,
BIT_STRING or BYTE_STRING data.
• Any other combination results to a runtime error.

This is a low-level, close-to-hardware, function, whose results may be hardware dependent. Type-
casting from and to real data may result to invalid floating point numbers. Type-casting to a bit string
returns the bit pattern of the source as a bit string, whose length is 8 times the length of the source

158 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

(one character or byte occupies 8 bits). Type-casting from a bit string returns a text or byte string,
whose length is 1/8 of the length of the bit string.

Type casting from and to TEXT values operate on 8-bit active code page encoded characters.

Examples:

TYPE_CAST(TRUE, "INTEGER") returns the integer value 1, which is the integer representation of
the boolean value TRUE.

@BS = PACK_STR((65, 214), "BYTE_STRING") ;Create a 2-element byte string

TYPE_CAST(%BS, "TEXT") == "AÖ" ;Type casting to text results in "AÖ", if ISO Latin-1 code page is
active

TYPE_CAST function cannot be used to convert an INTEGER to a REAL number or vice


versa. To convert a REAL to INTEGER, use function ROUND or TRUNC. To convert an
INTEGER to REAL, add 0.0 to the integer or multiply it by 1.0.

10.3 Arithmetic functions GUID-86728284-A107-4CDE-963A-8FA5DBFF1D3A v1

10.3.1 ABS(arg) GUID-0A98305D-3A72-4EE2-83E1-1C1E16DA313E v1

The absolute value.

'arg' An integer or real value, or a vector of such values.


Value: The absolute value of the argument. Same data type as the argument.

Example:

ABS(-3) ;returns the integer value 3.

10.3.2 ARCCOS(arg) GUID-19CE360F-70D5-465C-9E9E-800E3429AB1A v1

Arcus cosinus.

This function returns, as radians, the angle, whose cosine equals to the argument.

'arg' A real value -1.0 ... +1.0, or a vector of such real values.
Value: A real value or a vector of real values. The angle(s) in radians.

10.3.3 ARCSIN(arg) GUID-565C578C-0910-42DE-9832-116EB2AFDDCE v1

Arcus sinus.

This function returns, as radians, the angle, whose sine equals to the argument.

'arg' A real value -1.0 ... +1.0, or a vector of such real values.
Value: A real value or a vector of real values. The angle(s) in radians.

MicroSCADA X SYS600 10.5 159


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.3.4 ARCTAN(arg) GUID-7B51C19D-3B8C-4485-B6FE-38F80AAF4A71 v1

Arcus tangens.

This function returns, as radians, the angle, whose tangent equals to the argument.

'arg' A real value, or a vector of such real values.


Value: A real value or a vector of real values. The angle(s) in radians.

10.3.5 COS(arg) GUID-4E53CB14-E324-4F66-8E81-DD535E5F2582 v1

The cosine of the argument.

'arg' A real or integer value or a vector of such values. The angle(s) in radians.
Value: A real value or a vector of real values.

10.3.6 EVEN(arg) GUID-CB290644-9D65-43DC-952E-7927BDCD7401 v1

Tells whether the argument is even.

'arg' An integer or a vector of integer values.


Value: A boolean value or a vector of boolean values.

10.3.7 EXP(arg) GUID-5F908229-95F3-40BD-9C33-2AFBC0B1BE40 v1

The exponential function.

The result is the number e, Neper's number, raised to the power of the argument.

'arg' A real value, max. +88.0, or a vector of such values.


Value: A real value or a vector of real values.

10.3.8 HIGH_PRECISION_ADD(n1 [,n]*) GUID-20B1D3CD-090D-4374-A373-460E6E7B9766 v2

Adds up two or more high precision numbers.

'n1' 'DOUBLE' value, the first addend, see below.


'n' 'DOUBLE' values, up to 31 more addends.
Value: 'DOUBLE' (byte string) value, the sum of the arguments.

This and the following five functions implement the high precision arithmetics in SCIL. High precision
numbers are based on 64-bit floating point numbers, while the REAL datatype of SCIL is based on
32-bit floating point numbers. High precision numbers are accurate to approx. 15 decimal digits
(compared to only 7 of REAL data).

The high precision number arguments of these functions may be given in any of the following four
ways (collectively called 'DOUBLE' type, for short):

160 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

1. As an integer value, for example, 1234567890.


2. As a real value, for example, 1.25.
3. As a text containing the decimal representation of the number. The representation may contain
decimal digits, a sign, decimal point and leading and trailing spaces. Examples of valid text
representations: " -1.234565789012", "12345678901234 " and "100000000000000000000".
4. As a byte string value returned by one of the high precision functions.

The high precision functions return their high precision results as a byte string data containing the 64-
bit floating point representation. This internal representation is converted to normal SCIL data types
by function HIGH_PRECISION_SHOW.

When entering a high precision constant in the SCIL program, use a text type argument
instead of a real or an integer argument, unless it is certain that the constant has an exact
representation as a 32-bit floating point number or as an integer.

Example:

#LOCAL PI, PI_PLUS_1


PI = HIGH_PRECISION_ADD("3.141592653589793") ;Remember the double quotes!

;Otherwise you lose precision.


PI_PLUS_1 = HIGH_PRECISION_ADD(PI, 1)

10.3.9 HIGH_PRECISION_DIV(n1, n2) GUID-69A283E1-6E92-49F9-A2F7-A0056210260F v1

Divides a high precision number by another.

'n1' 'DOUBLE' value, the dividend.


'n2' 'DOUBLE' value, the divisor.
Value: 'DOUBLE' (byte string) value, 'n1' * 'n2'.

See function HIGH_PRECISION_ADD for details of high precision arithmetics.

10.3.10 HIGH_PRECISION_MUL(n1, n2) GUID-58653188-C7A6-4F45-8F5F-368BA601C1BC v1

Multiplies two high precision numbers.

'n1' 'DOUBLE' value, the multiplier.


'n2' 'DOUBLE' value, the multiplicand.
Value: 'DOUBLE' (byte string) value, 'n1' * 'n2'.

See function HIGH_PRECISION_ADD for details of high precision arithmetics.

10.3.11 HIGH_PRECISION_SHOW(n [,decimals]) GUID-60592946-6FEA-47CD-9122-345B8871CD40 v1

Displays a high precision number in various formats.

'n' 'DOUBLE' (byte string) value


'decimals' Integer value 0 ... 253, number of decimals to display.
Default value is 6.
Value: A list with the following attributes:
Table continues on next page

MicroSCADA X SYS600 10.5 161


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

REAL Real value, 'n' truncated to a 32-bit real number.


TEXT Text value, the decimal text representation of 'n' with 'decimals' digits
after the decimal point.
INTEGRAL Integer value, the integral part of 'n'. Real value, if the number is out
of integer range.
FRACTION Real value, the fractional part of 'n'.

See function HIGH_PRECISION_ADD for details of high precision arithmetics.

10.3.12 HIGH_PRECISION_SUB(n1, n2) GUID-8B0FB82C-0A12-4B9E-A419-8E8354DDBDDF v1

Subtracts a high precision number from another.

'n1' 'DOUBLE' value, the minuend.


'n2' 'DOUBLE' value, the subtrahend.
Value: 'DOUBLE' (byte string) value, 'n1' - 'n2'.

See function HIGH_PRECISION_ADD for details of high precision arithmetics.

10.3.13 HIGH_PRECISION_SUM(v) GUID-B57620CF-E543-497A-84E3-537F4C4341D6 v1

Calculates the sum of the high precision number elements of a vector.

'v' A vector of 'DOUBLE' elements.


Value: A list with the following attributes:
SUM 'DOUBLE' (byte string) value, the calculated sum.
STATUS Integer value, SCIL status code, 0 = OK, see below.
ERRORS A vector of integer elements, see below.

The STATUS attribute of the result is set to SUSPICIOUS_STATUS (= 1), if any of the elements of
the argument vector has a bad status (other than 0 or 3). If the argument vector is empty, or it
contains no valid elements, NOT_SAMPLED_STATUS is set.

If the argument vector contains elements that are not valid 'DOUBLE' values, the indices of such
elements are returned in attribute ERRORS. If the length of the attribute is 0, no erroneous elements
have been encountered.

See function HIGH_PRECISION_ADD for details of high precision arithmetics.

10.3.14 LN(arg) GUID-39569927-771A-47A3-86C8-8F9C5C093B5D v1

Natural logarithm.

'arg' A real value > 0, or a vector of such values.


Value: A real value or a vector of real values.

10.3.15 MAX(arg1 [,arg]*) GUID-B339285D-BF64-47EF-8A62-0DF3A1A044C5 v1

The largest value in the argument list.

162 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'arg1' ... Up to 32 integers, real or time values or vectors of such values.


Value: An integer, a real or a time value or a vector of these.

The following rules apply for scalar (non-vector) arguments. First, if all the arguments are integers,
the result is an integer. Second, if all the arguments are time values, the result is a time value. Third,
if any of the arguments is a real value, the result is a real value. Fourth, if time arguments are mixed
with numeric arguments (which actually makes no sense), the result is numeric.

Finally, if the argument list contains vectors, the result is a vector of the length of the longest
argument vector. Each element is compared to the corresponding element in the other argument
vectors, as well as to the scalar arguments according to the data type conversion rules above. If the
lengths of argument vectors are unequal, the odd elements get SUSPICIOUS_STATUS (see the
Status Codes manual).

Notes:

1. If the argument list contains only one argument, the argument is returned as such.
2. To find the largest element of a vector, use function HIGH or HIGH_INDEX.

See the functions MIN, HIGH and HIGH_INDEX as well.

Examples:

MAX(1, 5, 3) == 5
MAX(1.0, 5, 3) == 5.0
MAX(VECTOR(1, 2, 4), 3, VECTOR(5, 0, 1)) ;returns VECTOR(5, 3, 4)

10.3.16 MIN(arg1 [,arg]*) GUID-3BD63A47-AEED-481F-B114-F4A12DB3EDCC v1

The smallest value in the argument list.

'arg1' ... Up to 32 integer, real or time values or vectors of such values.


Value: An integer, a real or a time value or a vector of these.

The following rules apply for the scalar (non-vector) arguments. First, if all the arguments are
integers, the result is an integer. Second, if all the arguments are time values, the result is a time
value. Third, if any of the arguments is a real value, the result is a real value. Fourth, if time
arguments are mixed with numeric arguments (which actually makes no sense), the result is
numeric.

Finally, if the argument list contains vectors, the result is a vector, which is as long as the longest
argument vector. Each element is compared to the corresponding element in the other argument
vectors, as well as to the scalar arguments according to the data type conversion rules mentioned
above. If the lengths of argument vectors are unequal, the odd elements get SUSPICIOUS_STATUS
(see the Status Codes manual).

Notes:

1. If the argument list contains only one argument, the argument is returned as such.
2. To find the smallest element of a vector, use function LOW or LOW_INDEX.

See the functions MAX, LOW and LOW_INDEX as well.

Examples:

MIN(1, 5, 3) == 1
MIN(1.0, 5, 3) == 1.0
MIN(VECTOR(1, 2), 3, VECTOR(5, 0, 4)) ;returns VECTOR(1, 0, 3)

MicroSCADA X SYS600 10.5 163


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

;The 3rd element has SUSPICIOUS_STATUS

10.3.17 ODD(arg) GUID-2E721466-15BE-43F8-882C-FB43042426AA v1

Tells whether the argument is odd.

'arg' An integer or a vector of integer values.


Value: A boolean value or a vector of boolean values.

Example:

ODD(5) == TRUE
EVEN(5) == FALSE

10.3.18 RANDOM(n1, n2) GUID-0A041D54-53B0-4BC8-B8E8-99787A4AAA3B v1

Generates a random number.

'n1' An integer or real value.


'n2' An integer or real value.
Value: Integer or real value.

If 'n1' and 'n2' are integers, an integer value in the range [n1, n2] (including n1 and n2) is returned. If
'n1' and 'n2' are real values, a real value in the range [n1, n2), i.e. including n1 but excluding n2, is
returned.

This function is based on the random number generator of the underlying operating system. The
generator generates a fixed sequence of pseudo-random integers, where each generated number
works as a seed to the next number. If you want to get exactly the same random numbers every time
the SCIL program is executed. You can use function SET_RANDOM_SEED with a fixed argument,
but if you want to have different random numbers each time, use SET_RANDOM_SEED with a
varying argument (current time, for example).

10.3.19 ROUND(arg [,decimals]) GUID-FA9AA625-895A-4EB9-88D1-55D4AFE55B48 v1

Rounds off a real value.

If 'decimals' is omitted, the argument is rounded off to the nearest integer. If 'decimals' is given, the
argument is rounded off to the nearest real value having 'decimals' decimal digits. See also function
TRUNC.

'arg' A real value or a vector of real values.


'decimals' An integer >= 0, number of decimal digits
Value: If 'decimals' omitted, an integer or a vector of integers, otherwise a real value or a
vector of real values.

Examples:

ROUND(4.5) == 5
ROUND(-4.5) == -5
ROUND(2.7456, 2) == 2.75

164 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.3.20 SET_RANDOM_SEED(seed) GUID-B31D3CAB-2BA4-4D2A-A62E-8E0D8A50E0F5 v1

Sets the seed number of the random number generator.

'seed' Any integer or time value.


Value: Always integer 0.

See the function RANDOM for details.

10.3.21 SIN(arg) GUID-EC890787-229D-42CE-8E60-7C381186591D v1

The sine of the argument.

'arg' A real or integer value or a vector of such values. The angle(s) in radians.
Value: A real value or a vector of real values.

10.3.22 SQRT(arg) GUID-5A952E7D-E7EB-4A54-9FA9-09818C80A477 v1

The square root of the argument.

'arg' A real value > = 0, or a vector of such values.


Value: A real value > = 0 or a vector of such values.

10.3.23 TRUNC(arg [,decimals]) GUID-91F0121B-E409-47BE-91C2-DC76A42DFCFF v1

Truncates a real value.

If 'decimals' is omitted, the argument is truncated to an integer by removing the fraction part. If
'decimals' is given, the argument is truncated to a real value having 'decimals' decimal digits. See
also function ROUND.

'arg' A real value or a vector of real values.


'decimals' An integer >= 0, number of decimal digits
Value: If 'decimals' omitted, an integer or a vector of integers, otherwise a real value or a
vector of real values.

Examples:

TRUNC(4.5) == 4
TRUNC(-4.5) == -4
TRUNC(2.7456,2) == 2.74

10.4 Time functions GUID-E556CA35-82CF-4B43-AF13-1FC03CA05ED2 v1

The time functions operate on time type data in various ways: They read and set system time,
convert time values to a readable text representation, retrieve various information of a time type
value, convert between local and UTC times and do some simple arithmetics on time values.

The time functions usually take a time type or a qualified time type argument. A time type value is
used to represent a time in one-second resolution. A qualified time has a resolution of one
millisecond, it also contains the daylight saving information, see below. Many of the functions may
also be called without an argument, the present time is then assumed.

MicroSCADA X SYS600 10.5 165


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Both local and UTC time are supported by these functions. See function TIME_ZONE_RULES for
details of maintaining the rules of time zone and daylight saving time transitions.

A SYS600 system may run either in local time or in UTC time. The time reference is specified by the
base system attribute SYS:BTR. The term SYS time is used below to refer to the time reference of
the system.

At the end of this section you find examples of the time functions.

Leap seconds are not supported by SCIL. Time 23:59:60 is never accepted nor produced
by SCIL, even if it is a valid time stamp when a leap second is added according to the
UTC standard. All calculations are done with 60 second minutes.

10.4.1 Qualified time GUID-358B4A1B-BF3B-4191-9B89-E478E084E7C4 v1

A qualified time represents a moment of time uniquely by adding a daylight saving time flag and
status information to the one-millisecond resolution time. A qualified time is implemented as a list
with predefined attributes as follows:

CL Clock Time type, the time in one-second resolution.


MS Milliseconds Integer 0 ... 999, the milliseconds
DS Daylight saving Boolean

Several functions that convert times from local to UTC time or otherwise calculate qualified time
values return status information as the status of the CL attribute of the result. The following values
may be returned:

OK_STATUS (0). The time is existing and unique.

FAULTY_TIME_STATUS (3). The time is non-existing, either because its DS attribute is wrong or it
specifies a moment that was skipped over during the transition to daylight saving time or the resulting
time is out of the valid range of time type data.

AMBIGUOUS_TIME_STATUS (4). The time is ambiguous, because it specifies a moment that was
duplicated during a transition to standard time and DS attribute does not tell which one is meant.

The following special cases may occur when converting UTC time to local time:

1. DS attribute of the argument is missing. This is OK, not considered as an error.


2. DS attribute is set to TRUE. The attribute is ignored and the status of resulting CL attribute is set
to 3 (FAULTY_TIME_STATUS).
3. The resulting value of CL attribute is not in the range of TIME data type.CL is set to its minimum
or maximum value and its status is set to 3 (FAULTY_TIME_STATUS).

The following special cases may occur when converting local time to UTC time:

1. DS attribute of the argument is missing. This is OK if the given local time is neither ambiguous
nor non-existing (normally it is not). A local time may be ambiguous if it specifies a time close to
the transition from daylight saving time to standard time: If the transition takes place at 4 o'clock
by moving clock one hour backward, the times from 03.00.00 to 03.59.59 are ambiguous, they
may represent daylight saving or standard time. If the given time is ambiguous, it is assumed
that it is standard time. The status of the CL attribute of the result is set to 4
(AMBIGUOUS_TIME_STATUS).
2. The argument specifies a non-existing time. A local time may be non-existing if it specifies a
time close to the transition from standard time to the daylight saving time. If the transitions takes
place at 3 o'clock by moving clock one hour forward, the times from 03.00.00 to 03.59.59 are

166 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

non-existing. If the argument specifies a non-existing time, the exact UTC time of the transition
is returned and the status of the CL attribute of the result is set to 3 (FAULTY_TIME_STATUS).
3. The DS attribute of the argument is wrong. The attribute is ignored and the status of resulting CL
attribute is set to 3 (FAULTY_TIME_STATUS).
4. The resulting value of CL attribute is not in the range of TIME data type. CL is set to its minimum
or maximum value and its status is set to 3 (FAULTY_TIME_STATUS).

Example:

; This function converts the given local time argument to UTC time and
displays
; an error message if something wrong.

#ARGUMENT LOCAL_TIME_ARG
#LOCAL UTC = LOCAL_TO_UTC_TIME(LOCAL_TIME_ARG)

#CASE GET_STATUS(UTC.CL)
#WHEN STATUS_CODE("FAULTY_TIME_STATUS") -
.SET MESSAGE._TITLE = "Skipped during transition to DST"
#WHEN STATUS_CODE("AMBIGUOUS_TIME_STATUS") -
.SET MESSAGE._TITLE = "Please specify DST or STT"
#OTHERWISE
.SET MESSAGE._TITLE = ""
#CASE_END
#RETURN UTC

10.4.2 CLOCK GUID-0E43C33D-8068-47EA-92F5-61DDDE7AD3B1 v1

The present SYS time with a one-second resolution.

Value: Time value.

10.4.3 DATE[(time [,"FULL"])] GUID-ACD09335-78C4-42DB-A031-C0B618B68937 v1

The date (year, month and day) as text.

'time' A time value or a vector of time values.


Default value is the present SYS time.
"FULL" Optional keyword argument, 4-digit year is requested.
Value: A text or text vector.

The date is given in the format specified by attribute SYS:BTF.

If the optional argument "FULL" is given, the year is shown with 4 digits: yyyy-mm-dd, dd-mm-yyyy or
mm-dd-yyyy.

See also functions TIME, TIMEMS and TIMES.

Examples:

DATE
;Returns the current date, for example "03-10-22", if SYS:BTF = 0
DATE("FULL")
;Returns the current date, for example "22-10-2003", if SYS:BTF = 1

10.4.4 DAY[(time)] GUID-851A5E0E-92D7-476C-BE52-2799C746E973 v1

The day of month.

MicroSCADA X SYS600 10.5 167


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: An integer 1 ... 31 or a vector of such integers.

10.4.5 DOW[(time)] GUID-E3D318B4-C808-48AB-86BB-813A5F3B0604 v1

The day of week.

The number of the day counting from Monday, which is number one.

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: An integer 1 ... 7 or a vector of such integers.

10.4.6 DOY[(time)] GUID-C2D26D0E-DB91-4EB2-B9F3-60D1E1023971 v1

The day of year .

The number of the day since the beginning of the year.

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: An integer 1 ... 366 or a vector of such integers.

10.4.7 HOD[(time)] GUID-030B2E67-E9CD-4DD1-8A9E-84E0E02BB388 v1

Hours passed since the beginning of the day.

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: A real value < 24.0 or a vector of such values.

10.4.8 HOUR[(time)] GUID-60DEAF83-E43A-45DE-9B99-CE44F1DE904D v1

The hour.

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: An integer 0 ... 23 or a vector of such integers.

10.4.9 HOY[(time)] GUID-3AD1A7C8-86A4-4FC4-A6AA-43A59B8DD7A6 v1

Hours passed since the beginning of the year.

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: A real value < 8784.0 or a vector of such values.

10.4.10 HR_CLOCK GUID-E9B4E9F4-D8DF-49DB-9AB8-41B34846F261 v1

SYS time in seconds and microseconds.

168 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Value: A list containing the following two attributes:


CL The seconds of the SYS time as time data.
US The microseconds of the SYS time as an integer (with an accuracy depending on
the operating system, often 10 milliseconds).

This function is more or less obsolete. Use function SYS_TIME instead.

10.4.11 LOCAL_TIME GUID-FCDB1686-3540-46F2-9588-4023F500EE69 v1

The present local time.

Value: A list (qualified time), local time.

10.4.12 LOCAL_TIME_ADD(time, s [,ms]) GUID-B490B71C-9217-47BC-9BA7-A164087C9EE1 v1

Adds seconds and milliseconds to given local time.

'time' A time or list (qualified time) value, local time.


's' An integer, seconds to add.
'ms' An integer, milliseconds to add.
Value: A list (qualified time) value, local time.

For the possible status codes returned as the status of the CL attribute of the result, see Section
10.4.2.

Example:

The following three calls each return the moment of time 3 seconds from now:

LOCAL_TIME_ADD(LOCAL_TIME, 3)
LOCAL_TIME_ADD(LOCAL_TIME, 0, 3000)
LOCAL_TIME_ADD(LOCAL_TIME, 4, -1000)

10.4.13 LOCAL_TIME_INFORMATION[(time)] GUID-18477041-4E04-4021-A3A0-548123646FAE v1

Gives information on given local time.

'time' Time or list (qualified time) value, local time. Default value is the present local time.
Value: A list with the following attributes:
UTC Time value
DAYLIGHT_SAVING Boolean value
TIME_ZONE Real value
BIAS Real value
STATUS Integer value

The attributes contain the following information from the moment of 'time':

MicroSCADA X SYS600 10.5 169


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

• UTC is the corresponding UTC time.


• DAYLIGHT_SAVING is TRUE if daylight saving time was or is in use, otherwise FALSE.
• TIME_ZONE is the time zone (as a real number to support fractional time zones) that the site
belonged or belongs to.
• BIAS is the difference between the local time and the UTC time. When standard time is in use,
BIAS is equal to TIME_ZONE. When daylight saving time is in use, BIAS is usually TIME_ZONE
+ 1.
• STATUS tells the quality of 'time':
OK_STATUS (0) = Existing and unique.
FAULTY_TIME_STATUS (3) = Non-existing, either because its DS attribute is wrong or it
specifies a moment that was skipped over during the transition to daylight saving time.
AMBIGUOUS_TIME_STATUS (4) = Ambiguous, because it specifies a moment that was
duplicated during the transition to standard time and DS attribute does not tell which one is
meant.

10.4.14 LOCAL_TIME_INTERVAL(from, to) GUID-2783C81D-BFEA-4F86-90F9-6D25D10D27E1 v1

The length of the time interval between two local times.

'from' A time or list (qualified time) value, local time.


'to' A time or list (qualified time) value, local time.
Value: The length of the interval as a list with two attributes:
S Integer (positive or negative), the seconds.
MS Integer -999 ... 999, the milliseconds.

If the length of the interval is greater than MAX_INTEGER, S is set to MAX_INTEGER, MS is set to
999 and the status of S is set to 3 (FAULTY_TIME_STATUS).

If the (negative) length of the interval is smaller than MIN_INTEGER, S is set to MIN_INTEGER, MS
is set to -999 and the status of S is set to 3 (FAULTY_TIME_STATUS).

For other possible status codes returned as the status of the S attribute of the result, see Section
10.4.2.

10.4.15 LOCAL_TO_SYS_TIME(time) GUID-0348E978-E4B2-4E35-A30D-6576B89ACBA7 v1

Converts local time to SYS time.

'time' A time or list (qualified time) value or a vector of such values, local time(s).
Value: A list (qualified time) or a vector of lists, SYS time(s).

For the possible status codes returned as the status of the CL attribute of the result, see Section
10.4.2.

This function either is equivalent to LOCAL_TO_UTC_TIME or simply returns its argument (as
qualified time value(s)), depending on the time reference of the system (SYS:BTR).

10.4.16 LOCAL_TO_UTC_TIME(time) GUID-6C007B6D-D217-44B7-B139-3D25396CEC00 v1

Converts local time to UTC time.

170 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'time' A time or list (qualified time) value or a vector of such values, local time(s).
Value: A list (qualified time) or a vector of lists, UTC time(s).

For the possible status codes returned as the status of the CL attribute of the result, see Section
10.4.2.

10.4.17 MINUTE[(time)] GUID-299F896D-4B8D-4E34-98E4-CF4DB10F9A28 v1

The minute.
'time' A time value or a vector of time values. Default value is the present SYS time.
Value: An integer 0 ... 59 or a vector of such integers.

10.4.18 MONTH[(time)] GUID-C4AF99A8-B16A-4AA8-AA42-2620DCF52EC2 v1

The number of the month.

'time' A time value or a vector of time values. Default value is the present SYS time.
Value: An integer 1 ... 12 or a vector of such integers.

10.4.19 PACK_TIME(year, month, day, hour, minute, second) GUID-747B75C4-5CB1-4486-BBF7-40F05CBABF59 v1

Creates a SCIL time data value out of its components.

'year' Integer, 1978 ... 2113


'month' Integer, 1 ... 12
'day' Integer, 1 ... 31
'hour' Integer, 0 ... 23
'minute' Integer, 0 ... 59
'second' Integer, 0 ... 59
Value: Time data.

If any of the arguments is out of range, a zero (corresponding to Jan 1st 1978, 00:00 o'clock) is
returned.

10.4.20 SECOND[(time)] GUID-612A53EC-BBAE-4A5A-A885-DA8E7DF37DA1 v1

The second.

'time' A time value or a vector of time values. Default value is the present SYS time.
Value: An integer 0 ... 59 or a vector of such integers.

10.4.21 SET_CLOCK(time) GUID-F8933D1A-7655-45B1-B89C-4984B0661FD7 v1

Sets the SYS time.

MicroSCADA X SYS600 10.5 171


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'time' Time data or a list with the following two attributes:


CL The seconds of the SYS time, time value.
US The microseconds of the SYS time, integer value.
Value: A real value. The number of seconds that the SYS time was changed. A positive value
means that the clock was set forward. A negative value indicates that it was set backward.

This function is more or less obsolete, use SET_LOCAL_TIME, SET_SYS_TIME or SET_UTC_TIME


instead.

10.4.22 SET_LOCAL_TIME(time) GUID-920FC888-D750-4D5B-88B6-E0BE7EF4DC6A v1

Sets the local time of the system.

'time' A time or list (qualified time) value, local time.


Value: The status of the operation and the resulted length of the time shift as a list with the following
attributes:
STATUS An integer. The status code, see below.
S An integer, seconds moved.
MS An integer -999 ... 999, milliseconds moved.

The 'time' argument is first converted to UTC time and the system clock is set accordingly. However,
if the conversion results to a non-existing (FAULTY_TIME_STATUS) or ambiguous
(AMBIGUOUS_TIME_STATUS) time, the system clock is not set and only the STATUS attribute is
returned.

10.4.23 SET_SYS_TIME(time) GUID-B923D2F6-ADDA-4803-B357-52E5F161A925 v1

Sets the SYS time of the system.

'time' A time or list (qualified time) value, SYS time.


Value: The status of the operation and the resulted length of the time shift as a list with the following
attributes:
STATUS An integer. The status code, see below.
S An integer, seconds moved.
MS An integer -999 ... 999, milliseconds moved.

The 'time' argument is first converted to UTC time (if needed) and the system clock is set
accordingly. However, if the conversion results to a non-existing (FAULTY_TIME_STATUS) or
ambiguous (AMBIGUOUS_TIME_STATUS) time, the system clock is not set and only the STATUS
attribute is returned.

This function is equivalent to either SET_LOCAL_TIME or SET_UTC_TIME, depending on the time


reference of the system (SYS:BTR).

10.4.24 SET_UTC_TIME(time) GUID-EC176D37-6411-4408-9078-F53358026522 v1

Sets the UTC time of the system.

172 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'time' A time or list (qualified time) value, UTC time.


Value: The status of the operation and the resulted length of the time shift as a list with the following
attributes:
STATUS An integer. The status code, 0 = OK_STATUS.
S An integer, seconds moved.
MS An integer -999 ... 999, milliseconds moved.

10.4.25 SYS_TIME GUID-86DD54F7-2108-4F59-8BF9-8B33E2B27594 v1

The present SYS time.

Value: A list (qualified time), SYS time.

This function is equivalent to either LOCAL_TIME or UTC_TIME, depending on the time reference of
the system (SYS:BTR).

10.4.26 SYS_TIME_ADD(time, s [,ms]) GUID-756789EA-9594-425E-9119-F22C64FB95B3 v1

Adds seconds and milliseconds to given SYS time.

'time' A time or list (qualified time) value, SYS time.


's' An integer, seconds to add.
'ms' An integer, milliseconds to add.
Value: A list (qualified time) value, SYS time.

For the possible status codes returned as the status of the CL attribute of the result, see Section
10.4.2.

This function is equivalent to either LOCAL_TIME_ADD or UTC_TIME_ADD, depending on the time


reference of the system (SYS:BTR).

Example:

The following three calls each return the moment of time 3 seconds from now:

SYS_TIME_ADD(SYS_TIME, 3)
SYS_TIME_ADD(SYS_TIME, 0, 3000)
SYS_TIME_ADD(SYS_TIME, 4, -1000)

10.4.27 SYS_TIME_INTERVAL(from, to) GUID-141746E8-BEF3-4D3A-9674-8A24C6C8DA7B v1

The length of the time interval between two SYS times.

'from' A time or list (qualified time) value, SYS time.


'to' A time or list (qualified time) value, SYS time.
Value: The length of the interval as a list with two attributes:
S Integer (positive or negative), the seconds.
MS Integer -999 ... 999, the milliseconds.

If the length of the interval is greater than MAX_INTEGER, S is set to MAX_INTEGER, MS is set to
999 and the status of S is set to 3 (FAULTY_TIME_STATUS).

MicroSCADA X SYS600 10.5 173


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

If the (negative) length of the interval is smaller than MIN_INTEGER, S is set to MIN_INTEGER, MS
is set to -999 and the status of S is set to 3 (FAULTY_TIME_STATUS).

For other possible status codes returned as the status of the S attribute of the result, see Section
10.4.2.

This function is equivalent to either LOCAL_TIME_INTERVAL or UTC_TIME_INTERVAL, depending


on the time reference of the system (SYS:BTR).

10.4.28 SYS_TO_LOCAL_TIME(time) GUID-58D54C63-4071-4933-AD6B-1079A9AB0029 v1

Converts SYS time to local time.

'time' A time or list (qualified time) value or a vector of such values, SYS time(s).
Value: A list (qualified time) or a vector of lists, local time(s).

For the possible status codes returned as the status of the CL attribute of the result, see Section
10.4.2.

This function either is equivalent to UTC_TO_LOCAL_TIME or simply returns its argument (as
qualified time value(s)), depending on the time reference of the system (SYS:BTR).

10.4.29 SYS_TO_UTC_TIME(time) GUID-CCC97732-EB67-48F3-BB21-F6C78D4525D7 v1

Converts SYS time to UTC time.

'time' A time or list (qualified time) value or a vector of such values, SYS time(s).
Value: A list (qualified time) or a vector of lists, UTC time(s).

For the possible status codes returned as the status of the CL attribute of the result, see Section
10.4.2.

This function either is equivalent to LOCAL_TO_UTC_TIME or simply returns its argument (as
qualified time value(s)), depending on the time reference of the system (SYS:BTR).

10.4.30 TIME[(time [,"FULL"])] GUID-1ABCA291-F571-48DF-8855-9C95665107A9 v1

Date and time as text, excluding seconds.

'time' A time value or a vector of time values.


Default value is the present SYS time.
"FULL" Optional keyword argument, 4-digit year is requested.
Value: A text or text vector.

The date is presented in the format specified by attribute SYS:BTF.

If the optional argument "FULL" is given, the year is shown with 4 digits: yyyy-mm-dd hh:mm, dd-
mm-yyyy hh:mm or mm-dd-yyyy hh:mm.

See also functions DATE, TIMEMS, TIMES and TIME_SCAN.

Examples:

TIME
;Returns the current time, for example "03-10-22 12:42", if SYS:BTF = 0

174 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

TIME("FULL")
;Returns the current time, for example "22-10-2003 12:42", if SYS:BTF = 1
TIME("FULL")
;Returns the current time, for example "10-22-2003 12:42", if SYS:BTF = 2

10.4.31 TIME_SCAN(string [,resolution [,option1 [,option2]]]) GUID-99F1B73C-8DC9-487D-A6DE-A0187F818C56 v1

Interprets a date/time text string.

'string' A text or text vector to be interpreted. Sample format: 2008-12-24 19:15:20.345. The date is
given in the format specified by attribute SYS:BTF. The year is given with 4 or 2 digits.
'resolution' A text keyword, the expected resolution:
"DATE" Date only
"MINUTES" Time without seconds
"SECONDS" Time with seconds
"MILLISECONDS" Milliseconds included (default)
'options' One or two keywords in any order:
"TIME_OF_DAY" No date expected
"EXACT" See note 4 below
Value: A list with the following attributes:
STATUS SCIL status code, 0 = OK
CL Time type (date and time)
Integer type if "TIME_OF_DAY" (seconds since
00:00:00)
MS Integer, milliseconds

Notes:

1. If STATUS is non-zero, attributes CL and MS are not returned.


2. If the argument 'string' is a vector, the resulting attributes STATUS, CL and MS are vectors, too.
3. Milliseconds can be given with 1 to 3 decimals. ".100", ".10" and ".1" all denote 100 milliseconds.
4. If "EXACT" is given, the given time must be exactly in the format specified by 'resolution'. If not
given, a shorter string is accepted but a longer one is flagged as an error.

For example, 2008-12-19 10:44 is valid with resolutions "MINUTES", "SECONDS" and
"MILLISECONDS", if "EXACT" is not given. If "EXACT" is given, it is valid only when resolution is
"MINUTES".

10.4.32 TIME_ZONE_RULES[(rule)] GUID-001AC096-8100-4649-900E-AFC2D2935262 v2

Reads and sets the time zone rules of the system.

'rule' A list value, the time zone rule to be set, see below.
Value: A list value with two attributes:
STATUS An integer, SCIL status code of the call.
RULES A vector of list values, the implemented time zone rules in chronological
order.

This function sets a new time zone rule and returns all the implemented rules (including the rule just
set) as a vector. If the function is called without an argument, only the implemented rules are
returned.

MicroSCADA X SYS600 10.5 175


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

A time zone rule is represented as a list value containing the following attributes:

DATE A time value (hours, minutes and seconds are ignored).


The date after which the rule is to be applied.
The default value is the present date.
TZ An integer or real value (optional).
The time zone -13 ... 13, a real value may be used to define a half or quarter hour time zone.
STT Standard Time specification, see below (optional).
DST Daylight Saving Time specification, see below (optional).

If any of attributes TZ, STT or DST is missing, the corresponding definition remains untouched. For
example, if a given rule contains only the attribute DST, the time zone and Standard Time
specification are as they were before DATE.

The Standard Time and Daylight Saving Time specification are represented as a list value containing
the following attributes:

BIAS An integer or real value.


Time bias (to the time zone) while this time (STT or DST) used.
The default is 0 for STT and +1 hour for DST.
MONTH An integer 0 ... 12. The month of transition, 0 means no switch.
DAY_OF_WEEK An integer 1 ... 7. The day of week of transition (1=Monday, 7=Sunday).
WEEK Integer 1 ... 5. Specifies the week of the transition as follows:
Suppose DAY_OF_WEEK = 7, i.e. Sunday.
Then, WEEK = 1 states that the transition takes place on the 1st Sunday of the month.
If WEEK = 5, the transition takes place on the last Sunday of the month (Value 5 has the
special meaning of 'last').
HOUR An integer 0 ... 23. The hour of transition.
MINUTE An integer 0 ... 59. The minute of transition, default is 0.

A once only rule may be specified by omitting attributes DAY_OF_WEEK and WEEK, and specifying
the following two attributes instead:

YEAR Integer 1978 ... 2113. The year of the transition.


DAY Integer 1 ... 31. The day of month of the transition.

Example:

Suppose the following rules have been and will be applied on a site:

1. Daylight saving time was first applied in 1983. Transition to DST at 3:00 on the last Sunday of
March. Transition to STT at 4:00 on the last Sunday of September.
2. In 1997, the transition to STT was moved one month later, to the last Sunday of October.
3. In 2002 it was decided, that from 2003 on, daylight saving is no longer applied.

The following SCIL program teaches the rules to SYS600:

#LOCAL GENESIS = PACK_TIME(1978, 1, 1, 0, 0, 0),-


DATE1 = PACK_TIME(1983, 1, 1, 0, 0, 0),-
DATE2 = PACK_TIME(1997, 1, 1, 0, 0, 0),-
DATE3 = PACK_TIME(2003, 1, 1, 0, 0, 0)
#LOCAL RULES

176 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

;The rule obeyed before 1983

RULES = TIME_ZONE_RULES(LIST(-
DATE = GENESIS, TZ = 2,-
DST = LIST(MONTH = 0), STT = LIST(MONTH = 0)))

;Rule 1

RULES = TIME_ZONE_RULES(LIST(-
DATE = DATE1,-
DST = LIST(MONTH = 3, DAY_OF_WEEK = 7, WEEK = 5, HOUR = 3),-
STT = LIST(MONTH = 9, DAY_OF_WEEK = 7, WEEK = 5, HOUR = 4)))

;Rule 2

RULES = TIME_ZONE_RULES(LIST(-
DATE = DATE2,-
STT = LIST(MONTH = 10, DAY_OF_WEEK = 7, WEEK = 5, HOUR = 4)))

;Rule 3

RULES = TIME_ZONE_RULES(LIST(-
DATE = DATE3,-
DST=LIST(MONTH = 0), STT=LIST(MONTH = 0)))

The time zone rules are stored in the text file SYS_/SYS_TIME.PAR. After running the example
above, the contents of the file are as follows (the second rule has been divided to two lines here, for
clarity):

1978-01-01 DST=LIST(MONTH=0),STT=LIST(MONTH=0),TZ=2
1983-01-01 DST=LIST(BIAS=1,DAY_OF_WEEK=7,HOUR=3,MINUTE=0,MONTH=3,WEEK=5),-
STT=LIST(BIAS=0,DAY_OF_WEEK=7,HOUR=4,MINUTE=0,MONTH=9,WEEK=5)
1997-01-01 STT=LIST(BIAS=0,DAY_OF_WEEK=7,HOUR=4,MINUTE=0,MONTH=10,WEEK=5)
2003-01-01 DST=LIST(MONTH=0),STT=LIST(MONTH=0)

Whenever the SYS600 program is restarted, the current rule obeyed by the operating system is read.
If it differs from the current rule from SYS_TIME.PAR, a new rule is appended to the file. This makes
an alternative way to add a new time zone rule: change the operating system time zone settings and
restart SYS600. However, a rule obeyed in the past cannot be added this way and the program must
be restarted.

When the program is started for the first time, it makes the sophisticated guess that the current rule
has been applied since the beginning of SYS600 time counting, 1st of January, 1978.

10.4.33 TIMEMS[(time [,msecs] [,"FULL"])] GUID-9B98C45B-15E6-4890-8A2B-55C7294519BD v1

Date and time as text, including seconds and milliseconds.

'time' A time value, a qualified time (list) value or a vector of such values. The default value is
the present SYS time.
'msecs' An optional integer or integer vector argument, milliseconds 0 ... 999.
"FULL" An optional keyword argument, 4-digit year is requested.
Value: A text or text vector.

The date is presented in the format specified by attribute SYS:BTF.

If the optional argument "FULL" is given, the year is shown with 4 digits: yyyy-mm-dd
hh:mm:ss.mmm, dd-mm-yyyy hh:mm:ss.mmm or mm-dd-yyyy hh:mm:ss.mmm.

If the milliseconds are given explicitly as a vector, the length of the vector must be equal to the length
of the 'time' vector.

MicroSCADA X SYS600 10.5 177


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

See also the DATE, TIME, TIMES, TIME_SCAN, TOD, TODMS and TODS functions.

Examples:

TIMEMS(ABC:PRQ1)
;Returns the registration time of the process object ABC:P1
;for example "04-03-22 12:42:15.030" (SYS:BTF = 0)
TIMEMS("FULL")
;Returns the current time, for example "22-03-2004 12:42:15.030" (SYS:BTF
= 1)

10.4.34 TIMES[(time [,"FULL"])] GUID-CFA90E6F-9A47-4B42-87B8-F9B47DA1CF21 v1

Date and time as text, including seconds.

'time' A time value or a vector of time values. Default value is the present SYS time.
"FULL" Optional keyword argument, 4-digit year is requested.
Value: A text or text vector.

The date is presented in the format specified by attribute SYS:BTF.

If the optional argument "FULL" is given, the year is shown with 4 digits: yyyy-mm-dd hh:mm:ss, dd-
mm-yyyy hh:mm:ss or mm-dd-yyyy hh:mm:ss.

See also functions DATE, TIME, TIMEMS, TIME_SCAN, TOD, TODMS and TODS.

Examples:

TIMES
;Returns the current time, for example "03-10-22 12:42:15", if SYS:BTF = 0
TIMES("FULL")
;Returns the current time, for example "22-10-2003 12:42:15", if SYS:BTF
= 1

10.4.35 TOD[(time)] GUID-8EA367F2-6E78-42FB-A40D-AAEF081B9A82 v1

Time of day as text, excluding seconds

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: A text or text vector, in format hh:mm.

10.4.36 TODMS[(time [,msecs])] GUID-92CDA464-A186-4EBE-9539-51703D303410 v1

Time of day as text, including seconds and milliseconds.

'time' A time value, a qualified time (list) value or a vector of such values.The default value is
the present SYS time.
'msecs' An optional integer or integer vector argument, milliseconds 0 ... 999.
Value: A text or text vector, in format hh:mm:ss.mmm.

If the milliseconds are given explicitly as a vector, the length of the vector must equal to the length of
the 'time' vector.

178 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.4.37 TODS[(time)] GUID-FE0B2EFB-2273-412B-B893-CC85262088D9 v1

Time of day as text, including seconds.

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: A text or text vector, in format hh:mm:ss.

10.4.38 UTC_TIME GUID-7EA0460F-515D-4826-93BA-50CB9464DE11 v1

The present UTC time.

Value: A list (qualified time), UTC time.

10.4.39 UTC_TIME_ADD(time, s [,ms]) GUID-8EC00F94-104B-4199-B128-EE0D6F497FA8 v1

Adds seconds and milliseconds to given UTC time.

'time' A time or list (qualified time) value, UTC time.


's' An integer, seconds to add.
'ms' An integer, milliseconds to add.
Value: A list (qualified time) value, UTC time.

For the possible status codes returned as the status of the CL attribute of the result, see Section
10.4.2.

Example:

The following three calls each return the moment of time 3 seconds from now:

UTC_TIME_ADD(UTC_TIME, 3)
UTC_TIME_ADD(UTC_TIME, 0, 3000)
UTC_TIME_ADD(UTC_TIME, 4, -1000)

10.4.40 UTC_TIME_INTERVAL(from, to) GUID-D88920A4-9E29-48F7-8EC3-FF9CF38EAE07 v1

The length of the time interval between two UTC times.

'from' A time or list (qualified time) value, UTC time.


'to' A time or list (qualified time) value, UTC time.
Value: The length of the interval as a list with two attributes:
S Integer (positive or negative), the seconds.
MS Integer -999 ... 999, the milliseconds.

If the length of the interval is greater than MAX_INTEGER, S is set to MAX_INTEGER, MS is set to
999 and the status of S is set to 3 (FAULTY_TIME_STATUS).

If the (negative) length of the interval is smaller than MIN_INTEGER, S is set to MIN_INTEGER, MS
is set to -999 and the status of S is set to 3 (FAULTY_TIME_STATUS).

MicroSCADA X SYS600 10.5 179


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.4.41 UTC_TO_LOCAL_TIME(time) GUID-34061707-AF4C-4348-846A-36C0150FBCA4 v1

Converts UTC time to local time.

'time' A time or list (qualified time) value or a vector of such values, UTC time(s).
Value: A list (qualified time) or a vector of lists, local time(s).

10.4.42 UTC_TO_SYS_TIME(time) GUID-0BE0595C-5FAF-4C96-A53A-4170415FB510 v1

Converts UTC time to SYS time.

'time' A time or list (qualified time) value or a vector of such values, UTC time(s).
Value: A list (qualified time) or a vector of lists, SYS time(s).

This function either is equivalent to UTC_TO_LOCAL_TIME or simply returns its argument (as
qualified time value(s)), depending on the time reference of the system (SYS:BTR).

10.4.43 WEEK(time)] GUID-0099638A-D07F-449B-A928-338F2D7971EE v1

The number of the week within a year.

The week numbering rule that is used may be given as the statement: "The 4th of January always
belongs to week number 1".

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: An integer 1 ... 53 or a vector of such integers.

10.4.44 YEAR(time)] GUID-9D2DC65F-82F4-4CCD-A711-F9F43B90E555 v1

The year.

'time' A time value or a vector of time values.


Default value is the present SYS time.
Value: An integer 1978 ... 2113 or a vector of such integers.

Examples:
On 19th February 1997 at 20:35:04 o'clock the time functions returned the following values (supposing SYS:BTF ==
0):
Function call Value
TIMES "97-02-19 20:35:04"
TIMES(CLOCK-1) "97-02-19 20:35:03"
TIME "97-02-19 20:35"
TODS "20:35:04"
DATE "97-02-19"
YEAR 1997
MONTH 2
HOUR 20
Table continues on next page

180 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

MINUTE 35
SECOND 4
DOY 50
HOD 20.58444
HOY 1196.584
LOCAL_TIME_INFORMATION If the time zone is +2 hours:
LIST(UTC=...,DAYLIGHT_SAVING=FALSE,
TIME_ZONE=2.0,BIAS=2.0,STATUS=0)
TIMES(PACK_TIME(1993,5,5,12,30,0)) "93-05-05 12:30:00"

10.5 String functions GUID-1295DD09-D245-4EA5-B9FF-B1655F65B5B8 v1

The string functions perform operations on texts, bit strings and byte strings.

10.5.1 ASCII(n) GUID-AA73694D-4BE3-4F4A-8187-982689F5250E v1

The Unicode character corresponding to the numeric character code.

'n' An integer 0 ... 65535 or a vector of such integers.


Value: A Unicode character or a vector of Unicode characters.

The name of this function has been reserved for compatibility although it now operates on Unicode
characters.

See function ASCII_CODE for the reverse operation.

Examples:

ASCII(65) ;returns "A"


ASCII(13) ;returns ‘carriage return’ character

10.5.2 ASCII_CODE(c) GUID-E91FD54B-9949-4093-984F-FF66047BEB16 v1

The numeric Unicode code of the character argument.

'c' A Unicode character or a vector of Unicode characters.


Value: An integer 0 ... 65535 or a vector of such integers.

The name of this function has been reserved for compatibility although it now operates on Unicode
characters.

See function ASCII for the reverse operation.

Example:

ASCII_CODE("A") == 65

10.5.3 BCD_TO_INTEGER(bcd) GUID-7A7A375B-DDA2-4746-B6C4-174E5589E1FE v2

Converts BCD coded numbers to integers.

MicroSCADA X SYS600 10.5 181


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

BCD (Binary Coded Decimal) values are represented in SCIL by values of BIT_STRING data type.
Each digit takes 4 bits (called a nibble), so the length of a BCD bit string is a multiple of 4. The length
of a BCD value is limited to 9 digits.

'bcd' Bit string value containing the BCD coded number.


Value: List value with attributes
STATUS Integer, status code of the conversion
INT Integer, the result of conversion

If the bit string represents a valid BCD number, the STATUS attribute is set to OK_STATUS (0) and
the result of the conversion is returned in attribute INT.

If the bit string is invalid, i.e. it contains nibbles out of range 0 ... 9, its length is not a multiple of 4 or
its length is greater than 36, STATUS is set to SCIL_NOT_A_BCD_NUMBER and INT attribute is not
returned.

See function INTEGER_TO_BCD for the reverse operation.

Example:

#LOCAL bcd_string_of_number = INTEGER_TO_BCD(98)


;returns list with BCD representation of the integer
;as the value of the attribute named BCD
#LOCAL l_of_number = BCD_TO_INTEGER(bcd_string_of_number.BCD)
;returns list with attribute INT containing the
;integer, 98
#LOCAL i_number = l_of_number.INT
;assign the value of the INT attribute to
;the variable 'i_number'

10.5.4 BIN(b) GUID-B0808DA8-BB0F-4604-BCC6-720A37DC6298 v1

Represents bit strings and integers as text in binary format.

'b' A bit string or integer, or a vector of bit strings and integers.


Value: A text or text vector. The length of the binary representation of an integer is 32
characters, the length of the representation of a bit string is the same as the length of
the bit string.

See function BIN_SCAN for the reverse operation.

Example:

BIN(BIT_SCAN("010101")) == "010101"
BIN(23) ;returns "0000...0010111" (27 leading zeroes)

10.5.5 BIN_SCAN(string) GUID-A1B5209C-4F80-46D4-8402-50B28066AD4D v1

Creates an integer or real value out of its binary text representation.

The text representation may contain leading blanks, a sign (+/-), digits 0 and 1 and a decimal point.

182 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'string' A text or a text vector.


Value: An integer or a real value, or a vector of such values. If the text representation contains
a decimal point, the result is a real value, otherwise it is an integer value. If the integer
result falls outside the integer value range (see Section 5), the overflown (high order)
bits are discarded.

See function BIN for the reverse operation.

10.5.6 BIT_SCAN(string) GUID-A3C92702-7250-4EE7-A8E6-92946522EF09 v1

Creates a bit string out of its text representation.

'string' A text containing characters "0" and "1" only, or a vector of such texts.
Value: A bit string or a vector of bit strings.

Example:

BIT_SCAN("101") ;creates a bit string of length 3

10.5.7 CAPITALIZE(text) GUID-D8783204-5822-46A4-8154-F14D2FFB1CCD v1

Capitalizes a text.

'text' A text or a text vector.


Value: A text or a text vector.

The function converts the first character of the text or each vector element to upper case and the rest
of the text to lower case according to the Unicode standard..

See also functions LOWER_CASE and UPPER_CASE.

Example:

CAPITALIZE("VÄSTERÅS") == "Västerås"

10.5.8 COLLECT(v, delimiter) GUID-9ABA8F66-52A7-4A94-96E5-D9DF96DF7AF8 v1

Collects text fields into a text.

The function collects the text fields given in a text vector into one text value, where the fields are
delimited by the given delimiter character.

'v' A text vector.


'delimiter' A text value of length 1.
Value: A text value.

See function SEPARATE for the reverse operation.

Example:

COLLECT(VECTOR("Alpha","Beta","Gamma"), "+") == "Alpha+Beta+Gamma"

MicroSCADA X SYS600 10.5 183


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.5.9 DEC(value [,length [,decimals]]) GUID-D56BE1B3-41CD-4E30-8CBC-8D198A52CD2B v1

Represents integer and real values as text.

'value' An integer or real value, or a vector of such values.


'length' An integer 0 ... 65 535. The minimum length of the text representation. Default = 6.
'decimals' An integer 0 ... 253 or a vector of such integers. The number of decimals included in
the conversion of real or integer data to text. Default = 0. If the 'value' argument is a
vector, this argument may be a vector of the same length. It defines the number of
decimals for each element individually.
Value: A text of 'length' characters or more, or a vector of such texts. If the number is shorter
than 'length', the string is filled up by leading blanks.

See function DEC_SCAN for the reverse operation.

Examples:

DEC(1000) == " 1000"


DEC(-1,0) == "-1"
DEC(1.3002,6,3) == " 1.300"

10.5.10 DEC_SCAN(string) GUID-B89779CE-CE48-4C31-9E06-F39E41421403 v1

Creates an integer or a real value out of its decimal text representation.

'string' A text or a text vector.


The text representation may contain leading blanks, a sign (+/-), digits and a decimal
point. Any other character is considered as an error generating a bad status.
Value: An integer or a real value, or a vector of such values.
If the text representation contains a decimal point, the result is a real value, otherwise it
is an integer value. If the integer result falls outside the integer value range (see
Section 5), a real value is returned.

See function DEC for the reverse operation.

Examples:

DEC_SCAN(" -5") == -5
DEC_SCAN("+40000.0") == 40000.0

10.5.11 EDIT(text, key) GUID-B15732CE-3EB9-4324-A5C5-0231FBB368E5 v1

Simple text editing.

The function removes spaces and tabs out of a text according to a specified rule.

'text' A text or a text vector.


'key' A text value. One of the following keywords:
"TRIM" Removes leading and trailing spaces and tabs.
"LEFT_TRIM" Removes leading spaces and tabs.
"RIGHT_TRIM" Removes trailing spaces and tabs.
Table continues on next page

184 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

"COLLAPSE" Removes all spaces and tabs.


"COMPRESS" Replaces multiple spaces or tabs with single spaces.
Value: A text or a text vector.

10.5.12 HEX(n) GUID-9E727128-E563-41FB-86E0-7AFC31FC1CDD v1

Represents an integer as text in hexadecimal format.

'n' An integer or a vector of integers.


Value: A text of 4 or 8 characters or a vector of such texts.
A 4-character text is returned if the value of the argument is in range -32 768 ... 32 767,
otherwise an 8-character text is returned. Leading zeroes are used when necessary.

See function HEX_SCAN for the reverse operation.

Example:

HEX(26) == "001A"
HEX(-1) == "FFFF"
HEX(123456) == "0001E240"

10.5.13 HEX_SCAN(string) GUID-0013EE2F-027F-4761-8004-D3E9CD676BF0 v1

Creates an integer or a real value out of its hexadecimal text representation.

The text representation may contain leading blanks, a sign (+/-), hexadecimal digits and a decimal
point. Any other character is considered as an error generating a bad status. The allowed digits are
0 ... 9, A ... F and a ... f.

'string' A text or a text vector.


Value: An integer or a real value, or a vector of such values.
If the text representation contains a decimal point, the result is a real value, otherwise it
is an integer value. If the integer result falls outside the integer value range (see
Section 5), the overflown (high order) bits are discarded.

See function HEX for the reverse operation.

Examples:

HEX_SCAN("F") == 15
HEX_SCAN("A.8") == 10.5

10.5.14 INTEGER_TO_BCD(int [,digits]) GUID-44242819-67CB-4BA6-9561-7BF86792708D v1

Represents an integer value as a BCD coded bit string

BCD (Binary Coded Decimal) values are represented in SCIL by values of BIT_STRING data type.
Each digit takes 4 bits so the length of a BCD bit string is a multiple of 4. The length of a BCD value
is limited to 9 digits.

MicroSCADA X SYS600 10.5 185


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'int' Integer value containing the integer to be converted.


'digits' Integer value 0 to 9, number of BCD digits in the result Default is 0.
Value: List value with attributes
STATUS Integer status code of the conversion.
BCD Bit string value, the BCD coded representation of 'int'.

If 'digits' is 0, a bit string long enough to hold the result is returned. Otherwise exactly 'digits' BCD
digits are returned, padded with leading zeroes, if necessary.

If the value of 'int' can be represented as a BCD bit string (i.e. it is non-negative and in the range
specified by 'digits'), the STATUS attribute is set to OK_STATUS (0) and the result of the conversion
is returned in attribute BCD.

If the argument is invalid, STATUS is set to SCIL_ARGUMENT_OUT_OF_RANGE and BCD attribute


is not returned.

See function BCD_TO_INTEGER for the reverse operation.

Example:

#LOCAL i_A = 9876 #LOCAL l_bcd = INTEGER_TO_BCD(i_A,9)


;converts the value of the variable 'i_A'
;returns a list with attributes 'BCD' and 'STATUS'
#LOCAL t_bcd = bin(l_bcd.bcd)
;returns the BCD code converted to textformat
#LOCAL t_status = dec(l_bcd.STATUS)
;returns the status converted to textformat
#LOCAL l_converted = BCD_TO_INTEGER(l_bcd.bcd)
;returns a list with attributes 'INT' and 'STATUS'
#LOCAL i_converted = l_converted.INT
;returns an integer as value of the attribute 'INT'
;from the list named 'l_converted'
#LOCAL t_converted_status = dec(l_converted.STATUS)
;returns the status converted to textformat
;from the list named 'l_converted'

10.5.15 JOIN(delimiter [, a]*) GUID-4C7C3E02-0DE5-40AA-B9FE-64AE15A73F47 v1

Joins text fields into a text.

The function joins the text fields given as arguments into one text value, where the fields are
delimited by the given delimiter character.

'delimiter' A text value of length 1.


'a' Up to 31 text or text vector arguments.
Value: A text value containing all non-blank text fields from the arguments 'a', delimited by
'delimiter' character.

See also functions COLLECT and SEPARATE.

Example:

JOIN("/", "A", VECTOR("B","C","")) == "A/B/C"


JOIN(".", PO:PIE10) ;Makes a display name for the object identifier of
;process object PO:P10, e.g.
"STA1.BAY2.DEV3"

186 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.5.16 LOCATE(string1, string2 [,"ALL"]) GUID-E0453CF3-23DE-4D9A-AC73-AF1C429D9B7B v2

Locates a text string in a text.

'string1' A text or text vector. The text to be searched.


'string2' A text value. The text string to be located.
"ALL" Text keyword. If given, LOCATE searches for all occurrences of 'string2' in 'string1'.
Value: An integer (>=0), a vector of such integers or a vector of vectors of such integers. It
represents the start position(s) of 'string2' in 'string1'. Zero result means that the string was
not found.
Without "ALL": The result represents the start position of the first found 'string2' in
'string1'. The result is an integer if 'string1' is a text value. If 'string1'
is a vector, the result is a vector of the same length.
With "ALL": The result represents the start positions of all occurrences of 'string2'
in 'string1'. The result is a vector if 'string1' is a text value. If 'string1'
is a vector, the result is a vector of the same length containing
vectors of integers.

Example:

LOCATE ("ABC","BC")
;returns 2
LOCATE ("ABC","BC ")
;returns 0
LOCATE ("ABB","B","ALL")
;returns vector(2,3)
LOCATE (("FGHBBN","ABBBB"),"BB","ALL")
;returns (vector(4), vector(2,4))
LOCATE (("HBBN","ABBBB","BB","AA"),"BB","ALL")
;returns (vector(2), vector(2, 4), vector(1), vector(0))

10.5.17 LOWER_CASE(text) GUID-584C1915-3631-49F4-9D29-161F1C6CCC4C v1

Converts text to lower case.

The function converts the upper case characters of 'text' to lower case according to the Unicode
standard.

'text' A text or a text vector.


Value: A text or a text vector.

See also functions UPPER_CASE and CAPITALIZE.

Example:

LOWER_CASE("VÄSTERÅS") == "västerås"

10.5.18 OCT(n) GUID-A19D155D-6B70-41BD-9528-7B33C1C19842 v1

Represents an integer as text in octal format.

'n' An integer or an integer vector.


Value: A text of 6 or 11 characters or a vector of such texts.
A 6-character text is returned if the value of the argument is in range -32 768 ... 32 767,
otherwise an 11-character text is returned. Leading zeroes are used when necessary.

MicroSCADA X SYS600 10.5 187


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Examples:

OCT(10) == "000012"
OCT(-1) == "177777"

10.5.19 OCT_SCAN(string) GUID-23B951D0-A29D-4ACC-980E-AF0E2097D5B4 v1

Creates an integer or a real value out of its octal text representation.

The text representation may contain leading blanks, a sign (+/-), digits of the radix and a decimal
point. Any other character is considered as an error generating a bad status. The allowed digits are
0 ... 7.

'string' A text or a text vector.


Value: An integer or a real value, or a vector of such values.
If the text representation contains a decimal point, the result is a real value, otherwise it
is an integer value. If the integer result falls outside the integer value range (see
Section 5), the overflown (high order) bits are discarded.

See the OCT function for the reverse operation.

Examples:

OCT_SCAN("10") == 8
OCT_SCAN("1.2") == 1.25

10.5.20 PACK_STR(source, type [,length [,byte_order]]) GUID-4BA51934-CFFF-4A16-82D7-8F8BFF7BAA95 v2

Creates a text, a bit string or a byte string out of its elements.

The function creates a text value out of a vector of its substrings, or a bit string or a byte string out of
a vector of integers that represent the values of bit or byte fields of given length.

'source' A vector of integer or text values.


'type' Text keyword. The data type of the result: "TEXT", "BIT_STRING" or "BYTE_STRING".
'length' An integer value, 1, 2, 4, 8, 16 or 32.
If 'type' = "BIT_STRING", this is the number of bits in each element of the source
vector.
If 'type' = "TEXT", 'length' is ignored.
If 'type' = "BYTE_STRING", the 'length' argument specifies how many bytes are
initialized by each element of the vector. The length may be 1, 2 or 4. For example, if
the length is 2, each element of the vector is taken as a 2-byte integer and then
appended to the resulting byte string (The two high order bytes of the element are
ignored).
Default = 1.
'byte_order' Text keyword: "BIG_ENDIAN" or "LITTLE_ENDIAN".
This argument is relevant only when 'type' is "BYTE_STRING". The 'byte_order'
argument may be used to create byte strings for an application running in a computer
of a different architecture. In a little endian architecture (for example, Intel, Alpha),
integers are stored with the least significant byte first. In a big endian architecture (for
example, Motorola), integers are stored with the most significant byte first. This
argument should be used only if the resulting byte string is going to be exported into a
foreign system requiring a specific byte ordering. If omitted, the byte string is created
with the byte ordering of the underlying architecture.
Value: Text, bit string or byte string depending on the 'type' argument.

188 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

See function UNPACK_STR for the reverse operation.

Examples:

PACK_STR(("A","B","CD"),"TEXT") == "ABCD"
PACK_STR((0,1,0),"BIT_STRING") == BIT_SCAN("010")
PACK_STR((0,3,1),"BIT_STRING",2) == BIT_SCAN("001110")

10.5.21 PAD([string, ]filler, length) GUID-C99E66BB-C436-41F6-8155-A631ADDC3F89 v1

Pads a text with a filler string to the given length.

'string' The text to be padded, default the empty string.


'filler' The text to pad with.
'length' Integer 0 ... 65 535, the wanted length of the result string.
Value: Text, 'string' padded with 'filler' to the length 'length'.

If the length of 'string' is greater than 'length', the 'string' is returned as such.

Examples:

PAD("A", 5) == "AAAAA"
PAD("AA", "BC", 7) == "AABCBCB"
PAD(" ", MAX_TEXT_LENGTH) ;returns a blank text of the maximum length
PAD("ABC", "D", 2) == "ABC"

10.5.22 REPLACE(text, string, new_string) GUID-996BC25A-B794-4176-8E77-40980F88B962 v1

Replaces text strings by another string.

'text' Text or text vector containing the input text.


'string' Text value, the string to be replaced.
'new_string' Text value, the replacing string.
Value: Text or text vector containing the text in 'text' with all occurrences of 'string' replaced by
'new_string'.

The arguments 'string' and 'new_string' may be of different length. Argument 'new_string' may be
empty. In this case, all the occurrences of 'string' are deleted.

If the resulting string is too long (> 65 535 characters), SCIL_STRING_TOO_LONG error is
generated when the 'text' argument is of text type. If it is a vector, the status of the overflowing
element is set to SCIL_STRING_TOO_LONG.

10.5.23 SEPARATE(text, delimiter) GUID-645B21DD-2B24-4FBC-91ED-07D4364B441A v1

Extracts fields of a text.

The function extracts the fields of text and returns the fields as a text vector. A field is any substring
delimited by the given delimiter character.

MicroSCADA X SYS600 10.5 189


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'text' A text value.


'delimiter' A one character text value.
Value: A text vector containing the fields of 'text'.
The delimiter character itself is not included in the field. If no delimiter character is
found in the text, the entire text is returned as the only element of the resulting vector.
An empty field is returned in case of two consecutive delimiters.

See function COLLECT for the reverse operation.

Example:

SEPARATE("A,B,C,D", ",")
;returns the vector ("A","B","C","D").

10.5.24 SUBSTR(string, start [,length]) GUID-949FC5FB-90CD-4A7E-9FAE-9A0838881F1D v1

Extracts a substring from a text, bit string or byte string value.

'string' A text, a bit string or a byte string value, or a vector of such values.
'start' An integer 1 ... 65 535 (texts and bit strings) or 1 ... 8 388 600 (byte strings). The
starting position of the substring.
'length' An integer 0 ... 65 535 (texts and bit strings) or 0 ... 8 388 600 (byte strings). Default is
0. The length of the substring. If 'length' = 0, the function returns the end of 'string'
starting from 'start'. If 'start' is greater than the length of 'string', an empty string is
returned. If 'length' > 0 and the substring extends beyond the end of 'string', the result
is padded with trailing blanks (texts), zero bits (bit strings) or zero bytes (byte strings).
Value: The same data type as 'string'. The substring.

Examples:

SUBSTR("ABCDE",3,2) == "CD"
SUBSTR("ABCDE",4,3) == "DE "
SUBSTR("ABCDE",6,3) == " " ;3 blanks

V = BIT_SCAN("1010101")
BIN(SUBSTR(V,2,3)) == "010"

SUBSTR(BYTES,1,100000)
;returns a byte string containing the first 100000 bytes of byte string
BYTES.

10.5.25 UNPACK_STR(source [,length [,byte_order]]) GUID-1B78CBA0-1975-4070-88C8-F03A9AA3811D v1

Splits a text, a bit string or a byte string to a vector of its elements.

The function splits a text to a vector of substrings, or a bit string or a byte string into a vector of
integers that represent the values of bit or byte fields of given length.

'source' A text, bit string or byte string value.


'length' Integer value. The length of the elements in the result vector.
If 'source' is a text, 'length' is the number of characters in each substring.
If 'source' is a bit string, 'length' is the number of bits in each bit field. The following
values are allowed: 1, 2, 4, 8, 16, 32. If the length of 'source' is not a multiple of 'length',
the excess bits are ignored.
Table continues on next page

190 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

If 'source' is a byte string, 'length' is the number of bytes in the byte fields. The values
1, 2 and 4 are allowed. 'length' may also be negative (-1, -2 or -4), in which case the
integers in the byte string are taken as signed, otherwise they are taken as unsigned. If
the length of 'source' is not a multiple of 'length', the excess bytes are ignored.
Default = 1.
'byte_order' Text keyword "BIG_ENDIAN" or "LITTLE_ENDIAN". The 'byte_order' argument
specifies the byte ordering of the byte string (see PACK_STR above). It should only be
used if the byte string has been imported from a foreign system. If omitted, the byte
string is supposed to have the byte ordering of the underlying architecture.
Value: A text or integer vector.

See function PACK_STR for the reverse operation.

Examples:

UNPACK_STR("ABC") == ("A","B","C")
UNPACK_STR("ABCDE",2) == ("AB","CD","E")
UNPACK_STR(BIT_SCAN("0111")) == (0,1,1,1)
UNPACK_STR(BIT_SCAN("011011"),2) == (2,1,3)
UNPACK_STR(BIT_SCAN("0110111"),2) == (2,1,3)

10.5.26 UPPER_CASE(text) GUID-145481C9-6971-464D-9334-C6B9718F6E48 v1

Converts text to upper case.

The function converts the lower case characters of 'text' to upper case according to the Unicode
standard.

'text' A text or a text vector.


Value: A text or a text vector.

See also functions LOWER_CASE and CAPITALIZE.

Example:

UPPER_CASE("Västerås") == "VÄSTERÅS"

10.6 Bit functions GUID-A9EE5F1C-D69B-4D29-B9AA-F9C13AECCF38 v1

The bit functions manipulate integers and bit strings on bit level.

An integer consists of 32 bits. The bits are numbered 0 .. 31 from right to left, i.e., 0 = Least
Significant Bit (LSB) and 31 = Most Significant Bit (MSB). A bit string can be composed of up to
65 535 bits numbered 1 ... 65 535 from left to right (see Section 10).

See also the SUBSTR function in Section 10.5. This function can be used to extract a substring out
of a bit string.

10.6.1 BIT(a, b) GUID-F38F98B5-DC2D-47DE-96C1-96A2A0F7A0EE v1

The bit value of a given bit in a bit string or integer.

The function returns the bit value of bit number 'b' in 'a'.

MicroSCADA X SYS600 10.5 191


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'a' An integer or a bit string value, or a vector of such values.


'b' The bit number. An integer in the range 0 ... 31 or 1 ... 65 535 depending on the data
type of 'a'.
Value: Integer 0 or 1, or a vector of such integers.

Examples:

BIT(3,0) == 1
BIT(-1,15) == 1
BIT(BIT_SCAN("010101"),5) == 0

10.6.2 BIT_AND(a1, a2) GUID-AEDDA6CB-5B41-4757-B948-B0D574B3130A v1

Bitwise logical AND of the arguments.

'a1' An integer or a bit string value, or a vector of such values.


'a2' As 'a1'.
Value: An integer or a bit string value, or a vector of such values.

If one of the arguments is a vector and the other is simple data, the operation is performed on the
simple data and each vector element. If both arguments are vectors, the operation is performed on
the corresponding elements. If the lengths of the vectors are unequal, odd elements are given
SUSPICIOUS_STATUS (see the Status Codes manual). Mixing integer and bit string values in one
operation is not allowed.

Examples:

BIT_AND(6,5) == 4
BIT_AND(BIT_MASK(0,2,4), BIT_MASK(1,2,4)) == BIT_MASK(2,4)

10.6.3 BIT_CLEAR(a [,b]*) GUID-B7AC7AC8-D7B3-4EFF-A480-D4D4AAFC98FF v1

Sets given bits to 0.

The function calculates an integer by setting the bits numbered 'b' in 'a' to zero.

'a' An integer or a bit string value, or a vector of such values.


'b' The numbers of bits to set, in the range 0 ... 31 or 1 ... 65 535 depending on the data
type of 'a'. Up to 31 bit numbers may be given. The bit numbers must not exceed the
number of bits in 'a'.
Value: The same data type as the argument 'a'.

Examples:

BIT_CLEAR(3,0) == 2
BIT_CLEAR(2,0) == 2
BIT_CLEAR(BIT_SCAN("01111"),2,4,5) == BIT_SCAN("00100")

10.6.4 BIT_COMPL(a) GUID-244C4AC6-388E-4C16-AADA-BCFCC6D84FD9 v1

Logical bit complement of the argument.

The function calculates the bitwise logical NOT of the argument.

192 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'a' An integer or bit string value, or a vector of such values.


Value: The same data type as the argument 'a'.

Examples:

BIT_COMPL(0) == -1
HEX(BIT_COMPL(HEX_SCAN("207F"))) == "DF80"
BIT_COMPL(BIT_SCAN("0101")) == BIT_SCAN("1010")

10.6.5 BIT_MASK([b1 [,b]]*) GUID-32E616C0-5FD7-446B-9246-7F61A3C05535 v1

Bit mask with given bits set to 1.

The function calculates an integer number by setting the given bits to 1 and all the others to 0.

'b1', 'b' Bit numbers. Up to 32 integer values in the range 0 ... 31.
Value: An integer.

Examples:

BIT_MASK() == 0
BIT_MASK(0) == 1
BIT_MASK(4,0) == 17

10.6.6 BIT_OR(a1, a2) GUID-1101A0CD-8305-4578-AD43-66320AC07F56 v1

Bitwise logical OR of the arguments.

'a1' An integer or a bit string value, or a vector of such values.


'a2' As 'a1'.
Value: An integer or a bit string value, or a vector of such values.

If one of the arguments is a vector and the other is simple data, the operation is performed on the
simple data and each vector element. If both arguments are vectors, the operation is performed on
the corresponding elements. If the lengths of the vectors are unequal, odd elements are given
SUSPICIOUS_STATUS (see the Status Codes manual). Mixing integer and bit string values in one
operation is not allowed.

Examples:

BIT_OR(6,5) == 7
BIT_OR(BIT_MASK(0,2,4), BIT_MASK(1,2,4)) == BIT_MASK(0,1,2,4)

10.6.7 BIT_SET(a [,b]*) GUID-7B33A757-EDEE-4CEA-B47C-DB39A18F3819 v1

Sets given bits to 1.

The function calculates an integer by setting the bits numbered 'b' in 'a' to one.

MicroSCADA X SYS600 10.5 193


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'a' An integer or a bit string value, or a vector of such values.


'b' The numbers of bits to set, in the range 0 ... 31 or 1 ... 65 535 depending on the data
type of 'a'. Up to 31 bit numbers may be given. The bit numbers must not exceed the
number of bits in 'a'.
Value: The same data type as the argument 'a'.

Examples:

BIT_SET(0,3) == 8
BIT_SET(-1,15) == -1
BIT_SET(BIT_SCAN("0101"),1,3) == BIT_SCAN("1111")

10.6.8 BIT_STRING(length [,b]*) GUID-9334E134-E347-4D8E-85FE-39B574E4726E v1

Creates a bit string by setting given bits to 1 and the other ones to 0.

'length' An integer, 1 ... 65 535. The number of bits in the bit string.
'b' Up to 31 integer values in the range 1 ... 'length'. The numbers of the bits to be set to 1.
Value: Bit string.

Example:

BIT_STRING(5,1,3,5) == BIT_SCAN("10101")

10.6.9 BIT_XOR(a1, a2) GUID-A3B1D91D-9A2B-441C-A8CC-979827D244D4 v1

Bitwise logical XOR (exclusive OR) of the arguments.

'a1' An integer or a bit string value, or a vector of such values.


'a2' As 'a1'.
Value: An integer or a bit string value, or a vector of such values.

If one of the arguments is a vector and the other is simple data, the operation is performed on the
simple data and each vector element. If both arguments are vectors, the operation is performed on
the corresponding elements. If the lengths of the vectors are unequal, odd elements are given
SUSPICIOUS_STATUS (see the Status Codes manual). Mixing integer and bit string values in one
operation is not allowed.

Examples:

BIT_XOR(6,5) == 3
BIT_XOR(BIT_MASK(0,2,4), BIT_MASK(1,2,4)) == BIT_MASK(0,1)

10.7 Vector handling functions GUID-527696B5-109A-4B4E-B9B9-0324833D42EB v1

The vector functions perform various operations on vector data.

10.7.1 APPEND(v, data) GUID-14F0B073-D52C-4170-890B-DB2257CEEC4D v1

Appends data to a vector.

The function creates a vector by appending 'data' to the contents of vector 'v'. If 'data' is a vector, the
elements of 'data' are appended to 'v' resulting to a vector whose length is the sum of the argument

194 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

vectors. If 'data' is of any other data type, the length of the resulting vector is one greater than the
length of 'v' and the last element gets the contents of 'data'.

'v' A vector.
'data' Any SCIL data type.
Value: A vector.

Example:

V1 = (1,2,3)
V2 = (4,5)
APPEND(V1,V2) ;returns (1,2,3,4,5)
APPEND(V1,6) ;returns (1,2,3,6)

10.7.2 BINARY_SEARCH(v, value) GUID-99D094C7-06A8-49C5-A5B7-0812A424E9BD v1

Searches an ordered vector by its element contents.

'v' The vector to be searched.


The elements of the vector may be of integer, real, time, text or Boolean type.
'value' The value to be searched for.
Data types allowed: integer, real, time, text or Boolean.
Value: Integer, the index of the occurrence of 'value' in the vector. Zero will be returned, if
'value' is not found.

The vector 'v' must be arranged in ascending or descending order. Its elements must be all numeric
(integer or real), all time values, all text values or all Boolean values.

If the vector contains more than one element by value 'value', the function returns the index of any of
them.

The validity of vector 'v' is not checked. If the vector is not arranged, the function may or may not find
the value. If the data type rules are violated, the function may fail by status
SCIL_INCOMPATIBLE_TYPES, or it may find the requested value or return a zero.

To search an unordered vector by its contents, see function FIND_ELEMENT. When the vector is
long, BINARY_SEARCH is much faster than FIND_ELEMENT and should therefore be used
whenever possible.

Example:

V = ("AB","CD","CD","EF")
I = BINARY_SEARCH(V,"EF") ;returns 4
I = BINARY_SEARCH(V,"CD") ;returns 2 or 3
I = BINARY_SEARCH(V,"ab") ;returns 0 (the search is case-
sensitive)

10.7.3 CLASSIFY(v, n, low, high) GUID-E0CE1BE1-14AB-4CDB-9752-990EDEB290B2 v1

Classifies the elements of a vector into size classes and returns the counts of each class.

MicroSCADA X SYS600 10.5 195


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'v' A vector with real elements. The vector to be classified.


'n' An integer in the range 1 ... 2 000 000. The number of classes.
'low', 'high' Integer or real numbers ('high' > 'low').
Value: A vector of length 'n' with real elements. The number of elements in each class.

The range 'low' .. 'high' is divided into 'n' size classes of equal length ('high' - 'low')/'n'. The function
calculates the count of elements of 'v' in each class. If an element in 'v' is smaller than or equal to
'low', it is counted to the lowest class. Elements larger than or equal to 'high' are counted to the
highest class. An element on a class boundary is classified to the upper class.

This function is frequently used when calculating duration curves.

Example:

A = (1.0, 5.0, 3.0)


B = CLASSIFY(A, 2, 0.0, 10.0)
;The contents of B:
;B(1) == 2.0 (the range 0.0 .. 5.0)
;B(2) == 1.0 (the range 5.0 .. 10.0)

10.7.4 CUMULATE(v) GUID-FFC9F935-D81B-4C16-B7D7-015830B6F579 v1

Accumulates the elements of the argument vector.

Each element n of the result vector is set to the sum of the n first elements of the argument vector.

'v' A vector with real elements.


Value: A vector of the same length as the argument vector. The elements of the vector are of
real type.

The function uses double precision (64-bit) floating point arithmetics internally to achieve the best
possible accuracy.

This function is frequently used when calculating duration curves.

Example:

V = (1, -5.6, 3.3, 37)


CUMULATE(V) ;returns (1.0, -4.6, -1.3, 35.7)

10.7.5 DELETE_ELEMENT(v, index [,index2]) GUID-BCA78E92-1F31-439D-8781-58041E48CB0E v1

Deletes individual elements of a vector.

'v' Any vector expression.


'index' A positive integer or an integer vector specifying the elements to be deleted. If index is
higher than the length of vector 'v' or negative, nothing is deleted.
'index2' A positive integer (>= index). If given, the range index .. index2 is deleted. If omitted,
only the element(s) specified by 'index' are deleted.
Value: A vector which is otherwise identical to 'v', but the element(s) specified by the index or
index range are deleted.

Example:

196 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

V = (1,3,5,7,9)
I = (6,2,4,0,4)
R = DELETE_ELEMENT(V,I) ;returns vector (1,5,9)

10.7.6 FIND_ELEMENT(v, value [,start_index [,case_policy]]) GUID-FD076E05-7A55-4370-8A3D-906A733463C6 v1

Searches a vector by its element contents.

'v' A vector of any element type.


'value' Value to be searched for, may be of any type.
'start_index' Positive integer, default is 1. The element index to start search.
'case_policy' Text keyword "CASE_SENSITIVE" or "CASE_INSENSITIVE", default is
"CASE_SENSITIVE". Meaningful only if the data type of 'value' is TEXT.
Value: Integer, the index of the first occurrence of 'value' in the vector, or the first occurrence
at or after 'start_index'. Zero is returned, if 'value' is not found.

To search an ordered (ascending or descending) vector by its contents, see function


BINARY_SEARCH. When the vector is long, BINARY_SEARCH is much faster than
FIND_ELEMENT and should therefore be used whenever possible.

Example:

V = ("AB","CD","EF","CD")
I = FIND_ELEMENT(V,"CD") ;returns 2
I = FIND_ELEMENT(V,"CD",I + 1) ;returns 4 (second occurrence of
I = FIND_ELEMENT(V,"CD",I + 1) "CD")
;returns 0 (no more found)

10.7.7 HIGH(v), LOW(v) GUID-AA395A84-31C3-497E-8C29-5AD171E004C6 v1

The largest (HIGH) or the smallest (LOW) element in a vector.

'v' A vector with elements of integer, real or time type.


Value: A vector of one element which is the largest or smallest element of the argument
vector.
If all the elements of the argument vector are of the same data type, the resulting data
type will follow. Otherwise, a real type result is returned.

The result is returned as a one-element vector to be able to return the status of the result: The status
of the only element is set to SUSPICIOUS_STATUS (= 1), if any of the elements of the argument
vector has a bad status (other than 0 or 3). If the argument vector is empty, or it contains no valid
elements, NOT_SAMPLED_STATUS is set.

Example:

V = (1,-5.6,3.3,37)
HIGH(V) == 37.0
LOW(V) == -5.6

10.7.8 HIGH_INDEX(v), LOW_INDEX(v) GUID-C45F10D0-4755-4C8E-B75D-A48CFE823F85 v1

The index of the largest or smallest element in a vector.

MicroSCADA X SYS600 10.5 197


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

‘v' A vector with elements of integer, real or time type.


Value: An integer.

HIGH_INDEX returns the index of the largest and LOW_INDEX the index of the smallest element in
the argument vector. If the argument vector is empty, or it contains no valid elements, the function
returns the value 0.

Examples:

V = (1,-5.6,3.3,37)
HIGH_INDEX(V) == 4
LOW_INDEX(V) == 2

10.7.9 INSERT_ELEMENT(v, pos, contents) GUID-766FC748-F45C-4D03-A9A6-64EDE5A6901A v1

Inserts new elements into a vector.

'v' Any vector.


'pos' Integer 1 ... 2 000 000 or a vector of such integers. The position(s) where to insert new
elements.
'contents' Any type value. The value(s) assigned to inserted element(s).
Value: A vector combined from the elements of 'v' and inserted new elements.

Position 'pos' (or each element of it, if a vector) is given as the index of the element in vector 'v' that
is to succeed the inserted element in the result vector. As an example, if 'pos' is 1, the new
element(s) are inserted at the beginning of vector. If 'pos' specifies an index that is larger than the
length of 'v', the vector is expanded and elements that are not assigned a value will have status 10
(NOT_SAMPLED_STATUS).

The allowed combinations of 'pos' and 'contents' types are the following:

1. 'pos' is an integer
1.1. 'contents' is not a vector A new element with contents 'contents' is inserted to become
element 'pos' in the result vector.
1.2. 'contents' is a vector New elements with contents specified by elements of 'contents' are
inserted in the position specified by 'pos'.
2. 'pos' is an integer vector
2.1. 'contents' is not a vector New elements are inserted in positions specified by elements of
'pos'. All new elements are assigned the value 'contents'.
2.2. 'contents' is a vector The lengths of vectors 'pos' and 'contents' must be equal. Each
contents(i) is inserted in position pos(i). If same index appears more than once in vector
'pos', the new elements are inserted in the order they appear in 'contents'.

Examples:

Suppose V is a vector with contents (1,2). Then

INSERT_ELEMENT(V, 1, ;returns (0,1,2)


INSERT_ELEMENT(V, 2, ("A","B")) ;returns (1,"A","B",2)
INSERT_ELEMENT(V, 4, 4) ;returns (1,2,'bad status 10',4)
INSERT_ELEMENT(V, (1,1,2,3), 0) ;returns (0,0,1,0,2,0)
INSERT_ELEMENT(V, (1,2,2), ;returns ("A",1,"B","C",2)
("A","B","C"))

198 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.7.10 INTERP(v, x) GUID-A9576CAC-1B1F-40FE-ACAB-EFA5A56370C6 v1

Interpolates a value from a curve.

'v' A vector with real type elements.


'x' A real value.

The argument 'v' is interpreted as (x, y) coordinate pairs defining a curve. The 1st and 2nd element
define the first point (x, y) of the curve, the 3rd and 4th define the second point, etc. The x
coordinates must be given in ascending order. The y coordinate corresponding to the given 'x' is
interpolated from the curve and returned as a real number. If 'x' < x1, y1 is returned. If 'x' > xn, yn is
returned (where 'n' denotes the number of coordinate pairs in the vector).

Value: A real number.

Examples:

A(1) = 1.0 ;X1


A(2) = 6.0 ;Y1
A(3) = 3.0 ;X2
A(4) = 7.0 ;Y2
INTERP(A,1.0) == 6.0
INTERP(A,2.0) == 6.5
INTERP(A,5.0) == 7.0

10.7.11 INVERSE(v, n, low, high) GUID-F76A78B9-DAF2-49FD-9D11-B5C724AB404A v1

Inverts a curve.

The elements in 'v' are interpreted to define a monotonously ascending curve y = y(x), where the
index of the vector represents the x-coordinate (1.0 .. length(v)) and the element value represents the
y-coordinate. The INVERSE function inverts this curve, i.e. solves the curve x = x(y) by linear
interpolation.

'v' A vector with real elements given in ascending order.


'n' An integer in the range 1 ... 2 000 000, the length of the resulting vector.
'low', 'high' Real numbers (high > low).
Value: A vector of length 'n' with real elements.

The numeric solution is returned in the resulting vector elements so that the i:th element gives the x-
coordinate corresponding to y = 'low' + i * ('high' - 'low')/'n'. If y < v(1), value 1.0 is assigned. If y >
v(n), where n is the length of 'v', value n is assigned.

This function is frequently used when calculating duration curves.

Examples:

A(1) = 3.0
A(2) = 4.0
A(3) = 9.0

X = INVERSE(A,5,0.0,10.0)
;The vector X now consists of the elements:
; 1.0 (y=2)
; 2.0 (y=4)
; 2.4 (y=6)

MicroSCADA X SYS600 10.5 199


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

; 2.8 (y=8)
; 3.0 (y=10)

For y=2, x gets the value 1.0, because this is the lowest possible value, and for y=10, x gets the
value 3.0, because this is the highest possible value.

10.7.12 MEAN(v) GUID-30119E69-D85A-4F8A-B4EC-101EEF80B0F4 v1

The mean value of the elements of a vector.

This function calculates the sum of all valid elements of a vector and divides the sum by their count.

'v' A vector with real elements.


Value: A vector of one element. The data type of the element is real.

The result is returned as a one-element vector to be able to return the status of the result: The status
of the only element is set to SUSPICIOUS_STATUS (= 1), if any of the elements of the argument
vector has a bad status (other than 0 or 3). If the argument vector is empty, or it contains no valid
elements, NOT_SAMPLED_STATUS is set.

The function uses double precision (64-bit) floating point arithmetics internally to achieve the best
possible accuracy.

Example:

V = (1,-5.6,3.3,37)
M = MEAN(V) ;Now M(1) == 8.925

10.7.13 PICK(v, indices) GUID-C4094CDA-F9DA-4D0F-A8E2-36B334225E4F v1

Picks up specified elements from a vector.

'v' Any vector value.


'indices' An integer vector with elements in the range 1 ... 2 000 000. The vector specifies the
indices of the elements which will be selected from the source vector.
Value: A vector, of the same length as 'indices', containing the elements selected from the
source vector.

If the index vector contains indices that are not present in the source vector (i.e. indices <= 0 or
indices that are greater than the length of 'v'), the corresponding elements in the result vector are
given NOT_SAMPLED_STATUS.

This function is frequently used in conjunction with functions SELECT, SORT and SHUFFLE.

Example:

#LOCAL P, N, S
P = (1,2,3,5,7,11,13,17,19)
N = (7,4,1)
S = PICK(P,N)
;Now S == (13,5,1)

10.7.14 REMOVE_DUPLICATES(v [,status_handling [,case_policy]]) GUID-6CDE51ED-469A-43A9-93B8-2A90E7F77BEE v1

Removes duplicate elements of a vector.

200 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'v' Vector value to be examined.


'status_handling' Text keyword "CONSIDER_STATUS" or "IGNORE_STATUS", default =
"IGNORE_STATUS"
'case_policy' Text keyword value, either "CASE_SENSITIVE" or "CASE_INSENSITIVE", default =
"CASE_SENSITIVE"
Value: Vector containing the different element values of 'v'.

The arguments 'status_handling' and 'case_policy' may be given in any order.

Two elements are considered equal if all the following conditions are satisfied:

• The value types are the same.


• The values are the same.
• The status values are the same (when "CONSIDER_STATUS") or else both valid (<=
LAST_VALID_STATUS) (when "IGNORE_STATUS").

Text values are compared for equality according to the argument 'case_policy'.

The test for equality is recursive, i.e. if an element is a vector or list, its components are tested for
equality.

The element values are returned in the order of appearance in 'v'.

Example:

REMOVE_DUPLICATES(VECTOR("ABC","abc","DEF"),"case_insensitive")
;returns VECTOR("ABC","DEF")

10.7.15 REVERSE(v) GUID-7BF27B82-C349-4491-AEE6-33BA45303A12 v1

Reverses the order of elements of a vector.

'v' Any vector.


Value: A vector of the same length as the argument vector.

Example:

V = (1,-5.6,3.3,37)
REVERSE(V)
;returns (37,3.3,-5.6,1)

10.7.16 SELECT(source, condition [,wildcards]) GUID-4F554B70-C052-49E4-9E8C-CB3FFD5FA36A v1

Selects the elements of a vector or a list of vectors that fulfil given condition.

'source' A vector or a list of vector attributes of equal length.


'condition' A text containing the selection criterion. The syntax depends on the data type of the source,
see below.
The condition is evaluated in read-only mode.
'wildcards' Text keyword, default "NO_WILDCARDS".
"WILDCARDS" Wildcards are used.
"NO_WILDCARDS" Wildcards are not used.
Value: An integer vector containing the selected element indices.

MicroSCADA X SYS600 10.5 201


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

If 'source' is a vector, each element of the vector is matched for the given condition. The indices of
the matching elements are returned in the result vector. The syntax of the condition is the normal
SCIL expression syntax (see Section 4), but the value of the element is referred to by notation ().
Even the parentheses may be omitted, when the element is used as the left hand operand of a
relation. The expression must evaluate to a boolean value. Local variables and arguments of the
program may not be used as operands in the condition. Examples of valid conditions:

">= 1 AND <= 10" ;Selects elements in range 1 .. 10


"() >= 1 AND () >= 10" ;Same as above
"> 10 OR ODD()" ;Selects all odd elements and the ones > 10
"== ""A*""" ;Selects elements starting with letter A

If 'source' is a list, the attribute values of each index are matched for the given condition. The syntax
of the condition is the normal SCIL expression syntax, but the value of the attribute element is
referred to by the attribute name. Examples of valid conditions:

"AB >= 1 AND CD <= 10" ;Selects all i: source.AB(i) >= 1 and
; source.CD(i) <= 10
"ABC > 10 OR ODD(EFG)" ;Selects all i: source.ABC(i) > 10 and
; source.EFG(i) is odd
"LN == ""A*""" AND OV == 1" ;Selects all i: source.LN(i) starts with A and
; source.OV(i) == 1

In text strings given in argument 'condition', wildcard character % can be used to represent any
single character and * to represent any sequence of characters. For example, "%B*C" matches with
any string that has letter B as its second character and letter C as its last character. To use wildcards,
"WILDCARDS" argument must be given, otherwise characters % and * have no special meaning.

Because SELECT returns the indices of the selected elements, function PICK is frequently applied to
the result to get the element values.

Examples:

@A = (1.0,2.5,7.0,10.6)
@I = SELECT(%A,">= 2 AND < 10")
;Now I == (2,3)
@S = SELECT(A:DOS(1..30),">0")
@A = PICK(B:DOV(1..30),%S)
;The registrations of the data object A that have a status >0 are
selected and
;the corresponding values of the data object B are picked.
;If 'source' is a list containing the attributes AB and CD the condition
can be written, ;e.g., ;"(AB > 10) AND (CD == 5)" which implies that the
indices which
;fulfil these conditions are selected.
SELECT(%V,"GET_STATUS () == 0")
;means that the elements with status == 0 in the vector %V are selected.

10.7.17 SHUFFLE(n) GUID-3E9C2C6A-6B70-48E8-A752-38E48394A3A1 v1

Shuffles integers 1 to n into a random order.

The function creates a vector of length n that contains integer values 1 to n in a random order.

202 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'n' Integer value in range 0 ... 2 000 000.


Value: Integer vector of length 'n'.

Example:

To rearrange any vector V to a random order:

SHUFFLED = PICK(V,SHUFFLE(LENGTH(V)))

10.7.18 SORT(v, [start, [length]]) GUID-0F67DE67-503C-49F1-9AF5-F4E47DD7AB5F v1

Sorts a vector.

The function sorts a vector of numeric (integer, real or time) or text data into ascending order or
alphabetical order (ASCII code order), respectively. When text data is sorted, a substring of the text
may be selected to be used as the sort key.

'v' The vector to be sorted. The elements of the vector must be uniform, either numeric or
text.
'start' The start position (1 ... 65 535) of the sort key when text data is sorted. Default = 1, i.e.,
the first character of the text.
'length' The length of the sort key (1 ... 65 535). If omitted, the substring from start position to
the end of text is used as the key.
Value: An integer vector.
If the length of ‘v' is n, the length of the resulting vector is also n and it contains
integers 1 to n in the collating sequence of the elements of 'v'. For instance, if the first
element of the result vector is 25, the 25th element of the 'v' vector is the ‘smallest’
one.

If descending order is required, apply function REVERSE to the result of SORT. Function PICK is
frequently used to physically rearrange the elements into the sort order.

Example:

#LOCAL UNSORTED = (7,9,4,3,35,6)


#LOCAL INDEX = SORT(UNSORTED)

;Now: INDEX == (4,3,6,1,2,5)


SORTED = PICK(UNSORTED,INDEX)

10.7.19 SPREAD(v, indices, new_value) GUID-4185F4DA-6E8D-465C-A1E7-621EC018E889 v1

Replaces vector elements by a new value.

'v' Any vector. The source vector.


'indices' A vector of integer elements, 1 ... 2 000 000. The index vector containing the indices to
be replaced.
'new_value' Any SCIL data type. The replacing value(s).
Value: A vector of the same length as 'v'.

The function creates a vector that is otherwise identical to the argument vector, but the elements
specified by an index vector are replaced by a new value.

If 'new_value' is of simple (non-vector) data type, the elements listed by 'indices' are replaced by that
value. If 'new_value' is a vector, its elements replace the elements listed the index vector. If vectors

MicroSCADA X SYS600 10.5 203


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'indices' and 'new_value' are unequal in length, the extra elements of the longer vector are
disregarded. indices in the index vector that are greater than the length of 'v' are disregarded.

Example:

#LOCAL V, I, A, S, T
V = (1,2,3,4,5)
I = (1,3,5)
A = (6,7,8)
S = SPREAD(V,I,A)
T = SPREAD(V,I,0)
;Now
;S == (6,2,7,4,8)
;T == (0,2,0,4,0)

10.7.20 SUM(v), SUM_POS(v), SUM_NEG(v) GUID-8017AA19-BCA8-4156-A978-A4003F970AB9 v1

The sum of all or the positive or the negative elements of a vector.

The functions calculate the sum of all (SUM), positive (SUM_POS) or negative (SUM_NEG) valid
elements of a vector, respectively.

'v' A vector with integer or real or elements.


Value: A vector of one element. The element is an integer if all the elements of 'v' are integers,
otherwise it is a real number.

The result is returned as a one-element vector to be able to return the status of the result: The status
of the only element is set to SUSPICIOUS_STATUS (= 1), if any of the elements of the argument
vector has a bad status (other than 0 or 3). If the argument vector is empty, or it contains no valid
elements, NOT_SAMPLED_STATUS is set.

The functions use double precision (64-bit) floating point arithmetics internally to achieve the best
possible accuracy.

Examples:

#LOCAL V, POS, NEG


V = (1,-5.6,3.3,37)
POS = SUM_POS(V)
NEG = SUM_NEG(V)
;Now
;POS(1) == 41.3
;NEG(1) == -5.6

10.7.21 TREND(v, n) GUID-DAEA285E-08BC-4382-AA9C-DCCCBBE62087 v1

Returns the last (‘newest’) elements of a vector.

'v' Any vector.


'n' An integer in the range 0 ... 2 000 000. The number of elements to be included in the
result vector.
Value: A vector of length 'n'. If 'n' is greater than the length of the argument vector, the first
elements get no value, their status is set to NOT_SAMPLED_STATUS.

Examples:

#LOCAL V = (1,-5.6,3.3,37)
TREND(V,2)
;returns vector (3.3,37)

204 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.7.22 VECTOR [([element1 [,element]*)] GUID-CA3A2211-3966-4E89-A69B-0679E12A006F v1

Creates a vector out of given elements.

'element' An expression of any data type. Up to 2 000 000 elements can be given. Using
VECTOR without an argument list creates an empty vector.
Value: A vector with the given elements.

Example:

#LOCAL A = VECTOR()
;The variable A will be an empty vector.

10.8 List handling functions GUID-AA89A082-EF3F-4DF9-B351-0B83004AD2A4 v1

List handling functions do various operations on list value data.

10.8.1 ATTRIBUTE_EXISTS(list, attribute) GUID-0355DC6D-7F6B-47AF-A922-2CBC6CA22969 v1

Checks whether a list contains given attribute(s).

'list' Any list value.


'attribute' Text or text vector, the name(s) of attribute(s).
Value: A boolean or boolean vector. TRUE if the given attribute is found in the list, otherwise
FALSE.

10.8.2 DELETE_ATTRIBUTE(list, attribute) GUID-D89B00DA-35EE-4261-99ED-C9BD4CF486A3 v1

Deletes attribute(s) from a list.

'list' Any list value.


'attribute' Text or text vector, the name(s) of attribute(s) to be deleted.
Value: A list, which is a copy of 'list' but attribute(s) specified by 'attribute' are removed.

Attributes that do not exist in 'list' are silently ignored, no error is generated.

Example:

The following statement reads the definition of a process object and removes attributes LN and IX
out of it.

#LOCAL A = DELETE_ATTRIBUTE(FETCH(0, "P", "ABC", 1), ("LN", "IX"))

10.8.3 LIST([attribute = expression, [attribute = expression]*])] GUID-05B7132F-3E24-46A3-AD71-E42FE24D1CB9 v1

List created out of given attribute name/value pairs.

The argument list may contain up to 2 000 000 attribute assignments.

MicroSCADA X SYS600 10.5 205


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'attribute' A freely chosen attribute name of up to 63 characters.


'expression' An expression of any data type. The value assigned to the 'attribute'.
Value: A list of the given attributes.

Syntactically, LIST is actually not a function, because it does not have expressions as its arguments.

Example:

#LOCAL STUFF = LIST(NUMBERS = (1, 2 ,3), NAMES = ("A", "B", "C"))

10.8.4 LIST_ATTR(list) GUID-7A3B8165-3D30-4697-9772-BDC3F4246D15 v1

Names of attributes of a list.

'list' A list value.


Value: A text vector containing the names of attributes of 'list' in alphabetical order.

Example:

#LOCAL X = LIST(AA = 1, BB = 2, CM = "TEST")


LIST_ATTR(X) ;returns VECTOR("AA", "BB", "CM")

10.8.5 MERGE_ATTRIBUTES(left, right) GUID-3679ED2A-08A7-48C9-BBF2-AA96FCA413D9 v1

Merges two lists into one.

'left' Any list value.


'right' Any list value.
Value: A list which contains all the attributes of 'left' and 'right' lists.
If the same attribute exists in both 'left' and 'right', the value in 'right' is returned.

Example:

#LOCAL X = LIST(AA = 1, BB = 2, CM = "TEST")


LIST_ATTR(X) ;returns VECTOR("AA", "BB", "CM")

#LOCAL X = LIST(A = 1,B = 2)


#LOCAL Y = LIST(C = 3,D = 4)
#LOCAL Z
X = MERGE_ATTRIBUTES(X, LIST(C ;X contains LIST(A = 1,B = 2,C = 4)
= 4)) ;Z contains LIST(A = 1,B = 2,C =
Z = MERGE_ATTRIBUTES(X, Y) 3,D = 4)

10.9 Functions related to program execution GUID-79C020B7-FA77-458A-B8FD-AE210167CC53 v1

10.9.1 ARGUMENT(n) GUID-7293305B-288E-474E-9836-86DB1C8612A7 v1

Nth argument of the program call.

206 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'n' Integer value 1 ... 32.


Value: The value of the nth argument of the argument list. If there are fewer than 'n'
arguments in the list, a value with data type "NONE" is returned.

For efficiency and clarity, it is recommended to name the arguments using the #ARGUMENT
command. However, if the SCIL program is designed to take a varying number of arguments, this
function along with ARGUMENT_COUNT is frequently used to read the optional arguments.

Example:

#ARGUMENT A
#LOCAL B = 1 ;Default value for the second argument
#IF ARGUMENT_COUNT == 2 #THEN B = ARGUMENT(2)

10.9.2 ARGUMENT_COUNT GUID-BBB07885-353F-485C-8993-1D7B0BFCF37F v1

The total number of arguments of the program call.

Value: Integer, 0 ... 32.

10.9.3 ARGUMENTS GUID-9E3608A4-08A4-4E40-A39D-12D0CEA40C12 v1

All arguments of the program call as a vector.

Value: Vector with up to 32 elements. If the program call has no arguments, a zero length
vector is returned.

Example:

@A = ARGUMENTS
@B = DO(%PROGRAM, %A)

10.9.4 DO(program [,a]*) GUID-7BF19707-647B-4999-B90E-BCA814F6E296 v1

Executes the SCIL program given as an argument.

'program' A text vector containing the SCIL program to be executed.


'a' Any SCIL data type. These arguments are passed to the SCIL program (up to 31
arguments may be specified).
Value: The value returned by the #RETURN command in the executed program, or 0 if the
program did not terminate by #RETURN command.

This function is recommended instead of #DO command, because arguments and return values are
not supported by #DO command.

Example:

;An example that calculates the tangent function of its argument.


#LOCAL RESULT = DO(READ_TEXT("TANGENT.SCL"), 0.5)

;Contents of file TANGENT.SCL:


#ARGUMENT ANGLE
#LOCAL COSA = COS(ANGLE)
#IF COSA == 0.0 #THEN #ERROR RAISE

MicroSCADA X SYS600 10.5 207


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

STATUS_CODE("SCIL_ARGUMENT_OUT_OF_RANGE")
#ELSE #RETURN SIN(ANGLE) / COSA

10.9.5 ERROR_STATE GUID-B9F417F2-0FCB-4DF9-94BF-9BBABBC05F3D v1

Returns the current error handling policy.

Value: Text value depicting the current error handling policy: "STOP", "CONTINUE",
"IGNORE" or "EVENT".

Example:

#LOCAL PREVIOUS_ERROR_STATE
PREVIOUS_ERROR_STATE = ERROR_STATE
#ERROR IGNORE
; Run ignoring errors
...
#ERROR 'PREVIOUS_ERROR_STATE'

10.9.6 MEMORY_USAGE(keyword, arg) GUID-BC3FD542-0B6A-4C48-864A-BBC274149462 v1

The amount of pool memory allocated for the argument.

'keyword' Text keyword, "EXPRESSION" or "VARIABLE".


'arg' Any expression, if 'keyword' = "EXPRESSION".
A text or text vector, the name(s) of the variable(s), if 'keyword' = "VARIABLE".
Value Integer or integer vector, the amount of memory pool allocated for the expression or the
variable(s).

This function helps debugging and analysing SCIL applications. It returns the amount of memory pool
(as bytes) allocated for an expression, or for a variable (including the book keeping data and the
value of the variable).

Examples:

(Memory usage in current implementation of SCIL, may change in future releases.)

MEMORY_USAGE("EXPRESSION","ABC") == 8
MEMORY_USAGE ("EXPRESSION",1) == 0 ;since integer values are not allocated

;from the pool


@X = "ABC"
MEMORY_USAGE("VARIABLE","X") == 136

10.9.7 OPS_CALL(command [,nowait]), OPS_CALL(command


[,option1 [,option2]]) GUID-BF1FEFC6-82E3-4C55-8A96-81B4B3700F83 v1

Executes an operating system command.

'command' A text value. The command to be executed. The maximum length of command is 32 767
characters. The started application may limit the accepted length from this value.
'nowait' Integer 0 ... 16. If omitted, OPS_CALL starts the execution of the command and waits until it
has finished. If given, termination is not waited. The value of the argument has no meaning in
current implementation. The allowed range is preserved for compatibility.
'options' One or two keywords in any order:
Table continues on next page

208 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

"WAIT" OPS_CALL waits until the command has finished.


"NOWAIT" OPS_CALL does not wait the command termination. This is the default
value.
"CLIENT" The command is executed in the caller’s session. This is the default value.
See below.
"SERVER" The command is executed in the server session. See below.
Value: A list with the following attributes:
ST Integer, the status value returned by the operating system.
0 = OK, any other value = failure.
FN 0. The attribute has no meaning in current implementation. It is preserved
for compatibility.

The option argument values "CLIENT" and "SERVER" are ignored in systems running an operating
system older than Windows Vista or Windows Server 2008. The following applies to newer operating
systems only.

The option argument "SERVER" specifies that the command is to be executed in the session of the
system server (Windows session #0, where the MicroSCADA service is running). The value
"CLIENT" specifies that the command is to be executed in the caller's session. If the caller runs in the
server session, the command is executed in the server session regardless of the argument value.
The default value for the argument is "CLIENT".

When OPS_CALL is executed in a client session (other than session 0), the started program has
access to the caller's desktop (if any), i.e. it may have a visible window and it may receive user input.
When the user logs out, any process started by OPS_CALL without "SERVER" argument is
terminated by the operating system.

When OPS_CALL is executed in the server session, the started program has no access to a
desktop. The program runs until it terminates itself or the MicroSCADA service is stopped.

10.9.8 OPS_PROCESS(command [,directory [,option1 [,option2]]]) GUID-69FEA35D-1E6F-44C9-AA6A-C48FFBAB3DC3 v2

Starts an external program as a separate process.

'command' Text value containing the command to start the process, for example, "\tools\my_tool my_file
-my_option". The maximum length of command is 32 767 characters. The started application
may limit the accepted length from this value.
'directory' Optional text value containing the work or default directory to be used by the process. The
directory is given in OS dependent format (see PARSE_FILE_NAME function to obtain OS
directory names). An empty name, "", denotes the work directory of the caller. Default value =
"".
'options' One or two keywords in any order:
"WAIT" OPS_PROCESS waits until the command has finished.
"NOWAIT" OPS_PROCESS does not wait the command termination. This is the
default value.
"CLIENT" The command is executed in the caller’s session. This is the default
value. See below.
"SERVER" The command is executed in the server session. See below.
Table continues on next page

MicroSCADA X SYS600 10.5 209


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Value: A list value containing the following attributes:


START_STATUS Integer value containing the OS dependent status code obtained
when starting the process.
EXIT_STATUS Integer value containing the OS and application dependent exit
status of the process. This attribute is returned only if "WAIT" is
specified and start of process succeeded.

The functionality is close to that of OPS_CALL function. However, OPS_PROCESS does not start
the command interpreter, it simply runs the program given as an argument of the function call. In
Windows this means that only EXE files may be started this way. To execute BAT files, OPS_CALL
should be used.

For the meaning of the option argument values "CLIENT" and "SERVER", see the description of the
OPS_CALL function.

10.9.9 REVISION_COMPATIBILITY(issue [,enable]) GUID-9784E7B2-D91B-411F-9A6B-D1107C509EDD v1

Selects the compatibility issues to be used in the context.

'issue' Text keyword. The name of the compatibility issue.


'enable' An optional boolean argument. TRUE = compatibility is enabled. FALSE = compatibility
is disabled. If this argument is not given, the function only reads the compatibility state
without modifying it.
Value: Boolean value indicating the compatibility before it was changed by the function.

The compatibility with the old revision is enabled/disabled by compatibility issues. The
REVISION_COMPATIBILITY function overrides temporarily, in the current SCIL context, the revision
compatibility defined in the APL:BRC attribute. See the description of the APL:BRC attribute in the
System Objects manual.

Example:

#LOCAL RC
RC = REVISION_COMPATIBILITY ("FILE_FUNCTIONS_CREATE_DIRECTORIES", FALSE)
; WRITE_TEXT function used here
RC = REVISION_COMPATIBILITY ("FILE_FUNCTIONS_CREATE_DIRECTORIES", RC)

The first function call disables the compatibility issue FILE_FUNCTIONS_CREATE_DIRECTORIES.


The second function call resets the compatibility issue to the value it had before.

10.9.10 STATUS GUID-871F3810-229B-4DB8-8A91-D7585DF8202E v1

The status code of the last error in the program.

Value: A non-negative integer, status code. See the Status Codes manual.

The function reads and resets the internal ’last error’ indicator.

Example:

#LOCAL S
#ERROR IGNORE
S = STATUS
#SET ABC:PBI = 0
S = STATUS
#ERROR STOP

210 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

#IF S > 0 #THEN !SHOW ERROR S


#ELSE !ERASE ERROR

10.9.11 VARIABLE_NAMES GUID-531DC280-0DC4-403D-953A-56C18D50C2D2 v1

Lists the names of global variables defined in the SCIL context.

Value: A text vector, the names of global variables in alphabetic order.

10.10 Functions related to the run-time environment GUID-83401757-A83D-48F7-913A-E1114A9C93F3 v1

10.10.1 AEP_PROGRAMS(apl) GUID-DABC738F-E700-43FB-82C1-9C65CBCA1E58 v1

Lists the running Application Extension Programs of an application.

'apl' Integer value 0 ... 250, the logical application number. 0 = current application.
Value: A vector. Each element provides information about one AEP program invocation as a list with
the following attributes:
PROGRAM_NUMBER Integer, the AEP program number.
START_COMMAND Text, the command that was used in AEP_START to start
the program.
ARGUMENT Any type, the SCIL argument given to the program when
started.
START_TIME Time value, the time program was started.
PROCESS_NAME Text, the name of the executable,e .g. "TOPCAL.EXE".
PROCESS_ID Integer, the process id (PID) of the executing process.

This function may be used to supervise the execution of external programs. See also Section
10.10.4.

10.10.2 CONSOLE_OUTPUT(text [,severity [,category]]) GUID-2334A28D-311A-4532-A433-FAD2BA0DE5B0 v1

Writes a message into the system error log (SYS_LOG.CSV) and into the notification window.

'text' A text or text vector. A text vector generates a multiline message.


'severity' Text, the severity of the message. One of the following values:
"" Unspecified. This is the default value.
"I" Information
"W" Warning
"E" Error
"T" Test
"D" Debugging
"N" Notification only (not written to SYS_LOG.CSV)
'category' A free text, up to 4 characters. Use the name or abbreviation of the functionality producing
the message. Default value "".
Value: The status code of the operation. 0 = OK.

MicroSCADA X SYS600 10.5 211


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.10.3 ENVIRONMENT(variable) GUID-9A701A20-1FDF-4BBC-BEB0-14044CF545EF v1

Retrieves an operating system environment variable value.

'variable' A text specifying the name of the environment variable.


Value: A text, the value of the environment variable. An empty text is returned if the
environment variable does not exist.

In Windows, the names of available environment variables are shown by the Windows Command
Shell command set (without any arguments).

Examples:

COMPUTER = ENVIRONMENT("COMPUTERNAME")
WORKSTATION_COMPUTER = ENVIRONMENT("CLIENTNAME")

10.10.4 IP_PROGRAMS GUID-67E53C84-D9C1-416F-A548-B7F3E1097B14 v2

Lists the running Integrated Programs in the system.

Value: A vector. Each element provides information about one IP program invocation as a list with
the following attributes:
PROGRAM_NUMBER Integer, the IP program number.
START_COMMAND Text, the command that was used in IP_START to start
the program.
ARGUMENT Any type, the SCIL argument given to the program when
started.
START_TIME Time value, the time program was started.
PROCESS_NAME Text, the name of the executable, for example, "IP.EXE".
PROCESS_ID Integer, the process id (PID) of the executing process.

This function may be used to supervise the execution of external programs. See also
AEP_PROGRAMS above.

10.10.5 MEMORY_POOL_USAGE(pool) GUID-B53F4AFB-D23C-4B62-ADDF-5D143421242E v1

The amount of memory allocated from a memory pool.

'pool' Text keyword specifying the pool to get information from:


"GLOBAL" The global memory pool.
"PRIVATE" The private memory pool of the thread.
"LOCAL" Obsolete argument value (former "Local pool of the
process"). Allowed for compatibility, works as "PRIVATE".
"PROCESS" Obsolete argument value (former "Pool used by the
process (either local or global)"). Allowed for
compatibility, works as "PRIVATE" (however, see value
attribute POOL below).
Value: List value with following attributes:
SIZE Current size of the pool as megabytes.
KILOS Current size of the pool as kilobytes. Non-zero only if
SIZE is 0.
Table continues on next page

212 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

MAX_POOL_SIZE Maximum size of the pool to grow (megabytes).


USED Bytes used.
FREE Bytes free.
BLOCK_SIZES Vector of allocation block sizes used by the pool (only if
pool size > 0).
USED_BLOCKS Vector counting allocations of each block size (only if
pool size > 0).
FREE_BLOCKS Vector counting free blocks of each size (only if pool size
> 0)
POOL Obsolete attribute, the value is always "LOCAL".
Returned only if 'pool' is "PROCESS".

10.10.6 OPS_NAME[([major [,minor]])] GUID-08201D5C-330F-4107-923A-6726BFE5E2F1 v2

Returns the name of the operating system.

'major' Integer value, the major version number.


'minor' Integer value, the minor version number, default value 0.
Value: Text value, the name of the operating system, whose version numbers match with
'major' and 'minor', see the table below.

If the function is called without arguments, the name of the operating system that is running is
returned.

The following table summarizes the values of the major and minor version numbers of current
Windows versions that run SYS600:

Value Major Minor


"Windows" 4 0
"Windows 2000" 5 0
"Windows XP" 5 1
"Windows Server 2003" 5 2
"Windows Vista or Server 2008" 6 0
"Windows 7 or Server 2008 R2" 6 1
"Windows 8 or Server 2012" 6 2
"Windows 8.1 or Server 2012 R2" 6 3
"Windows 10, Server 2016, Server 2019, 10 0
Windows 11 or Server 2022"

If the arguments do not match with any known operating system version, a question mark (?) is
returned.

Tools that display operating system information are encouraged to use this function. By using it, they
don’t have to be updated when new operating system versions are taken into use.

10.10.7 REGISTRY(function, key, value_name) GUID-7E7B3AC7-E25D-439D-8E66-1D5B777F8A86 v2

Reads the registry maintained by Windows operating system.

MicroSCADA X SYS600 10.5 213


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'function' Text keyword value


The only possible value is "READ" for now.
'key' Text value, the key to be read.
'value_name' Text value, the name of the value to be read.
Empty string "" denotes the 'default' value.
Value: A list with the following attributes:
STATUS Integer, the SCIL status code, 0 if OK.
VALUE Text or integer value, the value of the key.
This attribute is returned only when STATUS = 0.

The function reads the value of the specified key from the HKEY_LOCAL_MACHINE section of the
registry. Only value types REG_SZ (text value) and REG_DWORD (integer value) are supported. In
case of a failure, one of the following status codes is returned in the STATUS attribute of resulting
value:

SCIL_REGISTRY_KEY_NOT_FOUND, SCIL_REGISTRY_VALUE_NOT_FOUND,
SCIL_REGISTRY_DATATYPE_NOT_SUPPORTED.

See operating system documentation for further information about registry keys, value names and
value types.

Example:

#LOCAL RESULT
RESULT = REGISTRY("READ","SOFTWARE\ABB\PAK
\SYS_500\MAIN_LICENSE","CUSTOMER")
#IF RESULT.STATUS == 0 #THEN .DO_SOMETHING(RESULT.VALUE)
#ELSE_IF RESULT.STATUS == STATUS_CODE("SCIL_REGISTRY_KEY_NOT_FOUND")
#THEN -
.MAIN_LICENSE_IS_MISSING
#ELSE .DO_SOMETHING_ELSE(RESULT.STATUS)

10.10.8 SCIL_HOST GUID-0E6465F3-50BD-4042-B953-D5D1B7B4099A v1

Returns the type and number of the process that is running this SCIL code.

For example, the start program of a picture can find out whether the picture is being displayed on a
monitor or printed.

Value: A list containing two attributes:


NAME The process type as a text string. The possible values are:
"MAIN" The main (start-up) process
"PICO" A monitor process
"REPR" A report process
"PRIN" A printer spooler process processing a format
picture
"PRNC" A printer process processing a page header
"EXTERNAL" An external program running the SCIL interpreter
NUMBER Process number as an integer.
For the MAIN process and EXTERNAL processes, the value is 0.
For a PICO process, this is the monitor number
For a REPR process, the number is coded as 100 * apl + n, where
Table continues on next page

214 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'apl' is the application number


'n' = 1 for the time channel queue,
'n' = 2 for the event channel queue and
'n' = 2 + p for parallel queue 'p'.
For a PRIN process, the number is coded as 100 * apl + n, where
'apl' is the application number
'n' = 1 for process printouts and
'n' = 2 for report printouts.
For a PRNC process, this is the printer number.

This function can be used, for example, in the start program of a picture to determine whether the
picture is being displayed on a monitor or printed.

Example:

#LOCAL HOST, OX, CX, OV, S


HOST = SCIL_HOST
#IF HOST.NAME == "PRIN" #THEN #BLOCK
OX = 'LN':POX'IX'
CX = 'LN':PCX'IX'
OV = 'LN':POV'IX'
S = PRINT_TRANSPARENT((-2,TIMES, "OBJECT TEXT:",OX,-
"COMMENT TEXT:",CX, " OBJECT VALUE:",-1,DEC(OV)))
#BLOCK_END

This program block first checks whether the picture is being printed or shown on the screen. If it is
printed, the PRINT_TRANSPARENT function prints a row containing the present time and the values
of attributes OX, CX and OV of a process object.
GUID-30B4FE18-53BD-49A4-97E3-58DF5006814D v1
'apl' is the application number

'n' = 1 for the time channel queue,

'n' = 2 for the event channel queue and

'n' = 2 + p for parallel queue 'p'.


GUID-B632C87B-54DE-475B-B9B1-AB30F7EFEF55 v1
'apl' is the application number

'n' = 1 for process printouts and

'n' = 2 for report printouts.

10.11 Functions related to the programming environment GUID-028ED3E8-9B30-4718-9827-8010068F0B50 v1

10.11.1 COMPILE(source) GUID-16649F05-3242-4896-8B66-3076AD0DCCFD v1

Runs the SCIL compiler.

'source' Text vector containing the SCIL source code.


Value: A list value with following attributes:
STATUS Integer, status code from the compilation
CODE Byte string, the compiled byte code
Table continues on next page

MicroSCADA X SYS600 10.5 215


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

ERROR_LINE Text, the erroneous source line


ERROR_LINE_NUMBER Integer, the line number in error
ERROR_POSITION Integer, the character position in error

Attribute CODE is returned if the compilation succeeds (STATUS == 0). Attributes ERROR_LINE,
ERROR_LINE_NUMBER and ERROR_POSITION are returned if the compilation fails.

10.11.2 MAX_APPLICATION_NUMBER GUID-9B47A34E-1150-487D-AEEC-7480852F6DA3 v1

Maximum number of application objects.

Value: Integer, 250 (99 in rev. 8.4.4)

10.11.3 MAX_BIT_STRING_LENGTH GUID-AA34D28F-23A5-4BE3-A869-FBC6E6BB7610 v1

Maximum number of bits in a bit string type value.

Value: Integer, 65535

10.11.4 MAX_BYTE_STRING_LENGTH GUID-74089021-A4A7-48FF-A11B-A9948185F9EA v1

Maximum number of bytes in a byte string type value.

Value: Integer, 8 388 600 (1 048 576 in rev. 8.4.4)

10.11.5 MAX_INTEGER GUID-9C6A08C7-F9BF-4AEC-AB7E-D00BE8D5F4BC v1

Largest positive integer value.

Value: Integer, 2 147 483 647

10.11.6 MAX_LINK_NUMBER GUID-5ECAD631-D472-4B70-B68A-DF03F5ACA8C2 v1

Maximum number of link objects.

Value: Integer, 20

10.11.7 MAX_LIST_ATTRIBUTE_COUNT GUID-7B58AA30-347D-4E75-AC89-13066B55CC63 v1

Maximum number of attributes in a list.

Value: Integer, 2 000 000 (10 000 in rev. 8.4.4, 1 000 000 in rev. 8.4.5 - 9.4)

10.11.8 MAX_MONITOR_NUMBER GUID-6CD779DD-3A65-47E2-B912-AF528C91E57B v1

Maximum number of monitor objects.

Value: Integer, 100 (50 in MicroSCADA rev. 8.4.5).

216 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.11.9 MAX_NODE_NUMBER GUID-147DB327-68F7-4880-A673-8F71BF75FE80 v1

Maximum number of node objects.

Value: Integer, 250

10.11.10 MAX_OBJECT_NAME_LENGTH GUID-57442D5B-1DFE-4896-8B2F-AE12C3228920 v1

Maximum length of application and Visual SCIL object names.

Value: Integer, 63

10.11.11 MAX_PICTURE_NAME_LENGTH GUID-1D6685D6-0CC1-441A-9FDA-33964C8B879B v1

Maximum length of picture names.

Value: Integer, 10

10.11.12 MAX_PRINTER_NUMBER GUID-1FC21343-751A-41FD-B835-DD307D94883B v1

Maximum number of printer objects.

Value: Integer, 20

10.11.13 MAX_PROCESS_OBJECT_INDEX GUID-D28562BB-46E7-4F68-A22C-98C4FB077205 v1

Maximum number of process objects in a process object group.

Value: Integer, 65 535 (10 000 in rev. 8.4.4)

10.11.14 MAX_REPRESENTATION_NAME_LENGTH GUID-7CCE33BD-1EB4-4B02-A2EB-A538397DA7B3 v1

Maximum length of representation names.

Value: Integer, 10

10.11.15 MAX_STATION_NUMBER GUID-E69E5360-EB2C-43F9-AB2F-743A1CC20AC9 v1

Maximum number of station objects.

Value: Integer, 50 000 (in 9.2 SP1, 5 000 in 9.2)

10.11.16 MAX_STATION_TYPE_NUMBER GUID-5F4D2886-0107-423F-8DC6-8D587FFF1322 v1

Maximum number of station type objects.

Value: Integer, 33 (31 in rev. 9.1)

MicroSCADA X SYS600 10.5 217


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.11.17 MAX_TEXT_LENGTH GUID-255E514B-B65B-4273-B30E-26542F258977 v1

Maximum number of characters in a text type value.

Value: Integer, 65 535 (255 in rev. 8.4.4)

10.11.18 MAX_VECTOR_LENGTH GUID-87442662-7108-4428-9C08-B21227CED1C8 v1

Maximum number of elements in a vector.

Value: Integer, 2 000 000 (10 000 in rev. 8.4.4, 1 000 000 in rev. 8.4.5 - 9.4)

10.11.19 MAX_WINDOW_NAME_LENGTH GUID-CF551955-381F-44E0-824F-537F7707986C v1

Maximum length of window and picture function names.

Value: Integer, 10

10.11.20 MIN_INTEGER GUID-AE33FE8D-B49D-4F95-9FC9-A651BBED1207 v1

Smallest negative integer value.

Value: Integer, -2 147 483 648

10.11.21 OBJECT_ATTRIBUTE_INFO(apl, type [,subtype [,selection]]) GUID-A7105A1B-CEA8-4FD4-8B88-F29629CB9473 v2

Returns the properties of application or system object attributes.

'apl' Integer value, the logical application number (0 = current). Both local and external
applications are supported.
'type' Text keyword value specifying the object type:
"P" Process object
"X" Scale object
"H" Event handling object
"F" Free type object
"D" Data object
"C" Command procedure object
"T" Time channel object
"A" Event channel object
"G" Logging profile objects
"B" Base system object
"OBJECT" Attribute info is requested from the named object given as the next
argument.
'subtype' If 'type' = "OBJECT", text value specifying the object name.
Otherwise, its value depends on the 'type':
'type' = "P": Integer 0 or keyword value "COMMON". The properties of the
common attributes of process objects are returned.
Table continues on next page

218 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Integer >0, taken as the process object type PT. The properties of
the PT specific attributes are returned.
Text value, either the two-letter mnemonic name of a predefined
process object type or the name of the F-object describing the type.
The properties of the PT specific attributes are returned.
If the 'subtype' argument is omitted, the properties of the attributes of
the process group are returned.
'type' = "B": Text value, the three-letter mnemonic name of the base system type.
'type' = "H": Text value "SYS" or "AEC", the three-letter value of the HT (Event
Handling Type) attribute. If empty or omitted, all attributes are
considered.
'type' = "G": Text value "OBJECT", "DATABASE" or "HISTORY", the value of the
PT (Profile Type) attribute.
Other types: Omitted or an empty text.
'selection' Text value that selects the attributes whose properties are returned:
"ALL" All attributes. This is the default value.
"CONFIGURATION" Configuration attributes. For application objects,
these are the attributes returned by the FETCH
function.
"DYNAMIC" Dynamic attributes.
aa The two-letter name of the attribute, whose
properties are returned.
Value: A list value with the following attributes, if 'selection' = aa, otherwise a vector of such list
values:
SHORT_NAME The two-letter name of the attribute
LONG_NAME The two-word name of the attribute
DESCRIPTION The text identifier of the description of the attribute.
ACCESS Text vector containing one or more of the following
keywords: "READ", "WRITE", "SET", "MODIFY",
"SUBSCRIBE". See below.
VALUE_TYPE The data type of the attribute. See below.
DEFAULT The default value of the object attribute. Omitted if
the attribute is not a configuration attribute or the
attribute has no default value.
VECTOR_LENGTH The maximum length of the vector attribute.
Omitted if not a vector.
ELEMENT_TYPE The data type of the elements of the vector
attribute. Omitted if not a vector. See below.
ELEMENT_DEFAULT The default value of the elements of the vector
attribute. Omitted if not a vector or the attribute is
not a configuration attribute or the elements have
no default value.

The ACCESS of the attribute is defined as follows:

MicroSCADA X SYS600 10.5 219


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

"READ" The attribute is readable.


"WRITE" The attribute may be written by the #SET command and by the OPC Data Access
Server.
"SET" The (process object) attribute may be written by the so-called list set command (for
example, #SET ABC:P1 = LIST(OV=1,...) and by the OPC Data Access Server.
"MODIFY" The attribute may be written by the #MODIFY command and by the OPC Data Access
Server.
"SUBSCRIBE" The attribute may be subscribed to by the OPC Data Access Server using the update
rate 0.

The VALUE_TYPE or the ELEMENT_TYPE of the attribute is one of the standard SCIL data types or
one of the following:

"ANY" The value type may vary case by case.


"ANALOG" The value type is either "REAL" or "INTEGER", depending on the configuration of the
object.
"DATA" The value type is "REAL", "INTEGER" or "TEXT", depending on the configuration of the
object.

Examples:

OBJECT_ATTRIBUTE_INFO(0, "D")
; The properties of all attributes of data objects
OBJECT_ATTRIBUTE_INFO(0, "D", "", "CONFIGURATION")
;The properties of the configuration attributes of data objects
OBJECT_ATTRIBUTE_INFO(0, "D", "", "LF")
;The properties of the LF attribute of data objects
OBJECT_ATTRIBUTE_INFO(0, "P", "COMMON")
;The properties of the common attributes of process objects
OBJECT_ATTRIBUTE_INFO(0, "P", "BI")
;The process object type specific attributes of binary input objects
OBJECT_ATTRIBUTE_INFO(2, "P", "FREETYPE")
;The process object type specific attributes of objects of type
FREETYPE
OBJECT_ATTRIBUTE_INFO(0, "OBJECT", "ABC:P1")
;The properties of all attributes of the object ABC:P1
OBJECT_ATTRIBUTE_INFO(0, "B", "STA")
;The properties of the attributes of the STA base system objects

10.11.22 STATUS_CODE(mnemonic) GUID-5590D05B-7296-468A-A944-B8DA1622D699 v1

The numeric value of a mnemonic status code name.

'mnemonic' Text keyword value, the mnemonic status code name.


Value: Integer value, the numeric value of the status code. -1, if there is no status code by
given name.

See function STATUS_CODE_NAME for the reverse operation and examples.

10.11.23 STATUS_CODE_NAME(code) GUID-6B48D918-6D5E-4E51-9508-81C74EDBCB88 v1

The mnemonic name of a numeric status code.

220 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'code' Integer, the numeric status code


Value: Text value, the mnemonic name of the status code. Empty string, if status code number
is not used.

Examples:

The following statements are true:

STATUS_CODE("SCIL_UNDEFINED_VARIABLE") == 188
STATUS_CODE_NAME(188) == "SCIL_UNDEFINED_VARIABLE"
STATUS_CODE("NO_SUCH_ERROR_CODE") == -1
STATUS_CODE_NAME(-1) == ""

10.11.24 VALIDATE(as, string) GUID-2E46DFC8-DEA5-4F14-8C08-2CECB884C06B v1

Validates a text string as a SCIL object name.

'as' Text keyword value telling how to interpret 'string':


"VS_OBJECT_NAME",
"APPLICATION_OBJECT_NAME",
"WINDOW_NAME","PICTURE_NAME" or
"VARIABLE_NAME".
'string' Text string to be validated.
Value: Integer, SCIL status code. 0 = OK.

This function validates a given text string as a VS object, an application object, a window, a picture or
a variable name. If the name is OK, integer zero is returned. Otherwise an appropriate SCIL status
code is returned. Only the validity of the name is checked, existence of the object is not verified.

Example:

#LOCAL STATUS
#LOCAL INPUT_STRING = "A_B_C"
STATUS = VALIDATE("VS_OBJECT_NAME",INPUT_STRING)
#IF STATUS == 0 #THEN ROOT.CREATE_NEW_OBJECT(INPUT_STRING)
#ELSE MESSAGES.SHOW("INVALID OBJECT NAME: " + STATUS_CODE_NAME(STATUS))

10.11.25 VALIDATE_OBJECT_ADDRESS(apl, pt, un, oa [,subaddress] [,


self]) GUID-303C6544-523C-46C4-8B00-96855FE6F0D2 v1

Validates an object address.

The function returns the status code the base system would return, if an object by the given object
type and address would be created. In case of an address overlap, it reports the conflicting process
object.

'apl' Integer value, the logical application number (0 = current). Both local and external
applications are supported.
'pt' Integer value, the process object type:
3 BI
5 BO
6 DI
7 DO
Table continues on next page

MicroSCADA X SYS600 10.5 221


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

9 AI
11 AO
12 DB
13 PC
14 BS
15 FT
16 OE
17 NT
'un' Integer value, the unit number.
'oa' The object address. Either an integer value, the OA attribute of the object, or a text value, the
IN attribute of an OPC object
'subaddress' The object subaddress. Either an integer value, the object bit address (OB attribute), or a text
keyword "IN" or "OUT" for OPC objects. "IN" stands for the input object by the item name 'oa',
"OUT" for the output object by the item name 'oa'. Default value 16 (no bit address) for
numeric addresses, "IN" for textual (OPC) addresses.
'self' A list with the following attributes:
LN Text, the logical name of the process object being validated
IX Integer, the logical index of the process object being validated
This attribute may be specified when the object address of an existing process object is
changed. Address overlap is not reported if the conflicting process object is 'self'.
Value: A list with the following attributes:
STATUS Integer status code, the result of validation:
0 The address is valid, no conflict.
2129 PROF_PT_ATTRIBUTE_OUT_OF_RANGE
2131 PROF_BIT_ADDRESS_MISSING
2134 PROF_BIT_ADDRESS_NOT_ALLOWED
2136 PROF_PHYSICAL_ADDRESS_OVERLAP See the attributes LN and IX below.
2314 PROF_OBJECT_ADDRESS_NOT_ALLOWED
The following two attributes are returned only when STATUS = 2136:
LN Text, the logical name of the overlapping object.
IX Integer, the index of the overlapping object.

10.12 Language functions GUID-B8367115-D926-4F1B-846C-80140CD90688 v1

This section describes the SCIL functions that are related to translating different application texts into
different languages.

The translations of the texts included in the Visual SCIL objects, such as button labels, menu texts
etc., are normally defined by using the Dialog Editor and stored in the same objects. The function
TRANSLATE is used to translate the texts into the operator's language.

The translations of other application texts, such as texts describing process objects and their states,
are stored in text databases. These texts are translated explicitly by the TRANSLATION function, or
usually implicitly by referencing a language sensitive attribute of the object.

10.12.1 Language identifiers GUID-198492A7-247B-47F4-A849-D76ECF90089D v1

It is recommended, but not required, that the two-letter language identifiers defined by the ISO
standard 639 are used by the applications.

222 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

When ISO 639 language identifiers are used, the system is able to map the Windows language id's,
which are derived from the Windows locale id's, to the language identifiers of the SYS600
applications. Consequently, the OPC clients connected to the OPC Data Access Server may define
their language by the means specified in the OPC standard, and the base system automatically
converts the Windows language id's to the ISO 639 language identifiers.

The applications should select the language identifiers from Table 5.

Table 5: ISO 639 language identifiers and Windows language id’s

Afrikaans AF LANG_AFRIKAANS
Albanian SQ LANG_ALBANIAN
Arabic AR LANG_ARABIC
Armenian HY LANG_ARMENIAN
Assamese AS LANG_ASSAMESE
Azerbaijani AZ LANG_AZERI
Basque EU LANG_BASQUE
Byelorussian BE LANG_BELARUSIAN
Bengali BN LANG_BENGALI
Bulgarian BG LANG_BULGARIAN
Catalan CA LANG_CATALAN
Chinese ZH LANG_CHINESE
Croatian HR LANG_CROATIAN
Czech CS LANG_CZECH
Danish DA LANG_DANISH
Dutch NL LANG_DUTCH
English EN LANG_ENGLISH
Estonian ET LANG_ESTONIAN
Faroese FO LANG_FAEROESE
Persian FA LANG_FARSI
Finnish FI LANG_FINNISH
French FR LANG_FRENCH
Georgian KA LANG_GEORGIAN
German DE LANG_GERMAN
Greek EL LANG_GREEK
Gujarati GU LANG_GUJARATI
Hebrew HE LANG_HEBREW
Hindi HI LANG_HINDI
Hungarian HU LANG_HUNGARIAN
Icelandic IS LANG_ICELANDIC
Indonesian ID LANG_INDONESIAN
Italian IT LANG_ITALIAN
Japanese JA LANG_JAPANESE
Kannada KN LANG_KANNADA
Kashmiri KS LANG_KASHMIRI
Table continues on next page

MicroSCADA X SYS600 10.5 223


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Kazakh KK LANG_KAZAK
Korean KO LANG_KOREAN
Latvian LV LANG_LATVIAN
Lithuanian LT LANG_LITHUANIAN
Macedonian MK LANG_MACEDONIAN
Malay MS LANG_MALAY
Malayalam ML LANG_MALAYALAM
Marathi MR LANG_MARATHI
Nepali NE LANG_NEPALI
Norwegian NO LANG_NORWEGIAN
Oriya OR LANG_ORIYA
Polish PL LANG_POLISH
Portuguese PT LANG_PORTUGUESE
Punjabi PA LANG_PUNJABI
Romanian RO LANG_ROMANIAN
Russian RU LANG_RUSSIAN
Sanskrit SA LANG_SANSKRIT
Serbian SR LANG_SERBIAN
Sindhi SD LANG_SINDHI
Slovak SK LANG_SLOVAK
Slovenian SL LANG_SLOVENIAN
Spanish ES LANG_SPANISH
Swahili SW LANG_SWAHILI
Swedish SV LANG_SWEDISH
Tamil TA LANG_TAMIL
Tatar TT LANG_TATAR
Telugu TE LANG_TELUGU
Thai TH LANG_THAI
Turkish TR LANG_TURKISH
Ukrainian UK LANG_UKRAINIAN
Urdu UR LANG_URDU
Uzbek UZ LANG_UZBEK
Vietnamese VI LANG_VIETNAMESE
Uzbek UZ LANG_UZBEK
Vietnamese VI LANG_VIETNAMESE

10.12.2 The language of the SCIL context GUID-56C0D0EB-80ED-46FC-9A7E-392490F7FF7D v1

When a SCIL context is created, it is assigned to an initial language according to the following rules:

1. If the context is owned by a monitor, i.e. it is a SCIL context of a picture or a Visual SCIL object,
the LA (Language) attribute of the monitor (MON:BLA) defines the initial language.
2. If the context is not owned by a monitor, the LA attribute of the application (APL:BLA) defines
the initial language of the SCIL context.

224 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

The language may later be changed by the SET_LANGUAGE function. This function may also be
used to restore the initial language of the SCIL context.

When SYS600 is accessed via the OPC Data Access Server, the language is chosen by the
functions specified in the OPC standard. See the System Objects manual for the descriptions of the
LA attributes.

The language of the SCIL context has the following meanings:

• When a language sensitive attribute of an application object is read, it is automatically translated


into the language of the SCIL context. Examples of such attributes are the TX (Translated
Object Text) and the SX (Translated Object State) attribute of a process object.
• The language of the SCIL context works as the second argument’s default value of the SCIL
TRANSLATE and TRANSLATION functions, see below.

When a language sensitive attribute of an external application is evaluated (by using the
APL-APL communication), the attribute is translated into the language of the external
application, by default. If an explicit translation into another language is wanted, the
language of the SCIL context must explicitly be set by the SET_LANGUAGE function
before the evaluation of the attribute.

10.12.3 Text databases GUID-912A27F9-147A-4DF0-9531-34496BA54E2A v1

The translations of application texts are stored in data files called text databases.

The databases have three different scopes for different needs of software components using
translated texts:

1. The application text database APL_TEXT.SDB is designed to contain the site-specific texts of
the application.
2. The text databases listed by the application attribute APL:BTD are to be used by various
software products, such as LIBxxx products, and their localizations.
3. The system text database SYS_TEXT.SDB is delivered with the SYS600 base software and
should not be modified.

The databases are searched in the scope order, APL_TEXT.SDB first and SYS_TEXT.SDB last.

The text databases are organized as SCIL databases, where the text identifier acts as the section
name. The databases are maintained by the Text Translation Tool, or directly by using the SCIL
function DATA_MANAGER, see the example below.

Example:

The following piece of SCIL code creates a translation of the text identifier "IDClosed" into a couple
of languages:

#local db,-
ok = 0,-
result,-
id,-
translations,-
close_result

id = "IDClosed"
translations = list(EN = "Closed", DE = "Geschlossen", FI = "Kiinni")

db = data_manager("OPEN", "APL_TEXT.SDB")
#if db.status <> ok #return db.status

result = data_manager("CREATE_SECTION", db.handle, id)


#if result.status == ok #then -

MicroSCADA X SYS600 10.5 225


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

result = data_manager("PUT", db.handle, id, translations)


close_result = data_manager("CLOSE", db.handle)
#return result.status

10.12.4 SET_LANGUAGE(language) GUID-BDD160F1-EAE1-4A85-86C5-200B84F656AA v1

Sets the current language of the SCIL context.

'language' A text keyword, language identifier as defined in the ISO standard 639.
Value: A text keyword, the language of the SCIL context before the function call.

The function does not check that the language identifier is a valid ISO 639 language identifier, nor
does it check that the language is really supported by the application.

If the 'language' argument is an empty string, the initial language of the SCIL context is restored.

10.12.5 TRANSLATE(text [,language]) GUID-210DC51F-B2F1-44FD-BE46-21204C117438 v1

Translates texts defined in Visual SCIL objects.

'text' A text value, a reference to a text identifier defined in the Dialog Editor, or a vector of
such text identifiers. The reference starts with an @ character.
'language' A text keyword, language identifier as defined in the ISO standard 639.
Value: A text or a text vector value, the translated text(s).
If there is no initial @ character in 'text', no translation is done, but the text is returned
as such. If there are two initial @ characters, one of the @ characters is removed from
the resulting text, but no translation takes place.

The function can only be used in user interface objects (Visual SCIL objects and pictures). The
function searches the current dialog or dialog item (object THIS) for the text reference. If either the
text reference or the language is not found, the parent object is searched, and so on, up to the object
that was loaded with .LOAD command.

The 'language' argument is used only if the language selected for the monitor should be overridden.
If no 'language' argument is given, the language of the SCIL context is used (see above).

10.12.6 TRANSLATION(id [,language]) GUID-EFCB82D0-90C7-4C5F-A9F0-28A5ADD68141 v1

Translates texts by using text databases.

'id' A text value, the identifier of the text to be translated, or a vector of such identifiers.
The identifier is case-sensitive, may be of any length and may contain any characters.
'language' A text keyword, language identifier as defined in the ISO standard 639.
'Value:' A text or a text vector value, the translated text(s).

Normally, the function is used without the 'language' argument. In this case, the language of the SCIL
context is used (see above). If no translation into the language is found, the English translation is
returned, if any.

If the target language is explicitly given as the argument 'language' and the translation is not found,
no automatic translation into English is performed.

If no translation into the requested language is found, the function returns the text identifier as such.

226 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Example

.SET OBJECT_TEXT._TITLE = TRANSLATION('LN':POX'IX')


; Display the OX attribute in the operator’s native language
; Because the TX attribute is the translation of OX, this is equivalent to
.SET OBJECT_TEXT._TITLE = 'LN':PTX'IX'

10.13 Error tracing functions GUID-5D14AA10-7BF3-46EC-9636-5EC095B1A446 v1

The functions in this section are used for debugging SCIL programs. Tracing means recording of all
SCIL statements that are executed. The tracing is started by the TRACE_BEGIN function and
stopped by TRACE_END. If TRACE_BEGIN is called while tracing is already on, the second call is
ignored but counted: two TRACE_ENDs are needed to stop tracing. Functions TRACE_PAUSE and
TRACE_RESUME are used to skip tracing of uninteresting parts of the program execution.

The statements that contain variable expansions (macros), are recorded in their expanded form.
Each line is preceded by the depth of the control structure hierarchy to help find matching BLOCKs
and BLOCK_ENDs etc. Optionally, a time tag is inserted at the beginning of each line.

The function SCIL_LINE_NUMBER helps to generate programmed tracing information.

10.13.1 SCIL_LINE_NUMBER GUID-34E40577-D874-4701-AC96-AA09772D1787 v1

Tells the current line number within the SCIL program.

Value: Integer value. The current line number

Example:

@C = CONSOLE_OUTPUT("Reached line " + DEC(SCIL_LINE_NUMBER))

10.13.2 TRACE_BEGIN(filename [,append] [,time_tags] [,no_cyclics]) GUID-0B82B0DE-30F2-4635-B06B-2FD0BD4903E0 v1

Starts trace logging.

'filename' Text or byte string (file tag). The name of the file where the trace output is written. See
Section 6.5.1 for file naming.
'append' Text keyword "APPEND". If given, the trace output is appended to the file if it already
exists.
'time_tags' Text keyword "TIME_TAGS". If omitted, no time tags are written.
'no_cyclics' Text keyword "NO_CYCLICS". If given, cyclic methods of Visual SCIL objects and
update programs of pictures are not traced.
Value: Integer value. The status of file creation (0 = successful).

The keyword arguments 'append', 'time_tags' and 'no_cyclics' may be given in any order.

10.13.3 TRACE_END GUID-21C948BA-C709-47EB-A298-C4A211EEF3FB v1

Stops trace logging.

Value: Integer value. The status of closing the trace file (0 = successful).

MicroSCADA X SYS600 10.5 227


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.13.4 TRACE_PAUSE GUID-D57930DD-8FAA-4B0C-985C-7368530739FE v1

Pauses trace logging.

Value: Integer value. The status the operation (0 = successful).

10.13.5 TRACE_RESUME GUID-7C7E11C4-7B2B-4664-95D2-1876A3E17CD6 v1

Resumes trace logging.

Value: Integer value. The status of the operation (0 = successful).

10.14 Database functions GUID-C729DA51-EC07-4026-A820-8D7E08793336 v1

10.14.1 General object listing functions GUID-4B9C0EC5-3E2C-4034-BE9A-69CB892B923C v1

10.14.2 APPLICATION_OBJECT_ATTRIBUTES(apl, type, objects,


attributes) GUID-0BD3DEDB-D606-4648-9186-8B900500563F v1

Reads the values of specified attributes of given application objects.

'apl' Logical application number, see APPLICATION_OBJECT_LIST.


'type' Object type, see APPLICATION_OBJECT_LIST.
'objects' A text vector containing the names of the objects or a list with a text vector attribute LN
containing the names. In the case where the 'type' argument (second argument) is "IX" or
"IX_AND_UP", the 'objects' argument is a list with two attributes:
LN Text vector containing the object names
IX Integer vector containing the indices
'attributes' Text vector containing the names of attributes to be read. The vector may contain vendor
attributes, i.e. attributes named by the caller and defined by SDDL (SCIL Data Derivation
Language). See example below.
Value: A list with attributes specified by 'attributes'. Each attribute is a vector containing the values of
that attribute in the specified objects.

Example:

@OBJECTS = LIST(LN = ("BREAKER", "BREAKER"), IX = (10, 22))


@ATTRS = ("OV", "OS", "RT_STR = TIMEMS(RQ)") ;The last one is a
vendor attribute
;named RT_STR evaluated
by SDDL
;expression TIMEMS(RQ)
@VALUES = APPLICATION_OBJECT_ATTRIBUTES(0, "IX", %OBJECTS, %ATTRS)
@OV10 = %VALUES.OV(1)
@OS10 = %VALUES.OS(1)
@RT_STR10 = %VALUES.RT_STR(1)
@OV22 = %VALUES.OV(2)
@OS22 = %VALUES.OS(2)
@RT_STR22 = %VALUES.RT_STR(2)

The value, status and registration time of two indices of process object BREAKER1 are read. Note
that this code is not equivalent to the following:

@OV10 = BREAKER:POV10
@OS10 = BREAKER:POS10

228 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

@RT_STR10 = TIMEMS(BREAKER:PRQ10)
@OV22 = BREAKER:POV22
@OS22 = BREAKER:POS22
@RT_STR22 = TIMEMS(BREAKER:PRQ22)

Use of APPLICATION_OBJECT_ATTRIBUTES guarantees that the attribute values are from the
same moment of time. In the latter example, the database may have been updated between the first
and last command.

10.14.3 APPLICATION_OBJECT_COUNT(apl, type [,order [,direction [,


start [,condition]]]]) GUID-30D6E0D0-180F-4622-B51F-708C499F4132 v1

Counts application objects that fulfil given conditions.

'apl' Logical application number, see APPLICATION_OBJECT_LIST.


'type' Object type, see APPLICATION_OBJECT_LIST.
'order' Search order, see APPLICATION_OBJECT_LIST.
'direction' Search direction, see APPLICATION_OBJECT_LIST.
'start' Start point, see APPLICATION_OBJECT_LIST.
'condition' Search condition, see APPLICATION_OBJECT_LIST.
The condition is evaluated in read-only mode.
Value: Integer. The number of objects of the given type fulfilling the condition.

Because of modifications to types "P" and "IX", the behaviour in revision 8.4.2 is not fully
compatible with 8.4.1. Types "P" and "IX" no longer count process objects of user defined
types.

Example:

#LOCAL ALARMS_IN_UNIT_5, TIME_CHANNEL_COUNT


ALARMS_IN_UNIT_5 = APPLICATION_OBJECT_COUNT(0, "IX", "UNIT", "", 5, "AL
== 1")
TIME_CHANNEL_COUNT = APPLICATION_OBJECT_COUNT(0, "T")

10.14.4 APPLICATION_OBJECT_EXISTS(apl, type, name [,condition


[,verbosity]]) GUID-433AD733-524A-4695-A8E8-A6908C60DEB0 v2

Checks whether an application object exists.

'apl' Logical application number, see APPLICATION_OBJECT_LIST.


'type' Object type, see APPLICATION_OBJECT_LIST.
'name' The name of the object being searched for. In case of a process object ('type' = "IX"), a list
with attributes:
LN Text, the logical name of the object
IX Integer 1 ... 65535, the index of the object
For other object types, a text containing the name of the object.
'condition' Additional optional criterion to be fulfilled to consider the object as existing. For details, see
APPLICATION_OBJECT_LIST.
The condition is evaluated in read-only mode.
'verbosity' Optional text keyword, which specifies the form of the function result:
"LACONIC" or "" Boolean result. This is the default value.
Table continues on next page

MicroSCADA X SYS600 10.5 229


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

"VERBOSE" List result.


Value: When verbosity is "LACONIC", a Boolean value:
TRUE The object exists.
FALSE The object does not exist or does not fulfil the given
condition.
When verbosity is "VERBOSE", a list of following attributes:
STATUS SCIL status code, 0 = OK_STATUS. The following
attribute is present only if STATUS = 0.
EXISTS Boolean value, as above.

Example:

; Do something if ABC:P1 exists and is connected to the process


#IF APPLICATION_OBJECT_EXISTS(0, "IX", LIST(LN="ABC", IX=1), -
"IU == 1 AND SS == 2") #THEN .DO_SOMETHING

10.14.5 APPLICATION_OBJECT_LIST(apl, type [,order [,direction [,start


[,condition [,attributes [,max]]]]]) GUID-FE726B7A-7A8F-4359-A82A-958A9CB80997 v3

Lists application objects that fulfil given conditions.

'apl' Integer. The logical number of the application to navigate in. 0 = current application. Both
local and external applications are supported.
'type' Text keyword. Object type: "P", "IX", "UP", "IX_AND_UP", "H", "X", "F", "D", "C", "T", "A" or
"G".
"P" Process object groups.
"IX" Indices of process objects of predefined types.
"UP" Process objects of user defined types.
"IX_AND_UP" Process objects of both predefined and user defined
types.
"H" Event handling objects
"X" Scales.
"F" Free type objects.
"D" Data objects.
"C" Command procedures.
"T" Time channels.
"A" Event channels.
"G" Logging profiles.
'order' Text keyword. The search order given as a text expression:
"A" or "ALPHABETIC" Alphabetical order. When used with type "P", only group
names are included in the search. If used with type "IX"
or "IX_AND_UP", the indices are searched in name/
index order.
"I" or "INDEX" Index order (only for process objects of predefined
types). Searches the indices of the process object group
given as 'start'.
"P" or "PHYSICAL" Address order. Applicable only when 'type' is "IX", "UP"
or "IX_AND_UP".
"U" or "UNIT" Alphabetic (name/index) order within the unit given as
'start' (types "IX", "UP" and "IX_AND_UP" only).
Table continues on next page

230 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

"OI" Object identifier order within the object identifier(s)


specified by 'start' (types "IX", "UP" and "IX_AND_UP"
only). The objects with the same OI are ordered by LN
and IX.
"E" or "EXECUTION" Execution order within a time channel. 'type' can be
either "D" or C". Whichever is given, both data objects
and command procedures are searched.
"" Default value (= "A")
'direction' Text keyword:
"F" or "FORWARD" Forward browsing
"B" or "BACKWARD" Backward browsing
"" Default value (= "F")
'start' Start point of the search. Depends on the object type and search order as follows::
Order "A": Type "IX" and "IX_AND_UP": Logical name (text), or a list with the following
attributes:
LN Logical name (text)
IX Index (integer)
Other types Logical name (text)
All types: "" = default value
Order "I": Logical name (text)
Order "P": Unit (integer), or a list with the following attributes:
UN Unit (integer)
OA Object address (integer) (optional) Stations with numeric
addresses only
OB Object bit address (integer) (optional) Stations with
numeric addresses only
IN Item name (text) (optional) OPC and OAE stations only
IN_OUT Text keyword "IN" or "OUT" (optional) OPC stations only,
default = "IN"
"" = default value
Order "U": Unit number (integer), or a list with the following attributes:
UN Unit (integer)
LN Logical name (text) (optional)
IX Index (integer) (optional)
Order "OI": Object identifier (text). If the last character of the argument is *, the process
objects whose OI begins with the argument string are listed.
Order "E": Time channel name (text), or a list with the following attributes:
TC Time channel name (text)
OT Object type: "D" or "C" (optional)
ON Object name (text) (optional)
If the 'start' argument specifies an existing object, that object is not included in the search.
The 'start' argument is case insensitive.
'condition' A text containing the criterion for selecting objects.
Table continues on next page

MicroSCADA X SYS600 10.5 231


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

The selection criterion is a boolean type expression composed of relations and logical
operators. The relations have an attribute as the left operand. All attributes can be included in
the expression. Vector type attributes are referenced by the item index. List types are
referenced using the list items' attribute name. In conjunction with text attributes, the wildcard
characters % and * can be used. % matches any character, * matches any sequence of
characters (including a zero length sequence).
Default = "".
The condition is evaluated in read-only mode.
'attributes' A text or text vector containing the name(s) of attribute(s) to be returned in addition to LN
(and IX or OT). The vector may contain vendor attributes, i.e. attributes named by the caller
and defined by SDDL (SCIL Data Derivation Language). See the example below. Default = ""
(no additional attributes).
'max' Maximum number of objects to be returned (integer). Default = 10 000.
Value: A list including the following attributes:
COUNT Integer value, number of objects returned
MORE Boolean value. TRUE if browsing was interrupted due to 'max' being
exceeded
LN Text vector, names of the objects
IX Integer vector, indices (types "IX" and "IX_AND_UP" only)
OT Text vector (values "D" or "C") (order "E" only)
Plus additional attributes defined by the 'attributes' argument.
The objects are returned in the order specified by 'order' even if backward browsing is
specified.

Because of modifications to types "P" and "IX", the behaviour in revision 8.4.2 is not fully
compatible with 8.4.1. Types "P" and "IX" no longer return process objects of user defined
types.

Example 1:

APPLICATION_OBJECT_LIST(0, "IX")
; All (or 10000 first) process objects (of predefined type)
APPLICATION_OBJECT_LIST(0, "IX", "UNIT", "", 5)
; All objects of unit 5
APPLICATION_OBJECT_LIST(0, "IX", "UNIT", "", 5, "AL == 1")
; Alarming objects of unit 5
APPLICATION_OBJECT_LIST(0, "IX", "UNIT", "", 5, "AL == 1",-
("OV", "OS", "RT_STR = TIMEMS(RQ)"))
;SDDL used here
; Alarming objects of unit 5,
; attributes LN, IX, OV, OS and RQ are read

APPLICATION_OBJECT_LIST(0, "IX", "OI", "", "Eastwick", "HB == 1")


; Event blockings in the substation level of Eastwick (OI = "Eastwick")
APPLICATION_OBJECT_LIST(0, "IX", "OI", "", "Eastwick *", "HB == 1")
; Event blockings within the Eastwick substation
APPLICATION_OBJECT_LIST(0, "IX", "OI", "", "Eastwick*", "HB == 1")
; Event blockings within all substations whose name begins with "Eastwick"

APPLICATION_OBJECT_LIST(0, "IX", "OI", "", "Eastwick*", "IE(3) == ""Q0""")


; All objects within all substations whose name begins with "Eastwick"
and identifier elements vector index 3 is "Q0"
APPLICATION_OBJECT_LIST(0, "IX", "OI", "", "Eastwick*", "IL.BAY ==
""Incoming*""")
All objects within all substations whose name begins with "Eastwick" and
Identifier List item named "BAY" starts with "Incoming"

APPLICATION_OBJECT_LIST(2, "T", "ALPHABETIC", "", "", "LN == ""T*L""")


; The time channels in application 2, whose name starts letter T and
; ends with L

232 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Example 2:

The following piece of code reads and handles all the data objects of the application, 50 objects at a
time.

#LOCAL OBJECTS
#LOCAL START = ""
#LOCAL MORE_TO_COME = TRUE
#LOOP MORE_TO_COME
OBJECTS = APPLICATION_OBJECT_LIST(0, "D", "A", "", START, "", "", 50)
#IF OBJECTS.COUNT > 0 #THEN #BLOCK
.HANDLE_UP_TO_50_OBJECTS(OBJECTS.LN)
START = OBJECTS.LN(OBJECTS.COUNT)
#BLOCK_END
MORE_TO_COME = OBJECTS.MORE
#LOOP_END

10.14.6 APPLICATION_OBJECT_SELECT(apl, type, names, condition


[,verbosity]]) GUID-11DF7A31-782E-4DE7-A7BD-B30C86AA84AE v1

Selects from a list of objects the ones that fulfil the given condition.

'apl' Logical application number, see APPLICATION_OBJECT_LIST.


'type' Object type, see APPLICATION_OBJECT_LIST.
'names' The names of the objects.
In case process objects ('type' = "IX" or "IX_AND_UP"), a list with attributes:
LN Text vector, the logical names of objects.
IX Integer vector, the indexes of objects.
For other object types, a text vector containing the names of the objects.
'condition' The selection criterion. For details, see APPLICATION_OBJECT_LIST.
The condition is evaluated in read-only mode.
'verbosity' Optional text keyword, which specifies the form of the function result:
"LACONIC" or "" Vector result. This is the default value.
"VERBOSE" List result.
Value: When verbosity is "LACONIC", an integer vector containing the selected indexes. For
example, if 'names' specify 3 objects and the result is (1, 3), the 1st and 3rd object fulfil the
condition, the 2nd does not.
When verbosity is "VERBOSE", a list of following attributes:
STATUS SCIL status code, 0 = OK_STATUS. The following two
attributes are present only when STATUS = 0.
COUNT Number of selected objects.
SELECTED An integer vector containing the selected indexes.

Example:

;Suppose the value of process objects A:P1 and C:P3 is 0 and


;the value of B:P2 is 1.
;
#LOCAL NAMES = ("A", "B", "C")
#LOCAL INDEXES = (1, 2, 3)
#LOCAL LACONIC = APPLICATION_OBJECT_SELECT(0, "IX", -
LIST(LN = NAMES, IX = INDEXES), "OV == 0")
#LOCAL VERBOSE = APPLICATION_OBJECT_SELECT(0, "IX", -
LIST(LN = NAMES, IX = INDEXES), "OV == 0", "VERBOSE")
;Now, the value of variable LACONIC is
; VECTOR(1, 3) and
;the value of variable VERBOSE is

MicroSCADA X SYS600 10.5 233


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

; LIST(STATUS = 0, COUNT = 2, SELECTED = VECTOR(1, 3))


;
;To drop the unselected objects from the object list:
NAMES = PICK(NAMES, LACONIC)
INDEXES = PICK(INDEXES, LACONIC)

10.14.7 BASE_SYSTEM_OBJECT_LIST(type [,condition [,attributes


[,apl]]]) GUID-F3B9EFAA-2DA1-4CBB-B46D-48FDBDB29E28 v3

Lists the base system objects that fulfil the given condition.

'type' Text keyword. Object type: "SYS", "APL", "MON", "STA", "STY", "PRI", "NOD", "LIN".
'condition' A text containing the criterion for selecting objects.
The selection criterion is a boolean type expression composed of relations and logical
operators. The relations have an attribute as the left operand. All attributes can be included in
the expression. Vector type attributes are referenced by the item index. List types are
referenced using the list items' attribute name. In conjunction with text attributes, the wildcard
characters % and * can be used. % matches any character, * matches any sequence of
characters (including a zero length sequence).
Default = "".
The condition is evaluated in read-only mode.
'attributes' A text or text vector containing the name(s) of the attributes to be returned in addition to BM
(Base System Object Number). The vector may contain vendor attributes, i.e. attributes
named by the caller and defined by SDDL (SCIL Data Derivation Language). Default = "" (no
additional attributes).
'apl' Integer. The logical number of the external application that performs the query. This argument
is used to list the base system objects of a remote SYS600 system.
Value: A list containing the following attributes:
STATUS Integer, the SCIL status code of the operation. The following
attributes are returned only if STATUS = 0 (OK_STATUS).
COUNT Integer value, number of objects returned
BM Integer vector, object numbers of the objects
Plus additional attributes defined by the 'attributes' argument.

The function lists only the objects that do 'exist'. The rules for considering an object as an existing
one are the following:

• The SYS object always exists.


• An application (APL) object exists if its
NA (Name) is not empty or
TT (Translation Type) is not "NONE".
• A station (STA) object exists if its
ST (Station Type) is not "NONE" or
TT (Translation Type) is not "NONE".
• A station type (STY) object exists if its
NA (Name) is not empty.
• A node (NOD) object exists if its
LI (Link Number) is non-zero or
SA (Station Address) is non-zero or
NN (Node Name) is not empty or
NT (Node Type) is not "UNKNOWN" or
OP (OPC Server Data) is not empty.
• A link (LIN) object exists if its
LT (Link Type) is not "NONE".
• For other object types (MON and PRI), an object exists if its
DT (Device Type) is not "NONE" or
TT (Translation Type) is not "NONE".

234 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Example:

APLS = BASE_SYSTEM_OBJECT_LIST("APL", "", "NA")


; The numbers and names of the applications in the system

REX_STATIONS = BASE_SYSTEM_OBJECT_LIST("STA", "ST == ""REX""")


; The REX stations in the system

REMOTE_APLS = BASE_SYSTEM_OBJECT_LIST("APL", "", "NA", 10)


; The numbers and names of the applications in a remote system
; i.e. in the system where external application 10 is located

10.14.8 Object maintenance functions GUID-03458367-C5A5-4989-94C8-EB2727D4FB7A v1

These functions along with commands #CREATE, #MODIFY, #DELETE and #SEARCH (see Section
9.2.2 ) are used to do maintenance of application objects. Function FETCH may also be used to read
the attributes of base system objects.

10.14.9 FETCH(apl, type, name [,index]) GUID-7E823EF5-4C71-4FA4-B89F-E93105B1BB3A v1

Fetches the configuration attributes of an object.

'apl' Integer expression, 0 ... 250. The logical number of the application. 0 = the own
application. The function supports both local and external applications.
'type' Text expression. The type of the object: "P", "H", "X", "F", "D", "C", "T", "A", "G" or "B".
'name' Text expression. The name of the object.
'index' Integer expression, 0 ... 65 535. The index of a process object of a predefined type (not
obligatory). If 'index' is omitted or == 0 for process objects of the predefined types, the
function returns the attributes that are common to the process object group.
Value: A list containing the configuration attributes of the object, the dynamic run-time
attributes are not returned. If the named object does not exist, a list is returned with
only one attribute, IU, which has the value -1.

The function makes a list containing all configuration attributes of any application object (process
object, event handling object, scale, free type object, data object, command procedure, time channel,
event channel or logging profile).

Additionally, the function may be applied to a base system object. In this case, all the attributes of the
base system object are fetched.

Example:

@V = FETCH(0,"P","A",1)
;%V.LN has value "A"
;%V.IX has value 1

10.14.10 NEXT(n), PREV(n) GUID-BCAF0DB7-3EC6-48A8-9CC4-10C430EC62ED v1

Fetches the configuration attributes of an object within a search result.

'n' Integer, 1 ... 10. The identification number of the search.


Value: A list containing the configuration attributes of the object, the dynamic runtime
attributes are not returned. The object type determines which attributes are returned. If
the object does not exist a list is returned containing only the IU attribute which has the
value -1.

MicroSCADA X SYS600 10.5 235


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

These functions are used to browse through the result of a search initiated with the #SEARCH
command. Process objects, data objects, command procedures, scales, time channels, event
channels, logging profiles and free type objects can be searched through. The functions require that
the search has been initiated with the #SEARCH command, see Section 9.2.2.

Example:

#LOCAL OBJ
#SEARCH 2 0 "P" "A" "A"
OBJ = NEXT(2)
!SHOW NAME OBJ.LN

The name of the process object group following A in alphabetical order is shown.

10.14.11 PHYS_FETCH(apl, unit, address [,bit_address]) GUID-8F670B61-6E70-4798-81A3-8E69F3733EA8 v1

Fetches the configuration attributes of a process object

The process object is specified with its physical address.

'apl' Integer, 0 ... 250. The logical application number. 0 = the own application. Only local
applications are supported.
'unit' Integer. The unit number of the process unit where the object is situated. This is the
station number as known to the application.
'address' Integer. Object address. The OA attribute of the process object.
'bit_address' Integer, 0 ... 15. Bit number (can be omitted). The OB attribute of the object.
Value: A list containing the configuration attributes of the object, the dynamic runtime
attributes are not returned. If the object does not exist, the list contains only one
attribute, IU, which has the value -1.

Example:

#LOCAL OBJ = PHYS_FETCH (0,3,1010,5)

10.14.12 Alarm list functions GUID-73BD5CC9-6B8F-4EA6-8CFF-D0B034F76EA8 v1

10.14.13 APPLICATION_ALARM_COUNT(apl [, filter]) GUID-BDCDA2F1-57D6-49DF-8487-11E609F76E0B v1

Counts the alarms and warnings of an application.

'apl' Integer, 0 ... 250. The logical application number. 0 = the own application. Both local and
external applications are supported.
'filter' A text containing a filter for selecting objects.
The filter is a boolean type expression composed of relations and logical operators. The
relations have an attribute as the left operand. All attributes, except vector and list type
attributes, can be included in the expression. In conjunction with text attributes, the wildcard
characters % and * can be used. % matches any character, * matches any sequence of
characters (including a zero length sequence). Default = "".
The filter is evaluated in read-only mode.
Value: A list containing the following integer attributes:
STATUS SCIL status code, 0 = OK_STATUS. The next attributes
are present only if STATUS = 0.
ACTIVE_NOACK Count of active alarms that do not require an
acknowledgement
(AL = 1, AR = 1, RC = 0)
Table continues on next page

236 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

ACTIVE_ACKED Count of acknowledged active alarms


(AL = 1, AR = 1, RC = 1)
ACTIVE_UNACKED Count of unacknowledged active alarms
(AL = 1, AR = 0, RC = 1)
FLEETING Count of fleeting (unacknowledged inactive) alarms
(AL = 0, AR = 0, RC = 1)
LOW_WARNINGS Count of low warnings of analog input objects
(AC > 0, AZ = 3)
HIGH_WARNINGS Count of high warnings of analog input objects
(AC > 0, AZ = 4)

If an analog input object is in a warning state and has a fleeting alarm, it is counted as FLEETING
until the alarm has been acknowledged.

10.14.14 APPLICATION_ALARM_LIST(apl, lists [,attributes [, order [,


filter [, max_count]]]]) GUID-0DCB8AE7-4A91-4B21-83B2-8F6F853E8425 v2

Lists the alarms and warnings of an application.

'apl' Integer, 0 ... 250. The logical application number. 0 = the own application. Both local and
external applications are supported.
'lists' A text or text vector defining the lists to be returned. The following keywords or any
combination of them are available:
"ACTIVE_NOACK" The active alarms that do not require an
acknowledgement
(AL = 1, AR = 1, RC = 0)
"ACTIVE_ACKED" The acknowledged active alarms
(AL = 1, AR = 1, RC = 1)
"ACTIVE_UNACKED" The unacknowledged active alarms
(AL = 1, AR = 0, RC = 1)
"FLEETING" The fleeting (unacknowledged inactive) alarms
(AL = 0, AR = 0, RC = 1)
"LOW_WARNINGS" The low warnings of analog input objects
(AC > 0, AZ = 3)
"HIGH_WARNINGS" The high warnings of analog input objects
(AC > 0, AZ = 4)
"ACKED" The acknowledged alarms:
"ACTIVE_NOACK" +
"ACTIVE_ACKED"
(AL = 1, AR = 1)
"UNACKED" The unacknowledged alarms:
"ACTIVE_UNACKED" +
"FLEETING"
(AR = 0)
"ACTIVE" The active alarms: "ACTIVE_NOACK" +
"ACTIVE_ACKED" +
"ACTIVE_UNACKED"
(AL = 1)
"ALARMS" All alarms:
"ACTIVE" + "FLEETING"
"WARNINGS" All warnings:
"LOW_WARNINGS" +
"HIGH_WARNINGS"
Table continues on next page

MicroSCADA X SYS600 10.5 237


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

"ALL" All alarms and warnings:


"ALARMS" + "WARNINGS"
'attributes' An optional text or text vector defining the attribute(s) to be returned (apart from LN and IX,
which are returned by default). The vector may contain vendor attributes, i.e. attributes
named by the caller and defined by SDDL (SCIL Data Derivation Language). See the
example below.
'order' An optional text keyword specifying the order of reported alarms:
"TIME" Time order (oldest first). The alarms are ordered
according to their AT (and AM) attribute, the warnings
according to their WQ attribute.
"REVERSED" or Reversed time order (newest first)
"" This is the default value.
'filter' An optional text containing a filter for selecting objects.
The filter is a boolean type expression composed of relations and logical operators. The
relations have an attribute as the left operand. All attributes can be included in the
expression. Vector type attributes are referenced by the item index. List types are referenced
using the list items' attribute name. In conjunction with text attributes, the wildcard characters
% and * can be used. % matches any character, * matches any sequence of characters
(including a zero length sequence).
Default = "".
The filter is evaluated in read-only mode.
'max_count' Integer 1 ... 2000000, the maximum number of alarms to be reported in each list. Optional,
the default value is MAX_VECTOR_LENGTH (2000000).
Value: A list containing the following attributes:
STATUS SCIL status code, 0 = OK_STATUS. The next attributes
are present only if STATUS = 0.
ACTIVE_NOACK, Any combination of these attributes as defined by the
ACTIVE_ACKED, argument 'lists'.
ACTIVE_UNACKED,
FLEETING,
LOW_WARNINGS,
HIGH_WARNINGS,
ACKED,
UNACKED,
ACTIVE,
ALARMS,
WARNINGS,
ALL
Each alarm list attribute is a list of following attributes:
COUNT The count of alarms and warnings in the list.
LN The logical names of the objects in the list.
IX The indexes of the objects in the list.
'aa' The values of each attribute 'aa' defined by the argument
'attributes'.

If an analog input object is in a warning state and has a fleeting alarm, it is listed as FLEETING until
the alarm has been acknowledged.

Example:

@result = APPLICATION_ALARM_LIST(0, ("ACTIVE", "FLEETING"), ("ALARM_TIME


= TIMEMS(AQ)", "AC", "AR", "OV"))

The result might look like:

238 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

STATUS 0 0
ACTIVE List of
COUNT 2
LN Vector("ABC", "DEF")
IX Vector(1, 3)
ALARM_TIME Vector("15-04-21 11:26:28.341", "15-04-21 11:26:14.236")
AC Vector(2, 4)
AR Vector(0, 1)
OV Vector(1, 999.1)
FLEETING List of
COUNT 0

10.14.15 Data object functions GUID-8E47D9CF-8EA0-477A-9E26-91F0BDE31BF2 v1

Data objects functions read and write the history registrations of data objects.

10.14.16 DATA_FETCH(apl, name, index1 [,step [,count]]),


DATA_FETCH(apl, name, time1, time2 [,step [,shift]]),
DATA_FETCH(apl, name, time1 [,step [,count [,shift]]]),
DATA_FETCH(apl, name, indices) GUID-52939135-5595-48C5-B524-FB26F5AD5E99 v2

Reads history records of a data object.

'apl' Integer, 0 ... 250. The logical application number (0 = the own application).
External applications are supported.
'name' Text data. The name of the data object.
'index1' Integer, 1 ... 2 000 000. The index of the first record to be fetched.
'step' Integer, positive or negative. Defines the step between records to be fetched.
The default value = 1 (all records are fetched). If 'step' is negative, the values
are returned in reverse time order.
For example, if 'step' = 2, records 'index1', 'index1' + 2, 'index1' + 4, etc. are
fetched.
If 'step' = -2, records 'index1', 'index1' - 2, 'index1' - 4, etc. are fetched.
'count' Integer, 0 ... 2 000 000. The number of records to be fetched. 0 (default)
means all existing records up to 10 000.
'indices' Vector. An integer vector defining explicitly the records to be fetched.
'time1' Time data. The start of the time interval to be fetched.
'time2' Time data. The end of the time interval.
If 'time1' < 'time2', the values are returned in time order regardless of the sign
of 'step'. If 'time1' > 'time2', the values are returned in reversed time order
regardless of the sign of 'step'. The given time range is regarded as a semi-
open range. For example, if the range is given as 09.00.00-10.00.00, a
record sampled at 09.00.00 is included but a record sampled at 10.00.00 is
excluded (if shift = 0, see below).
'shift' Integer, 0 or 1.
0 No shift
1 A shift of one sampling interval.
Table continues on next page

MicroSCADA X SYS600 10.5 239


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

For example, a record sampled at 10.00.05 is included in the time range


09.00.00-10.00.00, but a record sampled at 09.00.05 is excluded. Default
value: 0.
Value: A list containing the following attributes:
OV Real vector, registered data
RT Time vector, the registration times
OS Integer vector, the status codes
IX Integer vector, the indices of the
values
LE Integer, the number of elements in
the result vectors above (OV, RT, OS
and IX).

When a time interval fetch is specified, the function expects that the history records are
stored in ascending time order. If not, the set of records included in the result is
unspecified.

Examples:

#LOCAL DATA = DATA_FETCH (0,"ABC",1,5,0)


;Every fifth history record of the data object ABC is read.

#LOCAL T1 = PACK_TIME (1989,9,10,0,0,0)


#LOCAL T2 = PACK_TIME (1989,9,10,12,0,0)
;Two time data values are defined.

#LOCAL A = DATA_FETCH (0, "ABC", T1, T2)


;The history records of the given time interval are read.

#LOCAL B = DATA_FETCH (0, "DEF", A.IX)


;The corresponding values of the data object DEF.

#LOCAL C = DATA_FETCH (0, "GHI", A.IX +5)


;The corresponding values of GHI shifted by 5.

10.14.17 DATA_STORE(apl, name, data, index1 [,step]),


DATA_STORE(apl, name, data, indices) GUID-E0C50B45-3716-446D-BC93-20547A6D7778 v1

Writes historical records of a data object.

'apl' Integer, 0 ... 250. The logical application number. 0 = the own application. External
applications are supported.
'name' Text. The name of the data object.
'data' List. The values to be stored, 3 attributes:
OV Real vector: recorded values
RT Time vector: registration times
OS Integer vector: status codes
If the RT attribute is missing from 'data', the original registration times are kept. If the OS
attribute is missing, the status codes of the elements of OV vector are stored as the OS
attribute.
'index1' Integer, 1 ... 2 000 000. The index of the first record to be written.
'step' Integer. This argument defines the step between records to be stored. Default value = 1 (all
records are stored). If 'step' is negative, the values are stored in reverse time order.
Table continues on next page

240 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

For example, if 'step' = 2, records 'index1', 'index1' + 2, 'index1' + 4, etc., are stored.
If 'step' = -2, records 'index1', 'index1' - 2, 'index1' - 4, etc., are stored.
'indices' Integer vector. Defines explicitly the records to be written.
Value: Integer. A status code. See the Status Codes manual. 0 = OK.

Examples:

#LOCAL HISTORY = DATA_FETCH(0, "A", 1)


#LOCAL STATUS1 = DATA_STORE(0, "DATA", HISTORY, 1)
#LOCAL STATUS2 = DATA_STORE(2, "A", HISTORY, 1)

The history of the data object A in the current application is copied to the data object DATA in the
current application and to the data object A in application 2.

10.14.18 Process object query functions GUID-9A98EE12-2151-4925-9412-C4874181F94A v1

Process object query functions are used to browse the results of a process object query defined by
preceding #INIT_QUERY command.

These functions are more or less obsolete. Use more powerful SCIL functions
APPLICATION_OBJECT_LIST, APPLICATION_OBJECT_ATTRIBUTES and
APPLICATION_ALARM_LIST for a query of the process database and
HISTORY_DATABASE_MANAGER to browse the event history.

10.14.19 END_QUERY GUID-1D8D4861-FF09-42C4-8DCF-C501ADCF8584 v1

Tells whether a process object query is completed.

Value: Boolean data. TRUE = the query is completed. FALSE = the query is not completed.

The function tests whether all objects matching a process query initiated by the #INIT_QUERY
command (Section 9) have been read with the PROD_QUERY function.

Example:

#IF END_QUERY #THEN #BLOCK


!SHOW MESSAGE "READY"
#BLOCK_END
#ELSE #BLOCK
LIST = PROD_QUERY(20)
!SHOW NAME LIST.LN
!SHOW VALUE LIST.OV
#BLOCK_END

If the query has been completed, the message READY is shown on screen. Otherwise, 20 more
process objects are handled.

10.14.20 PROD_QUERY(n) GUID-08301E71-F7A2-4414-B1C3-B3016BFA26BC v1

Returns attributes of objects selected by a process object query.

MicroSCADA X SYS600 10.5 241


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'n' Integer, [-] 1 ... APL:BQL. The maximum number of process objects that are included in
the query. If the number is given with a negative sign, the browsing is performed
backwards.
Value: A list containing the following attributes:
Identification: LN (Logical Name), IX (Index), PT (Process Object
Type), OI (Object Identification), OX (Object Text)
Object value: OV (Object Value), OS (Object Status)
Alarm state: AL (Alarm), AS (Alarm State), AR (Alarm Receipt), AZ
(Alarm Zone)
Time stamps: RT (Registration Time), RM (Registration Milliseconds),
AT (Alarm Time), AM (Alarm Milliseconds), YT, YM
RTU attributes: SE (Selection), SP (Stop Execution), OF (Overflow),
Protocol attributes: BL, CT, OR, RA, RB, SB
Blocking: AB, HB, PB, UB, XB
Miscellaneous: RI, RX
In addition, when the query concerns the history buffer: CA (Changed Attribute)

The function returns attribute values of the process objects selected by the preceding #INIT_QUERY
command (see Section 9). The query concerns always the current application.

After one #INIT_QUERY, the function may be called several times. Each time it continues from where
it finished previously.

The attribute values of a certain attribute form a vector. For example, the LN attribute is a vector of all
object names included in the query. Vector elements with the same index refer to the same process
object.

Examples:

The result of the function call PROD_QUERY(4) could be:

Attributes
Index LN IX OV
1 "TEMP" 1 63.0
2 "PH" 5 6.5
3 "SWITCH" 1 1
4 "SWITCH" 2 0

The attribute LN (logical name) constitutes the first vector, IX (index) the second one and OV (object
value) the third one.

10.14.21 History database functions GUID-4AD1E571-F8F9-4986-9B7C-0328DE175BD6 v1

10.14.22 HISTORY_DATABASE_MANAGER("OPEN" [,apl]) GUID-E3B897FA-453E-48BE-9736-0927415D9A11 v1

Opens a session to the history database of an application.

The HISTORY_DATABASE_MANAGER function is session-based. A query session is first created.


Subsequent calls of the function may then set various query parameters and do queries. Finally, the
session is closed.

There may be up to 10 open query sessions within one SCIL context.

242 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

When a SCIL context is deleted, the open query sessions are closed automatically. However, it is a
good practice to close the sessions explicitly by SCIL to save system resources.

'apl' Integer or text value.


When an integer, specifies the logical application number (0 = current application)
Text keyword "NO_APPLICATION" is used to specify no application.
Default value is 0.
Value: List:
SESSION Integer value. Used to identify the session in subsequent calls.
STATUS Integer value, SCIL status code.

This command opens a new query session and sets the query parameters to their default values
(described later). If already 10 sessions are open, status SCIL_TOO_MANY_HDB_SESSIONS is
returned in the STATUS attribute of the result.

If another than the current APPLICATION is specified, it has to be local (in same SYS) but its state is
allowed to be COLD.

If no application is specified, SET_DIRECTORY command must be used to tell the history database
manager where to find the database.

If a cold application or no application at all is specified, the user defined attributes of user defined
process objects are not returned, because there is no process database to find the attribute
descriptions of corresponding F-type objects.

10.14.23 HISTORY_DATABASE_MANAGER("CLOSE", session) GUID-139B1B5C-8EEF-46AB-9E6A-ADEFFC10C7E4 v1

Closes a session to the history database of an application.

'session' Integer value returned by OPEN command.


Value: List:
STATUS Integer value, SCIL status code.

This command closes the session by releasing all the resources associated to the session.

10.14.24 HISTORY_DATABASE_MANAGER("SET_PERIOD", session,


begin [,end]) GUID-CF8477EC-305F-403C-96C5-9C44A312CB76 v1

Sets the time period of the database query.

'session' Integer value returned by OPEN command.


'begin' Time value defining the first day of the period. The following format can be used
pack_time(1998,4,1,0,0,0)
'end' Time value defining the last day of the period, default = 'begin'.
Value: List:
DATE_COUNT Integer value. Number of days whose history database
was successfully opened.
Table continues on next page

MicroSCADA X SYS600 10.5 243


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

MISSING_DATES Time vector containing the dates whose database files


could not be read.
MISSING_STATUS Integer vector containing the status codes of failed
database file reads.
STATUS Integer value, SCIL status code.

The period defines the time period whose database files are included in the query. A period may
contain up to 1000 database files. Status SCIL_PERIOD_TOO_LONG is returned, if this limit is
exceeded.

The arguments 'begin' and 'end' are used only to define the date: hours, minutes and seconds are
ignored.

The period is initially empty.

10.14.25 HISTORY_DATABASE_MANAGER("SET_DIRECTORY", session,


directory) GUID-BA0D2D2C-2F49-4914-A011-ED11964F350E v1

Sets the location of database files.

'session' Integer value returned by OPEN command.


'directory' Text or text vector containing the directory (or directories) where to locate the database files.
See Section 6.5.1 for directory naming.
Value: List:
STATUS Integer value, SCIL status code.

Up to 20 directories may be specified. Status SCIL_TOO_MANY_DIRECTORIES is returned if this


limit is exceeded.

Setting this parameter resets the active period.

When a session is opened, this parameter is set to point to the APL_ subdirectory of the application.
If no application is defined, the parameter is left empty.

10.14.26 HISTORY_DATABASE_MANAGER("SET_WINDOW", session,


begin, end) GUID-CA9BE3B9-4491-4CA3-9CE5-0582B263707F v1

Sets the time window of the query.

'session' Integer value returned by OPEN command.


'begin' Time value or an integer 0.
Begin time of the window. If 0, the window has an open beginning.
'end' Time value or an integer 0.
End time of the window. If 0, the window has an open end.
Value: List:
STATUS Integer value, SCIL status code.

This command sets the time window of the query. A time window may have an open beginning
and/or an open end, meaning all events older than 'end' or old events newer than 'begin',
respectively.

If both 'begin' and 'end' are non-zero, they may be given in any order.

244 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

When a session is opened, the window is set to (0, 0).

10.14.27 HISTORY_DATABASE_MANAGER("SET_ORDER", session,


order) GUID-D66094C8-AE27-419F-AADC-2C95D782F6F2 v1

Sets the listing order.

'session' Integer value returned by OPEN command.


'order' Text keyword, either "LOG" or "EVENT".
"LOG" The events are returned in the order they were written into the database.
"EVENT" The events are returned in the order specified by the values of attributes
ET and EM.
Value: List:
STATUS Integer value, SCIL status code.

If logging order is requested, the time window applies to attributes HT and HM of the event,
otherwise to attributes ET and EM.

When a session is opened, the order is set to "EVENT".

10.14.28 HISTORY_DATABASE_MANAGER("SET_DIRECTION", session,


direction) GUID-C7C9B529-75D7-4112-B9D3-422F2F13E4D1 v1

Sets the search direction.

'session' Integer value returned by OPEN command.


'direction' Text keyword, either "FORWARD" or "BACKWARD".
"FORWARD" The query starts from the beginning of the time window.
"BACKWARD" The query starts from the end of the time window.
Value: List:
STATUS Integer value, SCIL status code.

The results of a query are returned in the order of 'direction': If "FORWARD", they are returned in
time order, if "BACKWARD", they are returned in reversed time order.

When a session is opened, the direction is set to "BACKWARD".

10.14.29 HISTORY_DATABASE_MANAGER("SET_TIMEOUT", session,


timeout) GUID-ADCB0145-F86C-4C9A-9673-3D6216170D9F v1

Sets the maximum time a query may last.

'session' Integer value returned by OPEN command.


'timeout' Integer or real value, time-out in seconds.
Value: List.
STATUS Integer value, SCIL status code.

The time-out of a query specifies the maximum time a query may last. If it is exceeded, the query is
interrupted and the partial results found so far are returned.

MicroSCADA X SYS600 10.5 245


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

When a session is opened, the time-out is set to 5 seconds.

10.14.30 HISTORY_DATABASE_MANAGER("SET_CONDITION", session,


condition) GUID-8AC32776-49BA-44D7-9F48-FC669C3785A5 v1

Sets the condition for requested events.

'session' Integer value returned by OPEN command.


'condition' Text value, the condition requested events should fulfil.
Value: List:
STATUS Integer value, SCIL status code.

The condition is given as in the APPLICATION_OBJECT_LIST function, see above.

When a session is opened, the condition is set to an empty string.

10.14.31 HISTORY_DATABASE_MANAGER("SET_ATTRIBUTES",
session, attributes) GUID-BB7D5D0A-F0FF-4E0F-8342-8FA9D5E2D8A8 v1

Sets the attributes whose values are to be returned by the query.

History database information related to each event are described in the Application Objects manual.

'session' Integer value returned by OPEN command.


'attributes' Text vector.
Specifies the set of attributes whose value is returned by the query.
Value: List:
STATUS Integer value, SCIL status code.

Any number of attributes may be specified.

Attributes LN, IX, OV, ET and EM do not have to specified, they are always included in the set. The
object type specific names (BI, BO, etc.) for the object value attribute are not used. If no application
is specified for the session, the user defined attributes of user defined process objects are not
returned by the query.

The initial value of the set is (LN, IX, OV, ET, EM).

The set may contain vendor attributes, i.e. attributes named by the caller and defined by SDDL (SCIL
Data Derivation Language). For example, "RT_STR = TIMEMS(RQ)" is a valid attribute definition,
which returns the formatted text representation of the registration time.

10.14.32 HISTORY_DATABASE_MANAGER("GET_PARAMETERS",
session) GUID-C86D3725-8882-4C12-A0C3-25301DA95C48 v1

Returns the current values of parameters.

'session' Integer value returned by OPEN command.


Value: List:
DIRECTORY Text vector, file directories to locate database files.
Table continues on next page

246 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

PERIOD Two place vector containing the first and last date of the period, see
SET_PERIOD command.
WINDOW Two place vector containing the beginning and end of the time
window, see SET_WINDOW,
ORDER "LOG" or "EVENT".
DIRECTION "FORWARD" or "BACKWARD".
TIMEOUT Real value, the query time-out in seconds.
ATTRIBUTES Text vector, the attributes returned by the query.
CONDITION Text value, the query condition.
STATUS Integer value, SCIL status code.

10.14.33 HISTORY_DATABASE_MANAGER("QUERY", session, count


[,start]) GUID-FA23A23D-572B-424E-9E2B-0CC05EACCED5 v2

Performs a history database query.

'session' Integer value returned by OPEN command.


'count' Integer value, the maximum number of events to be returned.
'start' Integer or vector value, the identifier of event to start the query at.
Integer value 0 restarts the query. Default is 0.
Value: List:
STATUS Integer value, SCIL status code.
SUCCESS Text value, indicating the success of the query:
"DONE" All the specified events were found.
"MORE" The number of events specified by 'count' were
found. There may be more events to find.
"TIMEOUT" The query took a too long time and was
interrupted. There may be more events to find.
COUNT Integer value, the number of the returned events.
LAST Vector value, the event identifier of the last processed event, or integer 0, if
no events processed.
ID Vector value containing the identifiers of the returned events.
DATA List value containing the attributes of the returned events.

To continue a query, the event id returned by the previous query (attribute LAST) should be used as
the argument 'start' of the subsequent query. The event identified by 'start' is not included in the
result.

The attribute DATA of the function result contains the event data read from the database as a list.
The attributes of the list are the ones specified by SET_ATTRIBUTES command. History database
information related to each event are described in the Application Objects manual. The value of each
attribute is a vector of length COUNT. If an event does not have a certain attribute, the corresponding
element in the vector has status PROF_ATTRIBUTE_DOES_NOT_EXIST. The list may be further
processed with SELECT function by the event list dialog, if needed.

When a query is interrupted by TIMEOUT and the query order is EVENT, it is not guaranteed that the
events returned by two subsequent queries are returned in exactly correct order. It is possible, that
events contained in database files not yet processed should have been included in the results of the
interrupted query.

MicroSCADA X SYS600 10.5 247


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

The event identifiers returned by a query are valid only during the current period setting.

The following example reads the latest 20 events, then waits a second and reads the new ones. For
clarity, error handling is omitted.

Example:

#LOCAL R, SESSION, FIRST, SECOND


R = HISTORY_DATABASE_MANAGER("OPEN")
SESSION = R.SESSION
R = HISTORY_DATABASE_MANAGER("SET_PERIOD", SESSION,-
PACK_TIME(1998,4,1,0,0,0),CLOCK)
FIRST = HISTORY_DATABASE_MANAGER("QUERY",SESSION,20)
#IF FIRST.COUNT > 0 #THEN #BLOCK
#PAUSE 1
R = HISTORY_DATABASE_MANAGER("SET_ORDER",SESSION,"FORWARD")
SECOND = HISTORY_DATABASE_MANAGER("QUERY",SESSION,100,FIRST.ID(1))
#BLOCK_END

The second query may miss a new event if its time-stamp is out of order.

10.14.34 HISTORY_DATABASE_MANAGER("READ", session, event) GUID-114D6F09-7983-421C-A16C-3381093BEC44 v1

Reads all the attributes of an event.

History database information related to each event are described in the Application Objects manual.

'session' Integer value returned by OPEN command.


'event' Vector value, the event identifier of the event.
Value: List:
DATA List value containing all the attributes of the event.
STATUS Integer value, SCIL status code.

10.14.35 HISTORY_DATABASE_MANAGER("SET_COMMENT", session,


event, comment) GUID-1163A357-4957-40F1-9EDB-68D2917E2329 v1

Sets the EX attribute of the specified event.

'session' Integer value returned by OPEN command.


'event' Vector value, the event identifier of the event.
'comment' Text value, the comment.
Value: List:
STATUS Integer value, SCIL status code.

10.14.36 HISTORY_DATABASE_MANAGER("WRITE", session, data) GUID-1B8A16F9-9F12-44E3-B3E0-6AB07F32C0CE v1

Writes an event into the history database.

248 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'data' List value describing all the attributes of one event.


'session' Integer value returned by OPEN command.
Value: List.
STATUS Integer value, SCIL status code.

This command writes an event into the history database. The attribute values to be written are given
in the list argument 'data'.

Attribute HT is used to specify the history database file, into which the event is written. The file is
created if it does not exist.

The following conventions are used to handle missing attributes:

1. Current time is used for missing HT, HM, HD and HQ.


2. HT, HM, HD and HQ values are used for missing ET, EM, ED and EQ.
3. All other missing numeric attributes are set to zero.
4. All missing text attributes are set empty.

10.14.37 GENERATE_HISTORY_EVENT(LN, IX, MT, DATA) GUID-3458A6AD-95D8-4275-9730-B8301E00933E v1

Generates an event into the history database.

The functionality is similar to the HISTORY_DATABASE_MANAGER "WRITE" command, but it


allows to directly specify the event message text.

'LN' Text, the logical name of the process object.


'IX' Integer, the process object index.
'MX' Text, the event message texts.
'DATA' List, value describing all the attributes of one event.
Value: List.
STATUS Integer value, SCIL status code.

The attribute values to be written are given in the list argument 'data'. For details about command
parameters, see Section 10.14.36.

Example:

GENERATE_HISTORY_EVENT("DATA", 1, "My Event Text", LIST(CA="FI", ET =


CLOCK, EM = 123))

10.14.38 Name hierarchy function GUID-244D9B67-0343-4A21-AE2F-0A7768D6FE94 v1

The NAME_HIERARCHY function is used in database tools to create a tree view of process objects
according to various naming attributes.

10.14.39 NAME_HIERARCHY(names, order, syntax [, arg4 [, arg5]]) GUID-E269D086-8500-4B2C-BA73-43E09B542089 v2

Constructs the tree hierarchy formed by given fully qualified hierarchical names.

MicroSCADA X SYS600 10.5 249


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'names' A text vector, the fully qualified hierarchical names


'order' A text keyword specifying the order of branches and leaves in the result tree:
"SEPARATE" Branch and leaf names are reported as separate text
vectors.
"INTERLEAVED" Branch and leaf names are reported in one text vector, in
alphabetical order.
'syntax' A text value specifying the syntax of given names:
"OI" The names are object identifiers (OI attribute values) of
process objects.
"ON" The names are OPC item names (ON attribute values) of
process objects.
"ES" The names are OPC event source names (ES attribute
values) of process objects.
any other text The characters which are used as field delimiters of the
given hierarchical names, for example "/.".
'arg4' Additional argument depending on the value of 'syntax':
When "OI": An integer vector up to 5 elements which specifies the
lengths of the fields of an object identifier.
When "ON": Not allowed
When "ES": The number of the application whose delimiter definitions
are applied. This argument is optional: If omitted (or
given as 0), current application is assumed. The
application must be a local one. Note that the ES
delimiters are defined in the OP attribute of the
application.
'arg4' and 'arg5' Optional text keyword arguments, which are used only when 'syntax' is not any of the
predefined syntaxes:
"CASE_SENSITIVE"
The given names are case-sensitive. This is the default
value and the value implicitly used by all predefined
syntaxes.
"CASE_INSENSITIVE"
The given names are case-insensitive.
"ALLOW_DUPLICATES"
Duplicate names are allowed. This is the value implicitly
used by syntaxes "OI" and "ES".
"NO_DUPLICATES"
Duplicate names are flagged as errors. This is the default
value and the value implicitly used by the "ON" syntax.
Value: A list value containing two attributes:
ROOT A node descriptor describing the root node of the tree.
The structure of the node descriptor depends on the
value of the 'order' argument, see below.
ERRORS An integer vector containing the indexes of the erroneous
names in the argument vector 'names'.
A node descriptor for the order "SEPARATE" is a list of following attributes:
BRANCH_COUNT The number of branch nodes contained in the node.
BRANCH_NAMES A text vector, the names of the branches in alphabetical
order. Omitted if BRANCH_COUNT is 0.
BRANCHES A list vector of length BRANCH_COUNT, the node
descriptors of the branches. Omitted if
BRANCH_COUNT is 0.
Table continues on next page

250 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

LEAF_COUNT The number of leaf names contained in the node. If


duplicates are allowed, the number of leaves may be
higher than this.
LEAF_NAMES A text vector, the leaf names in alphabetical order.
Omitted if LEAF_COUNT is 0.
LEAF_INDEXES If duplicates are not allowed, the value is an integer
vector listing the indexes of leaves in the ’names’ vector.
If duplicates are allowed, the value is a vector of vectors.
Each element vector lists the indexes of leaves in
the ’names’ vector that share the name. Omitted if
LEAF_COUNT is 0.
A node descriptor for the order "INTERLEAVED" is a list of following attributes:
COUNT The number of node names contained in the node.
NAMES A text vector, the node names in alphabetical order.
ROLES A text vector containing the role of each node name:
"BRANCH", "LEAF" or "BOTH".
BRANCHES A list vector of length COUNT, the node descriptors of
the branch nodes. If there are no branches, the attribute
is omitted. Valid for roles "BRANCH" and "BOTH".
INDEXES If duplicates are not allowed, the value is an integer
vector listing the indexes of leaves in the 'names' vector.
If duplicates are allowed, the value is a vector of vectors.
Each element vector lists the indexes of leaves in the
'names' vector that share the name. Valid for roles
"LEAF" and "BOTH". If there are no leaves, the attribute
is omitted.

Example 1:

Syntax "ON", order "SEPARATE". The delimiter is dot, duplicates are not allowed.

#LOCAL NAMES = VECTOR("a.b.d", "a.b.c", "a.b", "e.f", "a.b.c")


#LOCAL TREE
TREE = NAME_HIERARCHY(NAMES, "SEPARATE", "ON")
; The value of the variable TREE is now:
; List 2
; ROOT List 4
; BRANCH_COUNT 2
; BRANCH_NAMES Vector 2
; (1) "a"
; (2) "e"
; BRANCHES Vector 2
; (1) List 6
; BRANCH_COUNT 1
; BRANCH_NAMES Vector 1
; (1) "b"
; BRANCHES Vector 1
; (1) List 4
; BRANCH_COUNT 0
; LEAF_COUNT 2
; LEAF_NAMES Vector 2
; (1) "c"
; (2) "d"
; LEAF_INDEXES Vector 2
; (1) 2
; (2) 1
; LEAF_COUNT 1
; LEAF_NAMES Vector 1
; (1) "b" ; "b" is both a leaf and a branch
; LEAF_INDEXES Vector 1
; (1) 3
; (2) List 4
; BRANCH_COUNT 0

MicroSCADA X SYS600 10.5 251


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

; LEAF_COUNT 1
; LEAF_NAMES Vector 1
; (1) "f"
; LEAF_INDEXES Vector 1
; (1) 4
; LEAF_COUNT 0
; ERRORS Vector 1
; (1) 5 ;The 5th name "a.b.c" is a duplicate

Example 2:

Syntax "ON", order "INTERLEAVED". The delimiter is dot, duplicates are not allowed. The same data
as in Example 1.

#LOCAL NAMES = VECTOR("a.b.d", "a.b.c", "a.b", "e.f", "a.b.c")


#LOCAL TREE
TREE = NAME_HIERARCHY(NAMES, "INTERLEAVED", "ON")
; The value of the variable TREE is now:
; List 2
; ROOT List 4
; COUNT 2
; NAMES Vector 2
;(1) "a"
;(2) "e"
; ROLES Vector 2
;(1) "BRANCH"
;(2) "BRANCH"
; BRANCHES Vector 2
;(1) List 5
; COUNT 1
; NAMES Vector 1
; (1) "b"
; ROLES Vector 1
; (1) "BOTH"
; BRANCHES Vector 1
; (1) List 4
; COUNT 2
; NAMES Vector 2
;(1) "c"
;(2) "d"
; ROLES Vector 2
;(1) "LEAF"
;(2) "LEAF"
; INDEXES Vector 2
;(1) 2
;(2) 1
; INDEXES Vector 1
; (1) 3
; (2) List 4
; COUNT 1
; NAMES Vector 1
; (1) "f"
; ROLES Vector 1
; (1) "LEAF"
; INDEXES Vector 1
; (1) 4
; ERRORS Vector 1
; (1) 5 ;The 5th name "a.b.c" is a duplicate

Example 3:

Syntax "OI", order "SEPARATE". Duplicates are allowed.

#LOCAL NAMES = VECTOR("Elgarose Transformer Q91",-


"Elgarose Coles Valley Q1",-
"Eastwick Incoming 110kV Q0",-
"Elgarose Transformer Q91")

252 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

#LOCAL SV15 = APL:BSV15


#LOCAL OI = SV15.PROCESS_OBJECTS.OI
#LOCAL TREE
TREE = NAME_HIERARCHY(NAMES, "SEPARATE", "OI",-
VECTOR(OI.LENGTH1, OI.LENGTH2,OI.LENGTH3))
;The value of the variable TREE is now:
;List 2
; ROOT List 4
; BRANCH_COUNT 2
; BRANCH_NAMES Vector 2
; (1) "Eastwick"
; (2) "Elgarose"
; BRANCHES Vector 2
; (1) List 4
; BRANCH_COUNT 1
; BRANCH_NAMES Vector 1
; (1) "Incoming 110kV"
; BRANCHES Vector 1
; (1) List 4
; BRANCH_COUNT 0
; LEAF_COUNT 1
; LEAF_NAMES Vector 1
; (1) "Q0"
; LEAF_INDEXES Vector 1
; (1) Vector 1
; (1) 3
; LEAF_COUNT 0
; (2)List 4
; BRANCH_COUNT 2
; BRANCH_NAMES Vector 2
; (1) "Coles Valley"
; (2) "Transformer"
; BRANCHES Vector 2
; (1) List 4
; BRANCH_COUNT 0
; LEAF_COUNT 1
; LEAF_NAMES Vector 1
; (1) "Q1"
; LEAF_INDEXES Vector 1
; (1) Vector 1
; (1) 2
; (2) List 4
; BRANCH_COUNT 0
; LEAF_COUNT 1
; LEAF_NAMES Vector 1
; (1) "Q91"
; LEAF_INDEXES Vector 2
; (1) Vector 1
; (1) 1
; (2) 4
; LEAF_COUNT 0
; LEAF_COUNT 0
; ERRORS Vector 0

10.14.40 Mapping functions GUID-3FD21613-5568-40B2-92BE-5430117762DF v1

Mapping functions map the logical APL, PRI and STA numbers used by application SCIL programs to
corresponding physical (base system) object numbers, and vice versa.

10.14.41 LOGICAL_MAPPING(otype, number [, apl]) GUID-31312142-B616-4A38-86CD-A6AF29A0BEFC v1

Maps physical (base system) object numbers to logical object numbers.

MicroSCADA X SYS600 10.5 253


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'otype' A text keyword, the object type


"APL" Application object
"PRI" Printer object
"STA" Station object
'number' An integer or integer vector, the physical number(s)
'apl' An integer, the application where the mapping is done. Optional, default = 0 (current
application). External applications are supported.
Value: A list with the following attributes:
STATUS SCIL status code, 0 = OK
MAPPING Integer vector containing the logical object numbers corresponding to given
physical numbers.

The function uses the mapping attributes AP, PR and ST of the application object to do the mapping.
In the resulting value, a zero is returned for each physical object that does not have a logical
mapping in the application.

Example:

#SET APL:BST(1) = 101


#SET APL:BST(2) = 102
#SET APL:BST(3) = 103
STAS = (1, 101, 103)
UNITS = LOGICAL_MAPPING("STA", STAS))
; UNITS now equals to VECTOR(0, 1, 3)

10.14.42 PHYSICAL_MAPPING(otype, number [, apl]) GUID-AFE31B86-D5FB-4C47-ADEA-2F5074488A74 v1

Maps logical object numbers to physical (base system) object numbers.

'otype' A text keyword, the object type


"APL" Application object
"PRI" Printer object
"STA" Station object (unit)
'number' An integer or integer vector, the logical number(s)
'apl' An integer, the application where the mapping is done. Optional, default = 0 (current
application). External applications are supported.
Value: A list with the following attributes:
STATUS SCIL status code, 0 = OK
MAPPING Integer vector containing the physical object numbers corresponding to
given logical numbers.

The function uses the mapping attributes AP, PR and ST of the application object to do the mapping.
In the resulting value, a zero is returned for each logical object that does not map to any physical
object.

Example:

#SET APL:BST(1) = 101


#SET APL:BST(2) = 102
#SET APL:BST(3) = 103
UNITS = (3, 1)
STAS = PHYSICAL_MAPPING("STA", UNITS)
; STAS now equals to VECTOR(103, 101)

254 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.15 Network Topology Functions GUID-3ACC5E9F-1157-4B26-ADE8-24F3FF3BB90A v1

10.15.1 NETWORK_TOPOLOGY_MANAGER(subfunction [, arg]* [, apl]) GUID-487267A8-E03F-4121-BAEF-95AE4A7D5F67 v1

Manages the network topology functionality of an application.

'subfunction' Text keyword, the requested subfunction. The subfunctions are described in detail below.
'arg' Up to 2 subfunction specific arguments.
'apl' Integer, 0 ... 250. The logical application number. 0 = the own application. External
applications are supported. Optional, default value is 0.
Value: List:
STATUS Integer value, SCIL status code.
Subfunction specific return attributes.

In the following subfunction descriptions, the optional argument 'apl' is not repeated.

10.15.2 NETWORK_TOPOLOGY_MANAGER("SCHEMAS") GUID-418BFCFA-CB5D-432C-8AAB-7A4DC08EB6DC v1

Lists the supported network topology schemas.

Value: List:
STATUS Integer value, SCIL status code.
SCHEMAS Text vector, names of supported schemas. Currently, only the POWER
schema is supported.

10.15.3 NETWORK_TOPOLOGY_MANAGER("SCHEMA", schema) GUID-E0EB5032-3A29-4997-A66A-9D0B8C717403 v1

Returns information about a schema.

'schema' Text, the name of the schema.


Value: List:
STATUS Integer value, SCIL status code.
NAME Text, the name of the schema.
NT Text vector, the text identifiers used to localize the descriptions of numeric
NT (Network Object State) attribute values.
NS Text vector, the text identifiers used to localize the descriptions of numeric
NS (Network Object Subtype) attribute values.
LP Text vector, the text identifiers used to localize the descriptions of numeric
LP (Loop State) attribute values.

10.15.4 NETWORK_TOPOLOGY_MANAGER("LEVELS", schema) GUID-EF413FB4-7630-4621-8AC4-B8BD879CE780 v1

Lists the application specific (voltage) levels of the schema.

MicroSCADA X SYS600 10.5 255


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'schema' Text, the name of the schema.


Value: List:
STATUS Integer value, SCIL status code.
LV Real vector, the nominal (voltage) levels.
MAX Real vector. Each MAX(i) defines the maximum level value (voltage) that is
considered to belong to level i.

10.15.5 NETWORK_TOPOLOGY_MANAGER("SET_LEVELS", schema,


levels) GUID-7A374CAB-0FC2-4E55-BED1-2F37F352B17E v1

Sets the application specific (voltage) levels of the schema.

'schema' Text, the name of the schema.


'levels' List:
LV Real vector, the nominal (voltage) level values.
MAX Real vector. Each MAX(i) defines the maximum level value (voltage) that is
considered to belong to level i.
Value: List:
STATUS Integer value, SCIL status code.

10.15.6 NETWORK_TOPOLOGY_MANAGER("MODELS") GUID-C3B52ECE-E253-417F-B711-A04BC96B15DE v1

Lists the imported network topology models of the application.

Value: List:
STATUS Integer value, SCIL status code.
MODELS Text vector, names of imported models.

10.15.7 NETWORK_TOPOLOGY_MANAGER("MODEL", model) GUID-1D598E7E-6722-4A88-9B08-F7938BDAB5AC v1

Returns information about a model.

'model' Text, the name of the model.


Value: List:
STATUS Integer value, SCIL status code.
NAME Text, the name of the model.
SCHEMA Text, the schema of the model.
GENERATOR Text, the name of the tool that generated the model.
GENERATED_BY Name of the user who generated the model.
GENERATION_DATE Time, the generation date of the model.
BUILT_FROM Text vector, the names of process displays used to
generate the model.
VERSION Integer, the version number of the model format.
COMMENT Text, any comment added by the generator of the model.
IMPORTED_BY Name of the user who imported the model.
IMPORT_DATE Time, the import date and time.
RUNNING Boolean. See subfunctions START/STOP.

256 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.15.8 NETWORK_TOPOLOGY_MANAGER("START", model),


NETWORK_TOPOLOGY_MANAGER("STOP", model) GUID-8C15D193-25E9-4AC6-9A6E-A6571D2CA595 v1

Starts/stops calculation of a model.

'model' Text, the name of the model.


Value: List:
STATUS Integer value, SCIL status code.

10.15.9 NETWORK_TOPOLOGY_MANAGER("VALIDATE", modeldata) GUID-428DA705-2410-494D-8DB5-3379041F7965 v1

Validates a model.

'modeldata' List, the complete description of the model in internal format.


Value: List:
STATUS Integer value, SCIL status code. If the model is not valid, the status is
2801 (TOPO_MODEL_CONTAINS_ERRORS)
ERRORS Vector, descriptions of found errors
WARNINGS Vector, descriptions of warnings

10.15.10 NETWORK_TOPOLOGY_MANAGER("IMPORT", modeldata) GUID-C177ECB7-9B3D-44E8-B438-31DE21AD4CDF v1

Imports a new model or updates an existing model.

'modeldata' List, the complete description of the model in internal format.


Value: List:
STATUS Integer value, SCIL status code. If the model is not valid, the status is 2801
(TOPO_MODEL_CONTAINS_ERRORS)

An existing model must be stopped before it can be re-imported.

10.15.11 NETWORK_TOPOLOGY_MANAGER("EXPORT", model) GUID-E416959C-F619-4FD9-A466-7AA0CF0DC2E1 v1

Exports a model from the application

'model' Text, the name of the model.


Value: List:
STATUS Integer value, SCIL status code.
MODEL List, the complete description of the model in internal format.

10.15.12 NETWORK_TOPOLOGY_MANAGER("DELETE", model) GUID-0D4EA33E-B4FA-49F4-A524-990483BDD2E1 v1

Deletes a model from the application.

'model' Text, the name of the model.


Value: List:
STATUS Integer value, SCIL status code.

A model must be stopped before it can be deleted.

MicroSCADA X SYS600 10.5 257


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.16 File handling functions GUID-10DDC025-0801-48CC-AF54-11FD354EDA7C v1

10.16.1 DATA_MANAGER(function [,argument]*) GUID-9ED143FA-4BDB-4350-9578-88BC8F333928 v1

SCIL database management.

'function' A text keyword, the subfunction to be performed


'argument' A subfunction specific list of other arguments
Value: A list always containing the attribute:
STATUS Integer value, SCIL status code.
Other subfunction specific attributes may be returned.

The structure and properties of SCIL databases are described in Section 6.6.

Each subfunction is described in detail below.

10.16.2 DATA_MANAGER("CREATE", file) GUID-6E8E872F-46ED-4A0F-B026-5DDD7845778D v1

Creates a new SCIL database and opens it for use.

'file' A text or byte string value, the name or tag of the file to be created. Extension SDB is
recommended.
Value: A list with attributes:
STATUS An integer, the SCIL status code
HANDLE An integer, a handle to the file to be used in subsequent calls of the
function
Up to 10 databases may be concurrently open within a SCIL context.
VERSION Integer 2 or 3, the version of the file format

10.16.3 DATA_MANAGER("OPEN", file) GUID-A28A1966-BB7B-45AB-BCF7-6E74B996DA10 v1

Opens an existing SCIL database.

'file' A text or byte string value, the name or tag of the file to be opened
Value: A list with attributes:
STATUS An integer, the SCIL status code
HANDLE An integer, a handle to the file to be used in subsequent calls of the
function
Up to 10 databases may be concurrently open within a SCIL context.
VERSION Integer 2 or 3, the version of the file format

10.16.4 DATA_MANAGER("COPY", handle, new_file [, version]) GUID-50F92C1C-6866-480D-886D-6B1D7B6BFE3D v1

Makes a copy of an open SCIL database into another file.

'handle' An integer, a handle to the source file


'new_file' A text or byte string value, the name or tag of the new file
'version' Integer value 2, 3 or 0
Table continues on next page

258 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Default value 0 (the newest version, currently equal to 3)


Value: A list with attributes:
STATUS An integer, the SCIL status code
FAILED A text vector, the names of the sections that could not be copied

For compatibility, this function may be used to convert an old (Rev. 8.4.5) version 2 database to the
new (Rev. 9.0) version 3 format for faster access, or vice versa.

10.16.5 DATA_MANAGER("CLOSE", handle) GUID-8C3583A5-4DDA-4470-A117-4300DB850DFC v1

Closes a SCIL database when no longer used.

'handle' An integer, a handle to the file


Value: A list with one attribute:
STATUS An integer, the SCIL status code

If a SCIL program does not close the file, it is automatically closed when the SCIL context of the
program is destroyed.

10.16.6 DATA_MANAGER("LIST_SECTIONS", handle) GUID-36315823-5F91-4287-AC4B-3CA7D8DDE580 v1

Lists the sections of a SCIL database in alphabetic order.

'handle' An integer, a handle to the file


Value: A list with attributes:
STATUS An integer, the SCIL status code
SECTIONS A text vector, the section names

10.16.7 DATA_MANAGER("CREATE_SECTION", handle, section) GUID-8ECB6E11-051D-4BDF-A429-B52DFF3B565B v1

Creates a new (empty) section in a SCIL database.

'handle' An integer, the handle to the file


'section' A text value, the name of the section
Value: A list with one attribute:
STATUS An integer, the SCIL status code

The value of the newly created section is an empty list.

10.16.8 DATA_MANAGER("DELETE_SECTION", handle, section) GUID-08E5D064-0453-4663-B545-96A084152854 v1

Deletes a section, both the name and the contents, from SCIL database.

'handle' An integer, the handle to the file


'section' A text value, the name of the section
Value: A list with one attribute:
STATUS An integer, the SCIL status code

MicroSCADA X SYS600 10.5 259


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.16.9 DATA_MANAGER("GET", handle, section [,component]*) GUID-1305FF4B-8ED4-4492-9024-B71BD214150D v1

Reads data from SCIL database.

'handle' An integer, the handle to the file


'section' A text value, the name of the section
'component' A text, an integer or a vector value, the component to be read
Up to 5 'component' arguments may be given
Value: A list with attributes:
STATUS An integer, the SCIL status code
VALUE Any type, the value read from the file

If no 'component' is specified, the entire section is read. The components, i.e. attributes of lists and
indices or index ranges of vectors, are given in SCIL language syntax. Examples of valid component
descriptions:

"ABC" Attribute ABC


"(5)" or 5 The 5th element of a vector
"(1 .. 10)" or (1,10) 10 first elements of a vector
"(3 .. )" or (3,0) The elements from the 3rd one to the last one
"ABC(2).DEF" Attribute DEF of the second element of a (vector type) attribute ABC

The component description may be given as several arguments as well. The following examples are
equivalent to the last example above.

"ABC", "(2)", "DEF"

"ABC", 2, "DEF"

Note, that only one component is read even if more than one 'component' arguments are given.
These arguments are combined to locate the component deep in the SCIL data structure.

10.16.10 DATA_MANAGER("PUT", handle, section, data [,component]*) GUID-55E30D04-4CB2-443F-9396-A0F65986D2FF v1

Writes data to SCIL database.

'handle' An integer, the handle to the file


'section' A text value, the name of the section
'data' Any value, the data to be written
'component' A text, an integer or a vector value, the component to be written
Up to 5 'component' arguments may be given.
Value: A list with one attribute:
STATUS An integer, the SCIL status code

If no 'component' is specified, the entire section is written. See subfunction "GET" for description of
'component's.

If the specified component (attribute or vector element) does not exist in the database, it is created.

260 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.16.11 DATA_MANAGER("DELETE", handle, section, [,component]*) GUID-D18C3E2E-C464-4F35-BC58-8C6C0D1C61D1 v1

Deletes a component from a SCIL database.

'handle' An integer, the handle to the file


'section' A text value, the name of the section
'component' A text, an integer or a vector value, the component to be deleted
Up to 5 'component's may be given.
Value: A list with one attribute:
STATUS An integer, the SCIL status code

If no 'component' is specified, the entire content (but not the name) of the section is deleted. See
subfunction "GET" for description of components.

If the specified component is an attribute, it is deleted from its containing list.

If the specified component is an element of a vector, the element is deleted. The length of the vector
will thus decrement by one.

If the specified component is a range of vector elements, the elements are deleted. The length of the
vector will thus decrement by the number of deleted elements.

10.16.12 DELETE_PARAMETER(file, section [,key]) GUID-1903A35E-C0D8-4319-A8EF-E805A81CB3B7 v1

Deletes a parameter from a parameter file.

'file' Text or byte string (file tag). The name of the parameter file. See Section 6.5.1 for file naming.
'section' Text. The name of the section.
'key' Text. The key of the parameter to deleted. If 'key' is omitted from the argument list, the whole
section is deleted.
Value: A list with one attribute:
STATUS An integer, the SCIL status code

The parameter files are described in Section 6.5.2.

See also functions READ_PARAMETER and WRITE_PARAMETER.

10.16.13 FILE_LOCK_MANAGER(function, file) GUID-9B2B40C2-BC79-44C1-8A4F-49CF651536AD v1

Locks and unlocks files.

This function is used to temporarily lock a file for use of only one SCIL context. This function is
mainly needed by tools (such as Dialog Editor) to prevent simultaneous modification of same data by
two users. All the SCIL tools accessing the file should use FILE_LOCK_MANAGER to synchronize
the access to the file, locking a file with FILE_LOCK_MANAGER does not prevent accessing of the
file by READ_TEXT, WRITE_TEXT or other SCIL functions.

'function' Text value, the function to be performed:


"LOCK" Lock the file for exclusive use.
"UNLOCK" Unlock the file.
"BREAK" Break the lock.
Table continues on next page

MicroSCADA X SYS600 10.5 261


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'file' Text value containing the name of the file to be locked in OS dependent format (see
PARSE_FILE_NAME function to obtain OS file names).
Value: A text value containing:
"OK" Function successfully performed.
"LOCKED" LOCK failed because of an existing lock.
"BROKEN" UNLOCK detected that the file was not locked, i.e. broken by somebody
else.
"INVALID" The 'file' argument is invalid. This means that the name is not a valid file
name or the directory in the name does not exist or the access to it is
denied.

Notes:

• The file does not have to exist, actually 'file' argument is used as a unique identifier of the lock.
The argument is used a seed for a lock file name, which is generated by prefixing the file name
in 'file' by "_L_". For example, if 'file' is "C:\DATA\ABC.DAT", then the lock file name used is
"C:\DATA\_L_ABC.DAT". Therefore, the file name should not be extremely long.
• Two different 'file' arguments may refer to one and same lock. For example, if a logical drive K
points to directory "C:\DATA", then 'file' arguments "C:\DATA\ABC.DAT" and "K:\ABC.DAT"
denote the same lock.
• When a SCIL context is destroyed, all the locks it holds are automatically released by the base
system software.
• The function "BREAK" should be used with care. It should be used only after a program crash or
other such failure which has left the file locked.

10.16.14 KEYED_FILE_MANAGER(function, file [,output_file [,key_size]


[,version]]) GUID-A12619B1-7630-4871-BE8E-FC6CC9CF1F31 v2

File maintenance function.

'function' Text: "INFORMATION", "COMPACT", or "REBUILD". The operation to be performed on the


file (see below):
'file' Text or byte string (file tag). The input file name. See Section 6.5.1 for file naming.
'output_file' Text or byte string (file tag). The output file name (functions COMPACT and REBUILD only).
See Section 6.5.1 for file naming.
'key_size' Integer value, the size of the record key (function REBUILD only).
'version' Integer value 1 or 2, the version number of the output file format (functions COMPACT and
REBUILD only). Default value is the version of the input file. The maximum size of version 1
files is 32 MB. Version 2 files, introduced in MicroSCADA rev. 8.4.4, do not have such a
restriction.
Value: List value containing various information depending on the function argument.
The 'function' value "INFORMATION" returns the following attributes in the result list:
STATUS The status of the operation.
VERSION The file format version number, currently 1 or 2.
USED_BLOCKS Number of 512-byte blocks (version 1 files) or 4096-byte blocks
(version 2 files) allocated for the file.
KEY_SIZE The length of the record key.
INDEX_LEVELS The number of index levels used by the index tree of the file.
The attributes VERSION, USED_BLOCKS and INDEX_LEVELS are present only if STATUS
= 0.
Table continues on next page

262 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

The 'function' value "COMPACT" returns the same attributes as the 'function' value
"INFORMATION" (the values are those before the compacting) and in addition the following
attribute:
RECORDS Number of records copied.
The 'function' value "REBUILD" returns the same attributes as the 'function' value
"COMPACT" and in addition the following attribute:
DUPLICATES A text vector containing the key values that were found
duplicated in the source file. The corresponding records in the
output file may contain obsolete or otherwise bad data, they
should be checked. Max. 1000 duplicate keys are reported.
If the status block of the file was corrupted, attributes VERSION, USED_BLOCKS and
INDEX_LEVELS are not returned.

This function converts SYS600 keyed files from a format to another, saves corrupted files and does
some other file maintenance. It can handle one file at a time, the 'file' argument, and provides the
following operations selected by the 'function' argument:

"INFORMATION" Returns some information of the file.


"COMPACT" Compacts the file by rewriting the records in their key order. After the compacting, the file is
smaller and faster to access. The off-line program REORG was previously used for this
purpose.
"REBUILD" Reconstructs the file by scanning and rewriting the data blocks of the file, ignoring the index
blocks. This function should be used if the internal structure of the file is corrupted, for
example if status 5015 (FILE_INCONSISTENT) is returned when the file is accessed. The file
may not be used by SYS600 when this function is performed.
The optional argument 'key_size' overrides the key size read from the status block of the file.
It should be used only if the status block of the file is corrupted. The corruption is indicated by
status code 5016 (FILE_INVALID_KEY_SIZE) when attempting this function without the
key_size argument, or the same status code when trying to access the output file generated
by this function without the key_size argument.
The correct value of this argument is obtained by applying the "INFORMATION" function to
an uncorrupted file of the same type.

See Section 6.5.4 for more information about keyed files.

Example:

@RESULT = KEYED_FILE_MANAGER("COMPACT",-
"/APL/TIPPERARY/APL_/APL_PROCES.PRD",-
"/APL/TIPPERARY/APL_V2/APL_PROCES.PRD",-
2)
; Converts the process database of application TIPPERARY to file format 2.

10.16.15 PARSE_FILE_NAME(name [,file]) GUID-34ABE74B-3940-46F4-B743-7D792C6AEA77 v2

Converts SCIL path names and file names to operating system file names.

'name' Text value: directory or path name, either


1) SCIL path name, for example, "PICT"
2) SCIL directory name, for example, "/APL/TEST/PICT" or "PICT/"
3) OS dependent directory name, for example, "C:\SC\APL\TEST\PICT"
'file' Text value: optional file name, for example, "station.pic"
Value: Text value containing the path name of the file (or directory) in OS dependent format, for
example, "C:\SC\APL\TEST\PICT\STATION.PIC" (or "C:\SC\APL\TEST\PICT"). Returns "", if
there is an error in arguments.

Notes:

MicroSCADA X SYS600 10.5 263


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

• The directory name in SCIL format may be given with or without the trailing "/" (see however
note 3).
• The OS dependent directory name may be given with or without the trailing OS dependent
delimiter (for example, "\").
• In SCIL, depending on the context, "PICT" may mean either the path PICT or the directory
"/APL/xxx/PICT". To resolve the ambiguity, "PICT" is used for the path and "PICT/" for the
directory.
• If a path name is given as 'name' and file is not given, the function returns the first directory in
the path.
• If a path name is given as 'name' and 'file' exists, the complete file path name of the found file is
returned.
• If a path name is given as 'name' and 'file' does not exist, the returned path name contains the
first directory of the logical path, i.e. the returned value is the complete would-be name of the file
if created.
• The arguments of the function are case-insensitive. The case of the returned value is OS
dependent. In NT, upper case string is returned.

10.16.16 PATH(name) GUID-83D5FE3F-DFE4-408A-AE4E-DA98D76E91FA v1

The directories contained in a logical path.

'name' Text expression, the name of a logical path.


Value: Text vector containing the names (in an operating system dependent format) of
directories that make up the logical path.

See #PATH command in Section 9.2.4 for details of logical paths.

10.16.17 PATHS(level) GUID-9FBB74C4-62DD-4CAF-A681-CAE7A21CFE26 v2

The logical paths defined on a specified level.

'level' Integer value 0 to 3 specifying the requested level in path hierarchy:


0 System paths
1 Application paths
2 Process specific paths (for example, monitor paths)
3 Temporary paths
Value: Text vector containing the names of the defined logical paths on the requested level.

See #PATH command in Section 9.2.4 for details of logical paths.

10.16.18 READ_BYTES(file [,start [,length]]) GUID-76746B03-6C42-4858-B50B-F2E06AE1AD15 v1

Reads a binary file.

'file' Text or byte string (file tag). The name of the file. See Section 6.5.1 for file naming.
'start' Positive integer value, defaults to 1. Specifies the byte position within the file where to
start reading.
'length' Non-negative integer value. Specifies the maximum number of bytes to be read.
Default value = 8 388 600 (max. byte string length).
Return value: Byte string containing the read data.

264 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Using this function any file may be read as a sequential binary file, i.e. an unstructured string of
bytes. It is usually used to import data generated by some external application or to read a compiled
SCIL program from a file

See also function WRITE_BYTES.

10.16.19 READ_COLUMNS(file, pos, width [,start [,count]]) GUID-ACE9B299-0F71-4E36-81F7-2BD22432ECEA v1

Reads a text file as columns.

The function reads a text file as columns and stores them in a vector where each element is a text
vector containing the text of one column.

'file' Text or byte string (file tag). The name of the file. See Section 6.5.1 for file naming.
'pos' Integer vector. Specifies the start positions of the columns to be read (1 ... 65 535). The
positions do not have to be in ascending order.
'width' Integer vector. The 'width' argument must be of the same length as the 'pos' argument.
Specifies the column widths (1 ... 65 535). The columns are allowed to overlap.
'start' Positive integer value, defaults to 1. Specifies the line number within the file where to
start reading.
'count' Non-negative integer value, defaults to 10 000. Specifies the maximum number of lines
to be read.
Value: A vector of the same length as 'pos' and 'width'. Each element of the vector is a text
vector containing the text of one column.

The function supports Unicode files, UTF-8 and UTF-16 Byte Order Marks (BOM's) are recognized.

See also function WRITE_COLUMNS.

10.16.20 READ_PARAMETER(file, section, key [,default]) GUID-13D121A7-0D60-4A57-9CD2-45D51D22B0E1 v1

Reads a parameter from a parameter file.

'file' Text or byte string (file tag). The name of the parameter file. See Section 6.5.1 for file naming.
'section' Text. The name of the section.
'key' Text. The key of the parameter.
'default' Text. The value to be returned if 'section' or 'key' does not exist in the specified file.
Value: A list with the following two attributes:
STATUS The status code of the read operation.
VALUE The value of the parameter. Returned only if STATUS = 0.

The parameter files are described in Section 6.5.2.

If the given section or key does not exist, error code SCIL_SECTION_DOES_NOT_EXIST or
SCIL_KEY_DOES_NOT_EXIST is returned in the STATUS attribute.

See also functions WRITE_PARAMETER and DELETE_PARAMETER.

Example:

#LOCAL PORT = READ_PARAMETER("C:\WINNT\WIN.INI","MCILAU","UDP PORT")

MicroSCADA X SYS600 10.5 265


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.16.21 READ_TEXT(file [,start [,number]]) GUID-E239882D-5B0B-45F0-844D-5DFE627F104D v2

Reads a text file.

'file' Text or byte string (file tag). The file name. See Section 6.5.1 for file naming.
'start' Positive or negative integer. If positive, it is the number of the first line to be read from
the text file counted from the beginning of the file (1 = the first line). If negative, it is the
number of the last line to be read counted from the end of the file (-1 = the last line).
Default: 1.
'number' Integer, 0 ... 1 000 000. The number of lines to be read from the file.
0 = nothing is read. Default: 1000.
Value: A text vector containing the lines read from the file.

If 'start' is omitted, reading starts from the beginning of the file. If 'number' is omitted, reading is
performed to the end of file, or until 1000 lines have been read.

The function supports Unicode files, UTF-8 and UTF-16 Byte Order Marks (BOM's) are recognized.

See also function WRITE_TEXT.

For compatibility reasons, this function does not support lines longer than 255 characters.
Longer lines are silently truncated to 255 characters. This function is now more or less
obsolete, use the function TEXT_READ instead.

Example:

!SHOW DIRECTIVE READ_TEXT("DIRECTIVE.TXT")


;The contents of the file DIRECTIVE.TXT are shown in the window DIRECTIVE.

#LOCAL ABC = LIST(IU = 1,-


IN = READ_TEXT("ABC.TXT"))
#CREATE ABC:C = ABC
;Command procedure ABC is created. Its SCIL program is read from a file.

READ_TEXT("FILE", -1, 100) ;reads the last 100 lines


READ_TEXT("FILE", -101, 100) ;reads the preceding 100 lines.

10.16.22 REP_LIB(name) GUID-3612BF01-C74B-4CB0-9CB8-ADE24304B87D v1

The files contained in a logical representation library.

'name' Text expression, the name of the logical representation library.


Value: Text vector containing the names (in an operating system dependent format) of library
files that make up the logical library.

See #REP_LIB command in Section 9.2.4

10.16.23 REP_LIBS(level) GUID-3E1014D9-4A8B-44DA-A0EE-FB0653BF59A4 v2

The logical library names defined on a specified level.

266 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'level' Integer value 0 to 3 specifying the requested level in library hierarchy:


0 System libraries
1 Application libraries
2 Process specific libraries (for example, monitor libraries)
3 Temporary libraries
Value: Text vector containing the names of the defined logical representation libraries on the
requested level.

See #REP_LIB command in Section 9.2.4 for details of logical representation libraries.

10.16.24 SHADOW_FILE(file_name [,"DELETED"]) GUID-C5BD6FD5-0C81-4976-A794-7C2351163919 v1

Queues a file for shadowing.

'file_name' Text or byte string (file tag). The name of the file. See Section 6.5.1 for file naming.
"DELETED" Optional keyword "DELETED".
Value: A list value containing the following attributes:
STATUS status code (0 = OK).
QUEUED Boolean value indicating whether the file was queued for shadowing.

The function first locates the file. The status is returned in attribute STATUS. Then, it checks whether
the file belongs to an application that is currently shadowed. If yes, the file is queued for shadowing
(the function does not wait for the completion of shadowing) and TRUE is returned in attribute
QUEUED. If not, FALSE is returned and nothing is done.

If optional keyword "DELETED" is specified, the file is expected to be already deleted from the local
system. In this case the file delete operation is only queued for shadowing.

This function should be used if a file is created in an application directory (a directory below the
directory "/APL/application") using a non-SYS600 program, for example, by a tool that copies files
using operating system utilities.

10.16.25 TEXT_READ(file [,start [,number]) GUID-B2478F81-51C4-454C-AA5E-1ECDA5719A77 v2

Reads a text file or a part of it.

'file' Text or byte string (file tag). The file name. See Section 6.5.1 for file naming.
'start' Positive or negative integer. If positive, it is the number of the first line to be read from the text
file counted from the beginning of the file (1 = the first line). If negative, it is the number of the
last line to be read counted from the end of the file (-1 = the last line). Default: 1.
'number' Integer, 0 ... 2 000 000. The number of lines to be read from the file.
0 = nothing is read. Default: 10 000.
Value: A list with the following attributes:
STATUS SCIL status code, 0 = OK
TEXT Text vector containing the read data (up to 2 000 000 lines, each line up to
65 535 characters)
LONGEST Integer, the index of the longest line in TEXT
MORE Boolean, TRUE if there are more lines to be read, otherwise FALSE

If 'start' is omitted, reading starts from the beginning of the file. If 'number' is omitted, reading is
performed to the end of file, or until 10 000 lines have been read.

MicroSCADA X SYS600 10.5 267


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

The attributes TEXT, LONGEST and MORE are returned only when STATUS = 0.

The function supports Unicode files, UTF-8 and UTF-16 Byte Order Marks (BOM's) are recognized.

10.16.26 WRITE_BYTES(file, data [,append]) GUID-F22839B4-F506-4FE5-A880-E2028FCCCEFD v1

Writes a binary file.

'file' Text or byte string (file tag). The name of the file. See Section 6.5.1 for file naming.
'data' Byte string value containing the data to be written.
'append' Integer value 0 or 1, defaults to 0. If 0, a new file is created. If 1, the data are appended
to the file, if it already exists.
Value: Integer value. The status code of file write operation, 0 if OK.

Using this function a byte string value may be written as a sequential binary file, i.e. an unstructured
string of bytes. It is usually used to export data to an external application or to store a compiled SCIL
program in a file.

See also function READ_BYTES.

10.16.27 WRITE_COLUMNS(file, pos, width, data [,append] [,encoding]) GUID-447334A0-5820-4857-9A5E-B1C8F2557788 v1

Writes a text file as columns.

'file' Text or byte string (file tag). The name of the file. See Section 6.5.1 for file naming.
'pos' Integer vector. Specifies the start positions of the columns to be written (1 ... 65 535). The
positions do not have to be in ascending order.
'width' Integer vector. Must be of the same length as pos. Specifies the column widths (1 ... 65 535).
The columns are allowed to overlap. If they do, a column earlier in the list will be covered by
the later one. Any data written past character position 65 535 are lost. Possible gaps
between the columns are filled with space characters.
'data' Vector value of the same length as 'pos' and 'width'. Each element of the vector is a text
vector containing the text of one column. The element vectors must be of the same length.
'append' Integer value 0 or 1, defaults to 0. If 0, a new file is created. If 1, the data are appended to the
file, if it already exists.
'encoding' Text keyword, either "UTF" or "ANSI":
"UTF" The file is written in UTF-8 encoding with a BOM (Byte Order Mark). This is
the default value.
"ANSI" The file is written in extended ANSI encoding using the ACP (Active Code
Page) of the operating system. This value is used when the file is later read
by an application that is not Unicode aware.
When an existing file is appended, this argument is ignored. The encoding of the file is
reserved.
Value: Integer value. The status of the write operation, 0 if OK.

Arguments 'append' and 'encoding' may be given in any order.

See also function READ_COLUMNS.

10.16.28 WRITE_PARAMETER(file, section, key, value [, encoding]) GUID-FF8EDF95-418D-438C-AAE2-6CBBC03F611D v1

Writes a parameter into a parameter file.

268 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'file' Text or byte string (file tag). The name of the parameter file. See Section 6.5.1 for file naming.
'section' Text. The name of the section.
'key' Text. The key of the parameter.
'value' Text. The value to be assigned to the parameter.
'encoding' Text keyword, either "UTF" or "ANSI":
"UTF" The file is written in UTF-8 encoding with a BOM (Byte Order Mark).
"ANSI" The file is written in extended ANSI encoding using the ACP (Active Code
Page) of the operating system. This value is used when the file is later read
by an application that is not Unicode aware. This is the default value.
Return value: A list with one attribute:
STATUS The status code of the write operation.

The file and/or the section is created if it does not exist. The parameter files are described in Section
6.5.2.

Parameter file lines may be up to 65 535 characters long. If a longer line is written, the following error
raises: SCIL_PARAMETER_FILE_LINE_TOO_LONG.

Because the spaces before and after the equal sign are insignificant, it is not possible to write a key
value with a leading space character.

See also functions READ_PARAMETER and DELETE_PARAMETER.

10.16.29 WRITE_TEXT(file, text [,append] [,encoding]) GUID-EE37E8D5-DF8A-45DA-941A-D6ABAF0CB113 v1

Writes a text file.

'file' Text or byte string (file tag). The name of the file. See Section 6.5.1 for file naming.
'text' A text vector containing the text to be written.
'append' Integer value 0 or 1, defaults to 0. If 0, a new file is created. If 1, the data are appended to the
file, if it already exists.
'encoding' Text keyword, either "UTF" or "ANSI":
"UTF" The file is written in UTF-8 encoding with a BOM (Byte Order Mark). This is
the default value.
"ANSI" The file is written in extended ANSI encoding using the ACP (Active Code
Page) of the operating system. This value is used when the file is later read
by an application that is not Unicode aware.
Value: An integer. The status code of the file write, 0 = OK.

Arguments 'append' and 'encoding' may be given in any order.

See also functions TEXT_READ and READ_TEXT.

Example:

#LOCAL S = WRITE_TEXT("A", V, 1)
#IF S == 0 #THEN !SHOW INFO "File successfully appended"
#ELSE !SHOW INFO "Append failed by " + STATUS_CODE_NAME(S)

10.17 File management functions GUID-9278A433-3B2D-4C25-9662-DF2AAB725A38 v1

File management functions implement the handling of drives (or disk-like devices), directories and
files in an operating-system independent way.

MicroSCADA X SYS600 10.5 269


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

This function family consists of functions DRIVE_MANAGER, DIRECTORY_MANAGER,


FILE_MANAGER and a number of auxiliary functions named FM_*.

Used terminology:

Drive name Printable drive name in OS dependent format. In Windows, one-letter name A,
B, ... or a UNC name. Lower case letters accepted as a function argument.
Directory name Printable directory name. In Windows, any valid file name. Returned in case
stored by the file system, case-insensitive as a function argument.
File name Printable file name. In Windows, any valid file name. Returned in case stored by
the file system, case-insensitive as a function argument. By convention, file name
is divided into the proper file name and the extension separated by a period. If
there are several periods in the name, the last one is considered as the name/
extension separator.
Absolute path Printable absolute directory or file path in OS dependent format. Absolute path
contains the drive name (or uses the default drive) and all the intermediate
directory names to uniquely identify a directory or a file. In Windows, the syntax
of an absolute path is [drive:]\[directory_name\]*name.
Relative path Printable relative directory or file path in OS dependent format. Given a root
directory, relative path contains intermediate directory names (if any) to uniquely
identify a directory or a file within the root directory. The absolute path of a file is
obtained by combining the absolute path of the root directory and the relative
path of the file. In Windows, the syntax of a relative path is [directory_name
\]*name.
SCIL name File (or directory) name given in operating system independent format used by
other SCIL commands and functions, see PARSE_FILE_NAME function for
details.
Examples:
"PATH/FILE.EXT",
"/SYS/ACTIVE/SYS_/SYS_BASCON.COM", "/LIB"
Drive tag An OS independent identifier of a drive represented as a byte string data in SCIL.
Absolute directory tag An OS independent representation of the absolute path of a directory. A drive tag
is a valid absolute directory tag referring to the root directory of the drive.
Relative directory tag An OS independent representation of the relative path of a directory.
Absolute file tag An OS independent representation of the absolute path of a file.
Relative file tag An OS independent representation of the relative path of a file. Filters used when
browsing directories may contain following wildcard characters:
* Matches with any character string including null string.
? Matches with any single character, at the end of name or
extension it matches also null character.
% Matches with any single character.
An example: sysm?.exe? matches with sysm.exe, but
sysm%.exe% does not.
Operation of the filters is comparable to the Windows
Find|Files or Folders operation.

10.17.1 Calling syntax GUID-69ED5A2E-9338-44C9-BFEC-4C852538CAD1 v1

The common calling syntax of DRIVE_MANAGER, DIRECTORY_MANAGER and FILE_MANAGER


is
GUID-C6895B5E-750E-4BAA-BB3A-AC0B79CB2DEF v1
FUNCTION_NAME(command [,argument]*)

The first argument 'command' is a text keyword that selects the requested subfunction. The keyword
is case-insensitive. In the descriptions of subfunctions below, the 'command' argument is represented
as an upper-case text constant. Any valid SCIL expression resulting to a valid keyword value will do,
of course.

270 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

The auxiliary functions do not follow this convention.

Example listing all files in the given directory:

TAGS = FM_DIRECTORY("c:\temp")
NAMES = FM_REPRESENT(FILE_MANAGER("LIST", TAGS))
;NAMES is a vector containing the filenames of the directory "c:\temp".

10.17.2 Compatibility GUID-F15D99F9-6517-4A7A-9FB1-9E071288EC50 v1

The functions in this section all use abstract tags instead of a textual names as file identifiers.

File handling commands (Section 9.2.5) and file handling functions (Section 10.16) accept a file tag
argument as the identifier of the file to enable their use in conjunction with file management
functions.

10.17.3 DRIVE_MANAGER GUID-A1B2C608-09A3-4C20-ACF8-1893C3188949 v1

A drive is the root of a file hierarchy. Depending on the operating system, a drive may correspond to
a physical disk-like device or it may consist of several physical devices or it may be a partitioning of a
physical device or it may map to a directory of another drive. In Windows, a drive corresponds to a
Windows logical drive (labelled A, B, and so on) or an UNC (Universal Naming Convention) name of
the form \\servername\sharename.

The following commands are recognized by DRIVE_MANAGER:

• LIST
• EXISTS
• GET_DEFAULT
• GET_ATTRIBUTES

10.17.4 DRIVE_MANAGER("LIST") GUID-8B2125DF-B39D-40AE-95F6-1286730D2BE2 v1

Returns the drives available in the system.

Value: Vector value containing the drive tags of the available drives.

10.17.5 DRIVE_MANAGER("EXISTS", drive) GUID-888D06BE-D5AE-4763-89FC-AD8BCA677B72 v1

Checks the existence of one or more drives.

'drive' Drive tag or a vector of drive tags to be checked.


Value: Boolean or boolean vector value indicating whether the drive(s) exist or not.

10.17.6 DRIVE_MANAGER("GET_DEFAULT") GUID-96CEA901-9ACE-4C84-B81B-96E45DE24FE1 v1

Returns the default drive, i.e. the drive assumed if an absolute path does not contain the drive.

Value: Byte string value containing the tag of the default drive.

10.17.7 DRIVE_MANAGER("GET_ATTRIBUTES", tag) GUID-90181048-B799-44EC-B67A-9CFDB014CEB0 v1

Returns some information from drives.

MicroSCADA X SYS600 10.5 271


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'tag' The drive tag or a vector of drive tags of interest.


Value: A list of following attributes:
STATUS Integer or integer vector value, the status code(s) of the query.
FAILURES Integer value containing the number of failed queries. If FAILURES == 0,
STATUS contains all zeroes.
TYPE Text or text vector value:
"FIXED"
"REMOVABLE"
"CDROM"
"NETWORK"
"RAM"
"SHARED"
"UNKNOWN"
CAPACITY Integer or integer vector value: The total capacity of the drive in
kilobytes. 0 is returned for unavailable device of TYPE "REMOVABLE".
FREE Integer or integer value: The unused capacity of the drive in kilobytes. 0
is returned for unavailable device of TYPE "REMOVABLE".

10.17.8 DIRECTORY_MANAGER GUID-5100E3B4-F42E-413E-B4DE-51ACE90A7146 v1

The following commands are recognized by DIRECTORY_MANAGER:

• LIST
• CREATE
• DELETE
• DELETE_CONTENTS
• EXISTS
• COPY
• COPY_CONTENTS
• MOVE
• RENAME
• GET_ATTRIBUTES

10.17.9 DIRECTORY_MANAGER("LIST", directory [,filter [,recursion]


[,hidden]]) GUID-25A6BA2F-C8A6-4A4C-8517-6EB8095F7F43 v1

Lists the directories contained in a given directory.

directory' Absolute directory tag of the directory whose contents are listed.
'filter' Text value: The filter for the directory names to be listed. May contain wildcard
characters * , % and ?.
Default value is "" (no filter).
'recursion' Text keyword "RECURSIVE" or "NON_RECURSIVE". Recursive listing means that
whole directory hierarchy rooted in 'root' is listed.
Default value is "NON_RECURSIVE".
'hidden' Text keyword "EXCLUDE_HIDDEN" or "INCLUDE_HIDDEN". Specifies whether hidden
directories are listed or not.
Default value is "EXCLUDE_HIDDEN"
Value: Vector value containing the relative directory tags of the directories found.

Arguments 'recursion' and 'hidden' may be given in any order.

10.17.10 DIRECTORY_MANAGER("CREATE", directory [,recursion]) GUID-1C4DB4FA-1D33-41AB-BFDB-4069224B1488 v1

Creates a directory or a hierarchy of directories.

272 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'directory' Absolute directory tag of the directory to be created.


'recursion' Text keyword "RECURSIVE" or "NON_RECURSIVE". Recursive creation means that
all missing directories contained in ‘directory' are created.
Default value is "NON_RECURSIVE".
Value: Integer value: The status code of the operation.

10.17.11 DIRECTORY_MANAGER("DELETE", directory) GUID-3016A307-B8C7-4916-A688-B82E1F88FBC1 v1

Deletes one or more directories and all the directories and files contained in them.

'directory' Absolute directory tag or a vector of tags to be deleted.


Value: List value with following attributes:
OK Boolean value, TRUE if successful.
FAILED A vector value containing relative directory or file tags of directories and
files not deleted. Missing if OK = TRUE.
STATUS An integer vector containing the status codes of failed deletions. Missing if
OK = TRUE.

10.17.12 DIRECTORY_MANAGER("DELETE_CONTENTS", directory


[,filter [,subdirectories]]) GUID-1CCA49F7-B5D9-463A-B9DD-E96E679180D8 v2

Deletes files and directories contained in a given directory.

'directory' Absolute directory tag of the directory whose contents are deleted.
'filter' Text value: The filter for the file and directory names to be deleted.
May contain wildcard characters * , % and ?.
Default value is "" (no filter).
'subdirectories' Text keyword "INCLUDE_DIRECTORIES" or "OMIT_DIRECTORIES".
Specifies whether the subdirectories are deleted or not. If subdirectories are deleted, the filter
is applied to the name of subdirectories (not to the contained files).
Default value is "OMIT_DIRECTORIES".
Value: List value with following attributes:
OK Boolean value, TRUE if successful.
FAILED A vector value containing relative directory or file tags of directories and
files not deleted. Missing if OK = TRUE.
STATUS An integer vector containing the status codes of failed deletions. Missing if
OK = TRUE.

10.17.13 DIRECTORY_MANAGER("EXISTS", directory) GUID-4835F33D-2F92-42BC-884D-75E481E550F7 v1

Checks the existence of one or more directories.

'directory' Absolute directory tag or a vector of tags to be checked.


Value: Boolean or boolean vector value indicating whether the directories exist or not.

10.17.14 DIRECTORY_MANAGER("COPY", source, target) GUID-9EE670FF-BD16-4F7A-876A-367B602E75BE v1

Copies a directory and all its contents into a new directory.

MicroSCADA X SYS600 10.5 273


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'source' Absolute directory tag of the source directory.


'target' Absolute directory tag of the target directory, which is created by COPY.
Value: List value with following attributes:
OK Boolean value, TRUE if successful.
FAILED A vector value containing relative directory or file tags of directories and
files not copied. Missing if OK = TRUE.
STATUS An integer vector containing the status codes of failed copies. Missing if
OK = TRUE.

10.17.15 DIRECTORY_MANAGER("COPY_CONTENTS", source, target


[,filter [,subdirectories [,overwrite]]]) GUID-73BBF887-8BE2-4876-BF03-310946E99D73 v2

Copies the files of a directory into another directory. Optionally, the subdirectories are recursively
copied as well.

'source' Absolute directory tag of the source directory.


'target' Absolute directory tag of the target directory (not created by COPY_CONTENTS).
'filter' Text value: The filter for the file and directory names to be copied. May contain wildcard
characters * , % and ?.Default value is "" (no filter).
'subdirectories' Text keyword "INCLUDE_DIRECTORIES" or "OMIT_DIRECTORIES".
Specifies whether the subdirectories are copied or not. If subdirectories are copied, the filter
is applied to the name of subdirectories (not to the contained files).
Default value is "OMIT_DIRECTORIES".
'overwrite' Text keyword "OVERWRITE" or "DONT_OVERWRITE". Specifies whether an existing file in
target directory is overwritten or not.
Default value is "DONT_OVERWRITE"
Value: List value with following attributes:
OK Boolean value, TRUE if successful.
FAILED A vector value containing relative directory or file tags of directories and
files not copied. Missing if OK = TRUE.
STATUS An integer vector containing the status codes of failed copies. Missing if
OK = TRUE.

Keyword arguments 'subdirectories' and 'overwrite' may be given in any order.

10.17.16 DIRECTORY_MANAGER("MOVE", directory, target) GUID-90E725CB-FC0F-44A1-B6A8-4B5A436E3656 v1

Moves a directory to another directory.

'directory' Absolute directory tag of the directory to be moved.


'target' Absolute directory tag of the directory to become the new parent directory.
Value: List value with following attributes:
STATUS Integer value, the status code of the operation.
NEW_TAG New tag for the moved directory (if STATUS = 0)

10.17.17 DIRECTORY_MANAGER("RENAME", directory, name) GUID-8534297C-9696-44E3-9DA1-49332D61044F v1

Renames a directory.

274 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'directory' Absolute directory tag of the directory to be renamed.


'name' Text value, the new directory name.
Value: List value with following attributes:
STATUS Integer value, the status code of the operation.
NEW_TAG New tag for the moved directory (if STATUS = 0)

10.17.18 DIRECTORY_MANAGER("GET_ATTRIBUTES", directory) GUID-4137C436-4F75-48C1-B56C-2D2668710770 v1

Returns attribute information from one or more directories.

'directory' Absolute directory tag or vector of directory tags of interest.


value List value containing the following attributes:
STATUS Integer or integer vector value containing the status of each query.
READ_ONLY Boolean or boolean vector value.
SYSTEM Boolean or boolean vector value, TRUE if exclusively used by the
OS.
HIDDEN Boolean or boolean vector value, TRUE if a ’hidden’ directory.
ARCHIVE Boolean or boolean vector value, TRUE if ’archive’ attribute is set in
the directory.
COMPRESSED Boolean or boolean vector value, TRUE if a compressed directory.
ENCRYPTED Boolean or boolean vector value, TRUE if an encrypted directory.
FAILURES Integer value telling the number of failed queries.

10.17.19 FILE_MANAGER GUID-B0795826-D5FB-4227-9B26-935E9CE0B017 v1

The following commands are recognized by FILE_MANAGER:

• LIST
• DELETE
• EXISTS
• COPY
• MOVE
• RENAME
• GET_ATTRIBUTES

10.17.20 FILE_MANAGER("LIST", directory [,filter [,recursion] [,


hidden]]) GUID-51F3EDFE-AE52-43D9-98EA-F27E334EE4DE v1

Lists the files contained in a given directory.

'directory' Absolute directory tag of the directory whose contents are listed.
'filter' Text value: The filter for the file names to be listed. May contain wildcard characters *
% and ?. Default value is "" (no filter).
'recursion' Text keyword "RECURSIVE" or "NON_RECURSIVE". Recursive listing means that all
files in the directory hierarchy rooted in 'directory' is listed. Default value is
"NON_RECURSIVE".
'hidden' Text keyword "EXCLUDE_HIDDEN" OR "INCLUDE_HIDDEN". Specifies whether
hidden files are listed or not. Default value is "EXCLUDE_HIDDEN"
Value: Vector value containing the relative file tags of the files found.

MicroSCADA X SYS600 10.5 275


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Arguments 'recursion' and 'hidden' may be given in any order.

10.17.21 FILE_MANAGER("DELETE", file) GUID-30C12FDA-C07D-4E83-899C-1325707EE597 v1

Deletes one or more files.

'file' Absolute file tag or a vector of file tags to be deleted.


Value: A list value containing the following attributes:
DELETED Integer value containing the number of deleted files.
FAILED Integer value containing the number of failed deletions.
STATUS Integer or vector value containing the status code for each deletion.

10.17.22 FILE_MANAGER("EXISTS", file) GUID-A82E6878-42FF-4784-9470-74A29019B11D v1

Checks the existence of one or more files.

'file' Absolute file tag or a vector of file tags to be checked.


Value: Boolean or a boolean vector value indicating whether the file exists or not.

10.17.23 FILE_MANAGER("COPY", source, target [,overwrite]) GUID-6FD798E9-035B-48EF-A144-CDF1E7F2A720 v1

Copies the contents of a file to another file.

'source' Absolute file tag of the source file.


'target' Absolute file tag of the target file.
'overwrite' Text keyword "OVERWRITE" or "DONT_OVERWRITE".
Default value is "DONT_OVERWRITE".
Value: Integer value, the status code of the operation.

10.17.24 FILE_MANAGER("MOVE", file, target) GUID-B4329DEE-A253-4F74-B70B-C00B4927D696 v1

Moves a file to another directory.

'file' Absolute file tag of the file to be moved.


'target' Absolute directory tag of the directory to become the new parent directory.
Value: List value with following attributes:
STATUS Integer value, the status code of the operation.
NEW_TAG New tag for the moved file (if STATUS = 0)

10.17.25 FILE_MANAGER("RENAME", file, name) GUID-15052893-B804-4878-A9CD-41E48F9F3643 v1

Renames a file.

'file' Absolute file tag of the file to be renamed.


'name' Text value, the new file name.
Value: List value with following attributes:
STATUS Integer value, the status code of the operation.
NEW_TAG New tag for the renamed file (if STATUS = 0).

276 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.17.26 FILE_MANAGER("GET_ATTRIBUTES", file) GUID-C7E70554-63FF-4229-A79F-D68A76F18E46 v1

Returns attribute information from one or more files.

'file' Absolute file tag or vector of file tags of interest.


Value: List value containing the following attributes:
STATUS Integer or integer vector value, the status of the query.
FAILURES Integer value telling the number of failed queries.
READ_ONLY Boolean or boolean vector value.
SYSTEM Boolean or boolean vector value, TRUE if exclusively used by
the OS.
HIDDEN Boolean or boolean vector value, TRUE if a 'hidden' file.
ARCHIVE Boolean or boolean vector value, TRUE if 'archive' attribute is
set in the file.
COMPRESSED Boolean or boolean vector value, TRUE if a compressed file.
ENCRYPTED Boolean or boolean vector value, TRUE if an encrypted file.
CREATED_S Time or time vector value, the seconds of the creation.time of
the file.
CREATED_US Integer or integer vector value, the microseconds of the
creation time of the file.
MODIFIED_S Time or time vector value, the seconds of the modification time
of the file.
MODIFIED_US Integer or integer vector value, the microseconds of the
modification time of the file.
SIZE_KB Integer or integer vector value, the kilobytes of the size of the
file.
SIZE_B Integer or integer vector value 0 ... 1023, the bytes of the size
of the file.

10.17.27 Auxiliary functions GUID-7F694CB6-05B4-4ABC-B22E-6A6DD8FF845F v1

10.17.28 FM_APPLICATION_DIRECTORY[(path)] GUID-EE17B2C0-603E-4889-A6B6-E10261B76CBB v1

Creates a directory tag out of an application relative directory path.

'path' Text or text vector value, the directory path(s) given in SCIL file name format, e.g.
"PAR/DEFAULT".
Value: The absolute directory tag of the directory specified by 'path' or a vector of such tags.
If argument 'path' is omitted, the tag of the application root directory is returned.

10.17.29 FM_APPLICATION_FILE(path) GUID-E771BEBB-AAC8-4DE7-8E32-6B3B8892C019 v1

Creates a file tag out of an application relative file path.

'path' Text or text vector value, the file path(s) given in SCIL file name format, e.g. "PAR/
DEFAULT/MYTOOL.INI".
Value: The absolute file tag of the file specified by 'path' or a vector of such tags.

MicroSCADA X SYS600 10.5 277


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.17.30 FM_COMBINE(tag1 [,tagi]*, tagn) GUID-EFDC1B1D-600C-4670-9417-EF44F1D5BF02 v1

Combines two or more drive, directory or file tags to create a new directory or file tag.

'tag1' A drive or a directory tag (either absolute or relative).


'tagi' One or more (up to 30) directory tags.
The tags must be relative directory tags, except for the first one which can be an
absolute directory tag using the default drive if 'tag1' is a drive tag.
'tagn' A directory or file tag or vector of tags.
Value: A directory or file tag denoting the path from 'tag1' to 'tagn' or a vector of such tags.

The tags given as the arguments must follow the order of file hierarchy. A drive must be first
argument if any. Any absolute path containing a drive may not be specified if the first argument is a
drive tag. Only one absolute path may be given. An absolute path may not follow a relative path in
the argument list. A file path must be the last argument if any.

10.17.31 FM_COMBINE_NAME(name, extension) GUID-569A8B94-1723-475E-98A1-A0AFA0F43D4B v1

Combines a proper file name and an extension to a file name.

'name' Text or text vector value, the proper file name(s).


'extension' Text or text vector value, the file name extension(s).
Value: Text or text vector value, the combined file name(s).

Either 'name' or 'extension' or both may be vectors. If both, they must be of equal length.

Trailing blanks, if any, are removed from 'name' and 'extension'. If the extension is empty, the name
is returned. Otherwise, a period is inserted between name and extension. The resulting file name is
not syntax checked.

10.17.32 FM_DIRECTORY(path [,check]) GUID-8A883585-2668-40AE-A9D5-91BACD9C9F81 v1

Creates a directory tag out of a directory path or checks a directory path.

'path' Text or text vector value, directory path(s). Any valid directory path.
'check' Text keyword "CHECK".
Value: If "CHECK", a text or text vector value:
"ABSOLUTE" 'path' denotes a valid absolute path.
"RELATIVE" 'path' denotes a valid relative path.
"ERROR" 'path' is not a valid path.
Otherwise, an absolute or relative directory tag (a byte string value) or a vector of tags.

10.17.33 FM_DRIVE(name [,check]) GUID-6B0848A5-7B7C-4935-B403-7D0CD698B01F v1

Creates a drive tag out of a drive name or checks a drive name.

278 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'name' Text or text vector value, drive name(s). In Windows, one-letter name optionally
followed by ":" or a UNC name.
'check' Text keyword "CHECK".
Value: If "CHECK", a text or text vector value "OK" or "ERROR", otherwise a drive tag (a byte
string value) or a vector of drive tags.

10.17.34 FM_EXTRACT(tag, component) GUID-14CC91F6-DDFE-4891-9679-E52BD7F93F56 v1

Extracts a component from one or more directory or file tags.

'tag' Any directory or file tag or a vector of such tags.


'component' Text keyword specifying the component to be extracted.
"DRIVE" The drive, zero length byte string is returned if 'tag' is not an absolute
path.
"PATH" The intermediate directory path to the last component.
"DIRECTORY" The directory containing the 'tag' ("DRIVE" and "PATH" combined).
"LAST" The directory or file denoted by 'tag'.
"APPLICATION_RELATIVE"
The tag relative to the current application directory.
Value: A byte string or a byte string vector containing the tag(s) of the selected component.

For a missing component, a zero length byte string is returned.

If the selected component is "LAST", a relative directory or file tag is returned.

If the selected component is "PATH" or "DIRECTORY", the result is absolute if 'tag' is absolute and
relative if 'tag' is relative.

10.17.35 FM_FILE(path [,check]) GUID-6C88795B-CF3C-4FF5-9E12-D81B086A19CA v1

Creates a file tag out of a file path or checks a file path.

'path' Text or text vector value, file path(s). Any valid file path.
'check' Text keyword "CHECK".
Value: If "CHECK", a text or text vector value:
"ABSOLUTE" 'path' denotes a valid absolute path.
"RELATIVE" 'path' denotes a valid relative path.
"ERROR" 'path' is not a valid path.
Otherwise an absolute or relative file tag (a byte string value) or a vector of tags.

10.17.36 FM_REPRESENT(tag [,option]*) GUID-4DAB348F-481A-4338-9023-D0531694BEAA v1

Converts one or more drive, directory or file tags into an OS dependent text representation.

'tag' Byte string or a byte string vector value: drive, directory or file tag(s).
'option' One or more of following text keywords in any order
"DRIVE_POSTFIX" In Windows, append a ":" to a drive name (if
a drive tag).
Table continues on next page

MicroSCADA X SYS600 10.5 279


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

"DIRECTORY_POSTFIX" In Windows, append a "\" to directory path (if


a directory tag).
"UPPER_CASE" Use upper case letters.
"LOWER_CASE" Use lower case letters.
"CAPITALIZE" Capitalize the names.
Value: Text or text vector value, the text representation of the given tag(s).

By default, in Windows a drive name is given without the trailing ":", a directory name is given without
the trailing "\" and the case used when the tag was created is not changed.

If 'tag' denotes the default drive, an empty string is returned.

10.17.37 FM_SCIL_DIRECTORY(name [,check]) GUID-A7364599-7439-4A51-A91C-059726650B0F v1

Creates a directory tag out of a SCIL directory name or checks a SCIL directory name.

'name' Text or text vector value, SCIL name(s).


'check' Text keyword "CHECK".
Value: If "CHECK", a text or text vector value:
"ABSOLUTE" 'name' denotes a valid absolute directory.
"RELATIVE" 'name' denotes a valid application directory.
"ERROR" 'name' is not a valid SCIL name.
Otherwise an absolute directory tag (a byte string value) or a vector of tags.

SCIL directory names begin with a slash and are relative to the root directory of the SYS600
installation (usually "\SC"). To create a directory tag for a logical path, use function PATH first to find
out the directory name(s).

10.17.38 FM_SCIL_FILE(name [,option] [,option]) GUID-126D1E68-C915-42E6-8825-C0598401F255 v1

Creates a file tag out of a SCIL file name or checks a SCIL file name.

'name' Text or text vector value, SCIL name(s).


'option' Text keyword "CHECK" or "IGNORE_EXISTING".
Value: If "CHECK", a text or text vector value:
"ABSOLUTE" 'name' denotes a valid absolute file.
"RELATIVE" 'name' denotes a valid application file.
"ERROR" 'name' is not a valid SCIL name.
Otherwise an absolute file tag (a byte string value) or a vector of tags.

If "IGNORE_EXISTING" option is not specified, the function does a lookup for the name given, and
returns a tag for the found file. If the file does not exist, a tag for a file that would be created by
'name' is returned. If the option is specified, the lookup is bypassed.

10.17.39 FM_SCIL_REPRESENT(tag [,case]) GUID-A1A44B6F-7A6F-4E34-B7AC-B6B6D1123E3B v1

Converts one or more directory or file tags into a SCIL name text representation.

280 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'tag' Byte string or a byte string vector value: directory or file tag(s).
'case' One of the following text keywords:
"UPPER_CASE" Use upper case letters.
"LOWER_CASE" Use lower case letters.
"CAPITALIZE" Capitalize the names.
Value: Text or text vector value, the SCIL name representation of the given tag(s).

A zero length text is returned if the 'tag' cannot be converted into a SCIL name, i.e. it contains a drive
or is not located below the root of SCIL file hierarchy (in Windows, "\SC\" by default).

10.17.40 FM_SPLIT_NAME(file) GUID-2863C459-CE8D-4E0B-BAC9-BE62BCAFA923 v1

Extracts the proper name and the extension from one or more file names.

'file' Text or text vector value, file name(s).


Value: List value with following attributes.
NAME Text or text vector value, the proper name(s).
EXTENSION Text or text vector value, the extension(s).

10.18 Communication functions GUID-CEA17F0C-13F5-44A8-B0BB-ABBEB475E444 v1

10.18.1 SPACOM(message) GUID-919DCC12-A0F1-4389-A29B-5793CCB0E146 v1

Communicates with a SPACOM unit connected to a COM port.

The SPACOM function sends the 'message' string to the SPACOM unit and returns the reply
character string. The function can be used only for communication with SPACOM units connected to
the base system. This assumes that the base system attributes SYS:BSD and SYS:BSP have been
set (see the System Objects manual).

'message' Text. The message to be sent to the SPACOM unit.


Value: Text. Reply string. "N" is returned if the unit replies with NAK, and "T" is returned if the
unit does not reply or the reply cannot be interpreted (time-out).

10.18.2 TIMEOUT(millisecs) GUID-6C4E12D3-AD91-4F57-8BF3-D482F799887E v1

Changes the communication time-out.

Changes locally the base system time-out used in the communication with other nodes. The function
affects only the context where it is used. The global time-out is specified by the SYS:BTI attribute.

'millisecs' Integer expression, >= 0. The time-out in milliseconds.


0 means that SYS:BTI will be used for time-out.
Value: The previous time-out value.

The time-out is applied to the following communication:

• Communication with an external application (APL-APL communication).


• Communication with a NET via system (S) objects.
• Communication with a NET via process objects (#SET and #GET command).

MicroSCADA X SYS600 10.5 281


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Example:

#LOCAL OLD, TEMP


OLD = TIMEOUT(10000) ;The time-out is changed
#SET STA:S.. ....... ;Communication with NET
TEMP = TIMEOUT(OLD) ;The time-out is reset to its previous
value.

10.19 CSV (Comma Separated Value) functions GUID-5B5FAC64-04A8-4130-AEC5-54146CA7C12F v2

The CSV functions are used to export data from SYS600 to any Windows application that uses CSV
(Comma Separated Value) file format and to import CSV data into a SYS600 application. The
spread-sheet program Excel is a good example of such a Windows application.

The CSV format exists as two variants:

• The 'original' variant uses a comma as the field separator character (as the format name states)
and a dot as the decimal point character.
• The 'Europian' variant uses a semicolon as the field separator, because the comma is reserved
for the decimal point use.

Both of these variants are supported by the CSV functions.

All the SCIL data types are supported by the CSV functions. For the structured data types (vectors
and lists), two representation options are implemented:

• Horizontal: The components are presented on one line, separated by commas, as the output of
the DUMP function.
• Vertical: Each component is shown in its own line. Note, that these lines still make up only one
field of the CSV format.

The primary target in the design of the CSV functions has been the database export/import
functionality. Typically, a CSV record contains the configuration of a SYS600 database object and a
CSV field contains the value of one attribute of the object. However, the functions can be used to
export and import any data between SCIL and an external application.

10.19.1 CSV_TO_SCIL(csv, start, field_info [,option]) GUID-6ADAAC1F-2427-4CD2-A51D-B0CB6C78591F v1

Converts a CSV file format record into SCIL data.

'csv' Text vector, the contents of a CSV file (or a portion of it)
'start' Positive integer, the row number in 'csv' to start with.
'field_info' A list value describing the contents of the CSV fields or a vector of such list values, if the
fields are different. The list contains the following attributes:
VALUE_TYPE Text keyword, any value type returned by the
OBJECT_ATTRIBUTE_INFO function. This attribute defines
the SCIL value type of the field data, or the value type of the
elements of a vector value.
VECTOR_LENGTH Integer, the maximum length of vector data. If the field does
not contain a vector, this attribute should be omitted.
ELEMENT_TYPE Text keyword, see VALUE_TYPE. The value type of the
elements of vector data. If the field does not contain a vector,
this attribute should be omitted.
'option' Optional text keyword defining which variant of the CSV format is used:
Table continues on next page

282 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

"DECIMAL_POINT_IS_COMMA" The 'Europian' variant is assumed.


"DECIMAL_POINT_IS_UNKNOWN" The function tries to deduce the
variant by itself.
when omitted The ’original’ variant is assumed.
Value: A list with the following attributes:
STATUS SCIL status code for the operation, 0 = OK. The next
attributes are returned only if STATUS = 0. If STATUS = 678
(SCIL_CSV_CLOSING_QUOTE_MISSING), it may indicate
that more data should be read from the CSV file to complete
the CSV record.
SCIL Vector containing the values of the fields.
ERROR_FIELDS Integer vector containing the numbers of the fields (indices
of the vector SCIL) that could not be converted into SCIL
data. The data type of these elements is set to "NONE".
ERROR_CODES Integer vector of the same length as ERROR_FIELDS, SCIL
status codes for the failed fields.
DECIMAL_POINT One-character text containing the decimal point character
(dot or comma). This attribute is returned only when the
option "DECIMAL_POINT_IS_UNKNOWN" is given.
START The row number in the CSV vector to be used as the
argument 'start' in the next call of this function. If START = 0,
the whole vector has been converted.

See function SCIL_TO_CSV for the reverse operation.

10.19.2 SCIL_TO_CSV(data [,option]*) GUID-601189F4-44F9-4A17-881F-8AD01512BD03 v2

Converts SCIL data into a CSV file format record.

'data' Vector value, the SCIL data to be converted


'option' Up to 4 text keywords in any order:
"DECIMAL_POINT_IS_COMMA" The comma is used as the decimal
point character and semicolon as
the field separator.
"VERTICAL_TEXT_VECTORS" Text vectors are shown vertically.
"VERTICAL_VECTORS" Vectors, other than text vectors, are
shown vertically.
"VERTICAL_LISTS" Lists are shown vertically.
Value: A list with the following attributes:
CSV Text vector containing the CSV record.
ERROR_FIELDS Integer vector containing the numbers of the fields (indices of
the 'data' vector) that could not be converted into CSV. These
fields are empty in the result.
ERROR_CODES Integer vector of the same length as ERROR_FIELDS, SCIL
status codes for the failed fields.

The default options are the following:

• The decimal point is a dot, the field separator is a comma.


• Text vectors are shown horizontally.
• Other vectors are shown horizontally.
• Lists are shown horizontally

See the function CSV_TO_SCIL for the reverse operation.

MicroSCADA X SYS600 10.5 283


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Some CSV applications (including Excel) have various size restrictions on the CSV data.
Therefore, they may fail to import a CSV file generated by this function, if the file is very
big (many rows and/or columns) or a field is very long or contains many lines.

10.20 DDE client functions GUID-1DCC5373-47D4-4481-8184-3FC5809B7889 v1

The DDE client functions allow the SYS600 user (application) access to external applications using
the DDE (Dynamic Data Exchange) protocol. The DDE client functions establish a DDE link between
SYS600 and other Windows applications, such as Microsoft Excel or Word. The SYS600 application
works as a client and the other application as a server. The other application must be running when
the connection is opened.

Since Windows Vista and Windows Server 2008, the client and server application must be running in
the same computer.

The DDE protocol is supported by most Microsoft Windows applications. To use the SYS600 DDE
client functions, the user should be familiar with the server application and its DDE functions.

The DDE client functions support the following data transaction commands directed from the client
(SYS600) to the server application:

Request Requests a data transfer from a server to a client.


Poke Writes data in the server application.
Execute Executes an item (a command) in the server application (if execute supported by the
application).

The DDE client functions use the following three identifiers to address data in the server application:

Service name Usually the name of the server application.


Topic name Identifies a logical data context, e.g. a file.
Item name Identifies the data.

The DDE functions in SYS600 use status codes listed below, most of which are DDE protocol status
codes. The status code texts can be, and should be, used as such in SCIL expressions. They are
defined as predefined integers in the SYS600 kernel.

STATUS codes Decimal value


DMLERR_NO_ERROR 0
DMLERR_ADVACKTIMEOUT 16384
DMLERR_BUSY 16385
DMLERR_DATAACKTIMEOUT 16386
DMLERR_DLL_NOT_INITIALIZED 16387
DMLERR_DLL_USAGE 16388
DMLERR_EXECACKTIMEOUT 16389
DMLERR_INVALID_PARAMETER 16390
DMLERR_LOW_MEMORY 16391
DMLERR_MEMORY_ERROR 16392
DMLERR_NOTPROCESSED 16393
DMLERR_NO_CONV_ESTABLISHED 16394
Table continues on next page

284 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

DMLERR_POKEACKTIMEOUT 16395
DMLERR_POSTMSG_FAILED 16396
DMLERR_REENTRANCY 16397
DMLERR_SERVER_DIED 16398
DMLERR_SYS_ERROR 16399
DMLERR_UNADVACKTIMEOUT 16400
DMLERR_UNFOUND_QUEUE_ID 16401
DMLERR_ITEM_TOO_LONG 20483

10.20.1 DDE_CONNECT(service, topic) GUID-482B54B7-BF6E-4C70-AE21-88C87B5B9101 v1

Opens a connection to an external application.

'service' Text. The service name the remote application responds to. Usually the same as the
application name.
'topic' Text. A valid topic name within the remote application.
Value: A list containing the following two attributes:
STATUS A predefined integer (see above). The value indicates
whether the function was successfully executed or not.
DMLERR_NO_ERROR (= 0) means that the operation
succeeded.
CONNECTION_ID Integer, 1 ... 10. The id-number of the connection. If the
connection did not succeed, the CONNECTION_ID is
undefined.

The connection gets an identification number which is used in the subsequent DDE operations. The
DDE connections are SCIL context specific which means that they are automatically closed when a
picture is exited, when a command procedure has been executed to the end or when the dialog
system is deleted. Each SCIL context can have up to 10 open DDE connections simultaneously.

The remote application must be running when the DDE_CONNECT function is issued. Likewise, the
topic for which DDE_CONNECT is issued must be available. For instance, for Excel this means that
the desired spreadsheet must be opened. The remote application can be started from SCIL with the
OPS_CALL command. At the same time the desired topic (e.g. a file) can be opened. A topic can
also be opened later by sending an open command to the server application using the DDE-
_EXECUTE function.

Example:

Connecting to Excel 5.0, sheet 1:

#LOCAL RESULT, CONN


RESULT = DDE_CONNECT("EXCEL", "SHEET1")
#IF RESULT.STATUS == DMLERR_NO_ERROR #THEN #BLOCK
CONN = RESULT.CONNECTION_ID
#BLOCK_END ;Connection was successful
#ELSE #BLOCK ;Connection not successful
#BLOCK_END

10.20.2 DDE_DISCONNECT(connection_id) GUID-510537C1-B22C-4BE2-9C2E-F1B6B3850E25 v1

Closes the DDE connection.

MicroSCADA X SYS600 10.5 285


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'connection_id' Integer, 1 ... 10. The DDE connection identifier obtained using the DDE_CONNECT.
Value: A list containing the following attribute:
STATUS A predefined integer, see above. The value indicates whether the function
was successfully executed or not. DMLERR_NO_ERROR (= 0) means that
the operation succeeded.

Example:

Disconnecting from a remote application (e.g. Excel):

RESULT = DDE_DISCONNECT(CONN )
#IF RESULT.STATUS == DMLERR_NO_ERROR #THEN #BLOCK
;Connection was successfully closed.
#BLOCK_END
#ELSE
;Connection not successfully closed.

10.20.3 DDE_REQUEST(connection_id, item [,timeout]) GUID-26BC3D54-B29A-47EC-82C5-CC30508B357E v1

Requests data from a remote application.

A connection to the application must be open (see above).

'connection_id' Integer, 1 ... 10. The DDE identifier obtained using the DDE_CONNECT.
'item' Text. A valid DDE item in the remote application.
'timeout' Integer, 0 ... 1000. The DDE transaction timeout in seconds. The parameter is optional.
Default value = 20 s.
Value: A list containing the following two attributes:
STATUS A predefined integer (see above). The value indicates whether the function
was successfully executed. DMLERR_NO_ERROR (= 0) means that the
operation succeeded.
DATA Text (max length 65 535), the requested data. If STATUS is not equal to
DMLERR_NO_ERROR, the DATA is undefined.

Example:

Requesting data from Excel:

#LOCAL RESULT, ITEM_VALUE


RESULT = DDE_REQUEST(CONN, "R1C1", 30)
#IF RESULT.STATUS == DMLERR_NO_ERROR #THEN #BLOCK
ITEM_VALUE = RESULT.DATA
;The request was successful
#BLOCK_END
#ELSE #BLOCK
;The request was NOT successful
#BLOCK_END

The cell references in Excel are language dependent if the reference style R1C1 s used
(R for row and C for column). To check the type of reference style and the cell reference
notation of the Excel version in use, select: Tools > Options > General tab.

10.20.4 DDE_POKE(connection_id, item, value [,timeout]) GUID-8272008D-6F23-4CC6-8DA2-294A129A6C4E v1

Sets the value of 'item' in a remote application.

286 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

A connection to the application must be open (see above).

'connection_id' Integer, 1 ... 10. The DDE identifier obtained using the DDE_CONNECT.
'item' Text. A valid DDE item in the remote application.
'value' Text. The value which will be set into item.
'timeout' Integer, 0 ... 1000. The DDE transaction time-out in seconds. The parameter is optional.
Default value = 20 s.
Value: A list containing the following attribute:
STATUS A predefined integer (see above). The value indicates whether the function
was successfully executed. DMLERR_NO_ERROR (= 0) means that the
operation succeeded.

Example:

Setting "Time of Day" in cell "R1C1" in Excel:

#LOCAL RESULT, CONN


...
RESULT = DDE_POKE(CONN, "R1C1", TOD, 30)
#IF RESULT.STATUS == DMLERR_NO_ERROR #THEN #BLOCK
;The value was successfully set.
#BLOCK_END
#ELSE #BLOCK
;The value was NOT successfully set.
#BLOCK_END

10.20.5 DDE_EXECUTE(connection_id, statement [,timeout]) GUID-30F46443-5E0A-4B0D-8F99-8D9A0A040BF9 v1

Executes a statement in a remote application.

The connection to the application must be open. To be able to use this function, the DDE
documentation of the server application is needed.

'connection_id' Integer, 1 ... 10. The DDE connection identifier obtained using the DDE_CONNECT.
'statement' Text. A valid executable statement in the remote application (see the documentation of the
application in question).
'timeout' Integer, 0 ... 1000. The DDE transaction time-out in seconds. The parameter is optional.
Default value = 20 s.
Value: A list containing the following attribute:
STATUS A predefined integer (see above). The value indicates whether the function
was successfully executed. DMLERR_NO_ERROR (= 0) means that the
operation succeeded.

Example:

Executing a statement in Excel:

#LOCAL RESULT, CONN


...
RESULT = DDE_EXECUTE(CONN, "%o~", 30)
#IF RESULT.STATUS== DMLERR_NO_ERROR #THEN #BLOCK
;The request command was successfully executed
#BLOCK_END
#ELSE #BLOCK
;The request was NOT successful.
#BLOCK_END

The string "%o~" corresponds to <Alt+o><ENTER> in Excel and opens a dialog for cell formatting.

MicroSCADA X SYS600 10.5 287


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Use the DDE_EXECUTE function with caution! Different applications respond differently
to the DDE_EXECUTE statement. Excel, for example, must be the active application on
the desktop to be able to execute a submitted DDE_EXECUTE command.

10.21 DDE server functions GUID-5D93BE11-07E6-4C70-A15F-0B6EA41A1C33 v1

SYS600 applications can be accessed from external Windows applications using the DDE protocol
so that the SYS600 application works as a server and the other application as a client.

DDE Server supports the following SCIL data types:

Integer
Text
Time Time will be returned as seconds count from1.1.1978.
Boolean Boolean will be returned as 0 or 1.
Real Real will be returned to client application as SCIL real format ("." as decimal separator)

The vector data type is not supported directly, but can be used with the help of the DDE_VECTOR
function described below. SYS600 real data can be transformed into text data with user defined
decimal separator using the DDE_REAL function (see below). The data types Bit string, Byte string
and List are not supported.

10.21.1 DDE_VECTOR(vector, decimal_separator, list_separator) GUID-694F9F58-A592-40D9-B6A1-0BBA686C3D46 v1

Creates a DDE style list with a user defined list separator.

The function transforms a SCIL vector into a format readable in the client in the application.

'vector' Vector. A valid SCIL expression. The vector may only contain real, integer, text and
boolean elements. Note that the vector will be transformed into a text which can
contain no more than 65 535 characters.
'decimal_separator' Text. A valid separator in the client application.
'list_separator' Text. A valid separator in client application.
Value: A text composed of the elements in 'vector' separated by the list separator (see the
example below).
If a vector element is of invalid data type or missing, there is an empty value in result
string. In other words, there are two consecutive list separator characters in the result
string.

Example:

#LOCAL A = DDE_VECTOR(VECTOR("TEST",1,2.0),"." ,";" )


;Result: A == "TEST;1;2.0"

10.21.2 DDE_REAL(real, separator) GUID-16A43C05-D571-48A4-9496-3C0D10717A68 v1

Creates a DDE style real number with a user defined decimal separator.

288 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'real' Real. A valid SCIL expression.


'separator' Text. A valid decimal separator in client application.
Value: A text value with defined decimal separator.

Example:

@A = DDE_REAL(1.23,",")

;Result: %A == "1,23"

10.22 ODBC functions GUID-FDD09FB7-F9DF-4EB5-946F-0ACF1F500EE4 v1

The ODBC functions provide means for accessing databases and applications that support SQL
(Structured Query Language), e.g. databases built with Microsoft Access, Paradox and Oracle.
SYS600 uses the database interface Microsoft ODBC (Open Database Connectivity) and SQL
statements.

Access to databases requires that an ODBC driver for the database management system in question
has been installed and configured in the SYS600 computer where the ODBC functions are executed.
For more information, see the ODBC documentation.

To be able to use the ODBC functions, the programmer should be familiar with SQL statements.
Refer to suitable SQL manuals and books.

The ODBC functions may return the following seven status codes, which can be used as such in
SCIL expressions because they are defined as predefined integers:

0 SQL_SUCCESS
1 SQL_SUCCESS_WITH_INFO
-1 SQL_ERROR
100 SQL_NO_DATA_FOUND
2 SQL_STILL_EXECUTING
99 SQL_NEED_DATA
2001 SQL_UNSUPPORTED_DATATYPE

In certain cases, also an error code may be returned (for status codes SQL_ERROR and
SQL_SUCCESS_WITH_INFO). The error codes are the ODBC error codes listed in appendix A.

10.22.1 SQL_CONNECT(source, user, password) GUID-08557817-345F-4ADE-85BA-515CD642F9D7 v1

Opens an ODBC connection to a data source.

The data source may be situated in the same computer or in another computer on the network. The
connection gets an identification number which is used in the subsequent ODBC functions.

The ODBC connections are SCIL context specific. This means that when the context, e.g. the picture
or command procedure, is exited, the connections are automatically closed.

Up to 10 ODBC connections may be open simultaneously.

MicroSCADA X SYS600 10.5 289


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'source' Text. The data source name as defined by the ODBC administration tool.
'user' Text. A text string containing the user name that is to be used when accessing the data
source specified in 'source'. An empty string if no user name needed.
'password' Text. A text string containing the password for 'user' when accessing the data source
specified in 'source'. An empty string if no password needed.
Value: A list containing the following three attributes:
STATUS A predefined integer (see above). The values
SQL_SUCCESS and SQL_SUCCESS_WITH_INFO
indicate a successful execution.
CONNECTION_ID Integer, 1 ... 10. The identification number of the
connection. Returned only when the operation did
succeed.
ERROR_CODE Text. A five-character ODBC error code. Returned only
when STATUS is SQL_ERROR or
SQL_SUCCESS_WITH_INFO.

Example:

Opening the connection to a data source named ACCESS:

@RESULT = SQL_CONNECT("ACCESS", "MICRO", "SCADA")


#IF RESULT:VSTATUS == SQL_SUCCESS OR-
RESULT:VSTATUS == SQL_SUCCESS_WITH_INFO #THEN #BLOCK
@CONN = RESULT:VCONNECTION_ID
;Continue the database
interaction.
#BLOCK_END
#ELSE #BLOCK
;The connection was not successful.
#BLOCK_END

10.22.2 SQL_DISCONNECT(connection_id) GUID-D3736966-41BA-467D-BF90-74E98258592A v1

Closes the ODBC connection defined by the argument.

If SQL_BEGIN_TRANSACTION has been issued, SQL_COMMIT is run automatically before the


connection is closed (see below). All statements associated with the connection are freed.

'connection_id' Integer 1 ... 10. The connection identification of the connection that is to be disconnected.
Value: A list containing the following two attributes:
STATUS A predefined integer (see above). The values SQL_SUCCESS and
SQL_SUCCESS_WITH_INFO indicate a successful execution.
ERROR_CODE Text. A five-character ODBC error code. Returned only when
STATUS is SQL_ERROR or SQL_SUCCESS_WITH_INFO.

Example:

Closing the connection opened in the example above:

@RESULT = SQL_DISCONNECT(%CONN)
#IF RESULT:VSTATUS <> SQL_SUCCESS AND-
RESULT:VSTATUS <> SQL_SUCCESS_WITH_INFO #THEN #BLOCK
;The connection was not successfully disconnected.
#BLOCK_END

290 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.22.3 SQL_EXECUTE(connection_id, SQLstring [,timeout]) GUID-7326E4B4-673D-4B4D-A31E-62FE42A60DAC v1

Executes an SQL statement.

'connection_id' Integer 1 ... 10. The identification number of the connection on which the statement is to be
executed.
'SQLstring' Text or text vector. The SQL statement that is to be executed. For more information, see SQL
manuals.
'timeout' Non-negative integer. The maximum time (in seconds) the result is waited for. Zero value
specifies no timeout. The default value is 20 seconds.
Value: A list containing the following three attributes:
STATUS A predefined integer (see above). The values SQL_SUCCESS
and SQL_SUCCESS_WITH_INFO indicate a successful
execution.
STATEMENT_ID Integer, 1 ... 100. The identification number of the statement.
Returned only if the operation did succeed.
ERROR_CODE Text. A five-character ODBC error code. Returned only when
STATUS is SQL_ERROR or SQL_SUCCESS_WITH_INFO.

The function executes the SQL statement on the connection specified by the 'connection_id'
argument. It reserves a statement identification number which is used in a possible subsequent
SQL_FETCH function. Each connection may have up to ten simultaneous execute statements.

Example:

Deleting all records in the table "MYTABLE" where the value in the column "AGE" is equal to 18:

@SQLSTMT = "DELETE FROM MYTABLE WHERE AGE = 18"


@RESULT = SQL_EXECUTE(%CONN, %SQLSTMT)
#IF RESULT:VSTATUS == SQL_SUCCESS OR-
RESULT:VSTATUS == SQL_SUCCESS_WITH_INFO -
#THEN #BLOCK
@STMT = RESULT:VSTATEMENT_ID ;Continue the database interaction.
#BLOCK_END
#ELSE #BLOCK ;The statement was not successfully executed.
#BLOCK_END

See also the SQL_FETCH example below.

10.22.4 SQL_FETCH(statement_id) GUID-8A1807C4-7A9E-401A-A04A-7A507F50E854 v1

Fetches a row of data from a result set obtained by SQL_EXECUTE.

'statement_id' Integer 1 ... 100. The statement identification number returned by SQL_EXECUTE.
Value: A list containing the following three attributes:
STATUS A predefined integer (see above). The values SQL_SUCCESS and
SQL_SUCCESS_WITH_INFO indicate a successful execution.
DATA A vector containing data fetched from a result table. Returned only if
the operation did succeed.
ERROR_CODE Text. A five-character ODBC error code. Returned only when
STATUS is SQL_ERROR or SQL_SUCCESS_WITH_INFO.

The function has no meaning if SQL-_EXECUTE not executed.

Example:

Reading names and addresses from a database:

MicroSCADA X SYS600 10.5 291


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

@SQLSTMT = "SELECT NAME, ADDRESS FROM EMPLOYEE"


@RESULT = SQL_EXECUTE(%CONN, %SQLSTMT)
#IF RESULT:VSTATUS == SQL_SUCCESS OR-
RESULT:VSTATUS == SQL_SUCCESS_WITH_INFO -
#THEN #BLOCK
@STMT = RESULT:VSTATEMENT_ID
#LOOP
@RESULT=SQL_FETCH(%STMT)
#IF RESULT:VSTATUS == SQL_SUCCESS OR-
RESULT:VSTATUS == SQL_SUCCESS_WITH_INFO -
#THEN #BLOCK
...... ; FETCH succeeded
#BLOCK_END
#ELSE #LOOP_EXIT
#LOOP_END
#BLOCK_END
;RESULT:VDATA(1) and RESULT:VDATA(2) contain
;the name and address respectively.

The UNICODE character set is not supported by the function. Therefore, any UNICODE
data to be fetched should be converted to one-byte characters using 'convert' function in
the SELECT clause.

10.22.5 SQL_FREE_STATEMENT(statement_id) GUID-5AA880A2-DFE7-41B6-9598-7623D04D4A5B v1

Frees the specified statement and stops processing associated with the statement.

'statement_id' Integer, 1 ... 100. The statement identification returned from SQL_EXECUTE.
Value: A list containing the following two attributes:
STATUS A predefined integer (see above). The values SQL_SUCCESS and
SQL_SUCCESS_WITH_INFO indicate a successful execution.
ERROR_CODE Text. A five-character ODBC error code. Returned only when
STATUS is SQL_ERROR or SQL_SUCCESS_WITH_INFO.

This function must be used if several calls to SQL_EXECUTE are issued on the same connection. All
open statements associated with the connection will be freed automatically when a connection is
closed.

Example:

@RESULT=SQL_FREE_STATEMENT(%STMT)
#IF RESULT:VSTATUS <> SQL_SUCCESS AND-
RESULT:VSTATUS <> SQL_SUCCESS_WITH_INFO -
#THEN #BLOCK
;The statement was not successfully freed.
#BLOCK_END

10.22.6 SQL_BEGIN_TRANSACTION(connection_id) GUID-01ABB8A4-F346-4881-9C5A-46381FA00C65 v1

Marks the beginning of a transaction.

292 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'connection_id' Integer, 1 ... 10. The identification of the connection on which the transaction is to be
executed.
Value: A list containing the following two attributes:
STATUS A predefined integer (see above). The values SQL_SUCCESS and
SQL_SUCCESS_WITH_INFO indicate a successful execution.
ERROR_CODE Text. A five-character ODBC error code. Returned only when
STATUS is SQL_ERROR or SQL_SUCCESS_WITH_INFO.

The transaction will be completed when SQL_COMMIT or SQL_ROLLBACK is encountered (see


below). Disconnecting the connection will also commit the transaction.

Example:

@RESULT = SQL_BEGIN_TRANSACTION(%CONN)
#IF RESULT:VSTATUS == SQL_SUCCESS OR-
RESULT:VSTATUS == SQL_SUCCESS_WITH_INFO -
#THEN #BLOCK
@SQLSTMT = "DELETE FROM MYTABLE WHERE AGE = 18"
@RESULT1 = SQL_EXECUTE(%CONN, %SQLSTMT)
@SQLSTMT = "UPDATE MYTABLE SET AGE = 18 WHERE AGE = 17"
@RESULT2 = SQL_EXECUTE(%CONN, %SQLSTMT)
#IF (RESULT1:VSTATUS == SQL_SUCCESS OR-
RESULT1:VSTATUS == SQL_SUCCESS_WITH_INFO) AND-
(RESULT2:VSTATUS == SQL_SUCCESS OR-
RESULT2:VSTATUS == SQL_SUCCESS_WITH_INFO) -
#THEN #BLOCK
@RESULT = SQL_COMMIT(%CONN)
#IF RESULT:VSTATUS <> SQL_SUCCESS AND-
RESULT:VSTATUS <> SQL_SUCCESS_WITH_INFO - #THEN #BLOCK
;The commit was not successful
#BLOCK_END
#BLOCK_END
#ELSE #BLOCK
@RESULT = SQL_ROLLBACK(%CONN)
#IF RESULT:VSTATUS <> SQL_SUCCESS AND-
RESULT:VSTATUS <> SQL_SUCCESS_WITH_INFO - #THEN #BLOCK
;The rollback was not successful
#BLOCK_END
#BLOCK_END
#BLOCK_END
#ELSE #BLOCK
;The transaction could not be started.
#BLOCK_END

10.22.7 SQL_COMMIT(connection_id) GUID-A182B4E5-1521-4254-B202-C3FF05B70E08 v1

Commits a transaction the start of which was marked with SQL_BEGIN_TRANSACTION.

'connection_id' Integer, 1 ... 10. The identification number of the connection on which a transaction is to be
committed.
Value: A list containing the following two attributes:
STATUS A predefined integer (see above). The values SQL_SUCCESS and
SQL_SUCCESS_WITH_INFO indicate a successful execution.
ERROR_CODE Text. A five-character ODBC error code. Returned only when
STATUS is SQL_ERROR or SQL_SUCCESS_WITH_INFO.

Example:

See the example related to the SQL_BEGIN_TRANSACTION function above.

MicroSCADA X SYS600 10.5 293


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

10.22.8 SQL_ROLLBACK(connection_id) GUID-214D6E7E-548D-4842-8A74-D683A1850751 v1

Rolls back a transaction started with SQL_BEGIN_TRANSACTION.

'connection_id' Integer, 1 ... 10. The connection identification of the connection on which a transaction is to
be rolled back.
Value: A list containing the following two attributes:
STATUS A predefined integer (see above). The values SQL_SUCCESS and
SQL_SUCCESS_WITH_INFO indicate a successful execution.
ERROR_CODE Text. A five-character ODBC error code. Returned only when
STATUS is SQL_ERROR or SQL_SUCCESS_WITH_INFO.

Example:

See the example related to the SQL_BEGIN_TRANSACTION function above.

10.23 OPC Name Database functions GUID-2EFF42FB-D8C0-4BF6-B9E1-C3BF11FB11EF v1

OPC Name Database functions are used to maintain the OPC Name Database. The database is
used to give OPC style (alias) names for SYS600 objects and their attributes.

An OPC name (item id) is a hierarchical name consisting of any number of fields separated by dots:

"field1.field2. ... .fieldn"

Each field may contain any visible characters, except for colons and dots. The name is case-
sensitive. Single embedded spaces are allowed in the field, leading and trailing spaces are not
accepted. The maximum length of the name is 255 characters.

Examples of valid OPC names:

• "South Tipperary.Kilkenny.Relay1.Breaker.Position"
• "Äänekosken ala-asema.Laukaan syöttö.Katkaisija.Tila"

The names defined in the database and the values of ON attributes of the application objects share
the same name space. They must be unique within an application. Consequently, the user cannot,
for example, define an OPC name that is identical to the value of the ON attribute of some process
object. See the Application Objects manual for the description of the ON attribute.

Each OPC name is mapped to a SYS600 object or an object attribute. Any of the object types P, X,
H, F, D, C, T, A, G, B and S, or any of their attributes may be used. It is even allowed to give an OPC
name for an element (or a slice) of a vector valued attribute. More than one OPC name may refer to
the same SYS600 object.

Examples of valid references given in the SCIL object notation:

ABC:P5 The process object ABC, index 5


DEF:DOS The OS (Object Status) attribute of the data object DEF
SYS:BPA The PA (Primary Application) of the base system
APL:BUV(1..5) The five first user variable elements of the application

External references are not supported. The following is not a valid reference:

ABC:3P5 A process object in application 3 -- not valid

294 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

The OPC Name Database is stored in the application file APL_OPCNAM.SDB. It is implemented as
a SCIL database for fast and easy access and flexibility. The OPC names act as section names, the
SCIL mapping is given in the data of the section. For SCIL databases, see Section 6.6.

At the application start-up, the complete OPC name space is created by combining the names (ON
attribute values) from the process and report database with the ones read from the OPC Name
Database.

When an application object is deleted or renamed, the OPC names that refer to it or any of its
attributes are also deleted.

The OPC Name Database is maintained in real-time by the SCIL function OPC_NAME_MANAGER.

10.23.1 OPC_NAME_MANAGER(function, apl [,argument]*) GUID-EB1FF6CF-1454-4EB7-B8C0-C528548EE796 v1

OPC Name Database maintenance.

'function' Text keyword, "LIST", "PUT", "GET" or "DELETE".


'apl' Integer 0 ... 250, the logical application number 0 = current application External applications
are supported
'argument' Additional argument(s) required by the 'function'
Value: A list always containing the attribute:
STATUS SCIL status code (0 = OK)
Additional attributes are returned depending on the 'function'.

10.23.2 OPC_NAME_MANAGER("LIST", apl) GUID-5C828BB3-3FAD-4C7F-BFE9-EABB872ABE2D v1

Lists the OPC item names found in the OPC Name Database.

Value: A list of attributes:


STATUS SCIL status code (0 = OK)
LIST A text vector containing the names

10.23.3 OPC_NAME_MANAGER("PUT", apl, name, definition) GUID-D6C152E0-C8CF-4284-8319-5D12C61C3B19 v1

Creates a new name in the OPC Name Database or overwrites an existing one.

'name' A text, the OPC name to be added


'definition' A list containing at least the following attribute:
SCIL A text value, the SCIL attribute reference, see above.
Additional attributes, such as descriptive texts may be given if wanted. They are stored, but
not otherwise processed by the base system.
Value: A list of one attribute:
STATUS SCIL status code (0 = OK)

The given name and the SCIL attribute reference are syntax checked according to the rules above.

10.23.4 OPC_NAME_MANAGER("GET", apl, name) GUID-B619F9FD-B152-4916-BBDB-0907B86455DD v1

Reads the definition of a name from the OPC Name Database.

MicroSCADA X SYS600 10.5 295


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'name' A text, the OPC name to be read


'Value: A list of attributes:
STATUS SCIL status code (0 = OK)
DEFINITION A list, the definition stored by the "PUT" function

10.23.5 OPC_NAME_MANAGER("DELETE", apl, name) GUID-9C3FFB99-3B8B-448E-A990-DEF1DC10EFAC v1

Deletes a name from the OPC Name Database.

'name' A text, the OPC name to be deleted


Value: A list of one attribute:
STATUS SCIL status code (0 = OK)

10.24 OPC functions GUID-D94B3F04-94DD-4749-AFF1-BE014A0FE734 v1

The following SCIL functions are used to search for existing OPC servers in the network, examine
their name space, cross-check the SYS600 process database and the server name space, and
perform some specific actions on an open OPC client - server connection.

10.24.1 OPC_AE_ACKNOWLEDGE(apl, ln, ix, ack_id [, comment [,


cookie, active_time]]) GUID-AAFA9A0A-7F01-4A40-BC51-9D300E361543 v1

Acknowledges a condition in an OPC A&E server.

'apl' An integer, the logical application number, 0 = current application. The application must be
local.
'ln' A text, the logical name of the process object to be acknowledged
'ix' An integer, the process object index
'ack_id' A text, the acknowledger ID. This value is seen by other clients as the acknowledger of the
alarm. If an empty text is given, the MicroSCADA user name is used.
'comment' Any text supplied by the acknowledger (optional)
'cookie' An integer, an opaque number supplied by the server to identify the event. This is the value
of the CK attribute of the process object at the time of alarm event.
'active_time' A byte string, the alarm time in a format required by the server. This is the value of the CQ
attribute of the process object at the time of alarm event.
Value: An integer, the SCIL status code of the operation Some possible values:
0 OK_STATUS
2 OBSOLETE_STATUS, the alarm has already been acknowledged
690 SCIL_OPC_CLIENT_NOT_RUNNING, there is no running OPC client for (apl,
unit).
691 SCIL_INVALID_ACK_TIME, the 'cookie' or 'active_time' argument not accepted
by the server
689 SCIL_OPC_COMMUNICATION_ERROR

The arguments 'cookie' and 'active_time' are optional, but if one is given the other one must also be
given. If they are omitted, the CK and CQ attribute of the process object are used.

More information on acknowledgement of OPC A&E conditions is found in the Application Objects
manual.

296 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

10.24.2 OPC_AE_NAMESPACE(nodenr [, clsid1 [, root]]),


OPC_AE_NAMESPACE(nodename, clsid2 [, root [, user,
password]]) GUID-93C8FC63-9083-425D-839F-05A3B4B99EAB v1

Lists the name space of an OPC A&E server.

'nodenr' An integer 1 ... 250, the node number of the type OPC_AE node object
describing the OPC A&E server, or the node number of another type node
object locating the computer where the server is found.
'clsid1' A text, the class ID of the server (optional). This argument is given only when
the 'nodenr' argument only locates the computer (node type is not OPC_AE).
Otherwise, it is omitted or given as an empty text.
'root' A text, the OPC item ID of the browsing root (optional) If not given, the entire
name space is listed.
'nodename' A text, the name or IP address of the node where the server is located A null
string denotes the current node.
'clsid2' A text, the class ID of the server. This value is obtained for example by the
OPC_AE_SERVERS function.
'user' A text, the name of the user account under which the remote OPC server is
launched (optional). The name may be prefixed by the domain name, for
example "DOMAIN\USER".
'password' A text, the password of the user.
Value: A list of the following attributes:
STATUS An integer, SCIL status code of the
operation The following attributes are
returned only if STATUS = 0 (OK)
EVENT_CATEGORIES
A list vector, each element describes
one event category by an event
category descriptor, see below.
AREA_BROWSING_SUPPORTED
Boolean TRUE if the OPC A&E
server supports area browsing,
FALSE if not
ROOT A list value, an area node descriptor
containing the entire event source
hierarchy below the 'root', see below.
This attribute is returned only if
AREA_BROWSING_SUPPORTED =
TRUE.

An event category descriptor is a data structure that describes one event category in an OPC A&E server. It is a list
of the following attributes:
ID An integer, the numeric ID of the category
DESCRIPTION A text description of the category
TYPE A text keyword, which tells the type of the events of the category:
"SIMPLE" Simple events
"TRACKING" Tracking events
"CONDITION" Condition events
Table continues on next page

MicroSCADA X SYS600 10.5 297


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

CONDITIONS A list vector, present only if TYPE = "CONDITION". Each element describes
one of the conditions of the category by the following attributes:
NAME The name of the condition.
SUBCONDITIONS A text vector containing the names of
the subconditions of the condition.

An area node descriptor is a data structure that describes one area in the OPC event source hierarchy tree. It is a list
with the following five attributes:
AREA_NAMES A text vector containing the names of the area nodes
directly below this node.
AREAS A list vector containing the area node descriptors of
these descendant areas (recursive definition!).
SOURCE_NAMES A text vector containing the names of OPC event
sources directly below this node.
SOURCE_QUALIFIED_NAMES A text vector containing the fully qualified names of these
sources.
SOURCE_CONDITIONS A vector of vectors containing the names of the
conditions that these sources have. Each element is a
text vector that lists the names of the conditions
associated to the event source.

In the first form of the function call (i.e. the node is defined by a base system node number), the
possible user account and its password are defined by the node object attribute OP (NODn:BOP).
See the System Objects manual for the details.

10.24.3 OPC_AE_REFRESH(apl, unit) GUID-0B3525F2-84D9-44A4-A41C-9639EADE591B v1

Requests a refresh from an external OPC A&E server.

'apl' An integer, the logical application number, 0 = current application. The application must
be local.
'unit' An integer, the number of the process database unit that runs the OPC A&E client
Value: An integer, the SCIL status code of the operation (0 = OK)

An OPC A&E refresh causes the server to (re)send an event notification for all active and
unacknowledged inactive conditions.

If the A&E server provides a full implementation of the OPC A&E specification, this function is never
needed. If not, the function may be used to get initial values for OPC Event type process objects that
are created or taken into use while the system is running.

10.24.4 OPC_AE_SERVERS(nodenr), OPC_AE_SERVERS(nodename [,


user, password]) GUID-E8CCA40B-7E7A-4611-89BC-7FD8367CCDEF v1

Lists the OPC A&E servers found in a network node.

298 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'nodenr' An integer 1 ... 250, the node number of the node object locating the computer to be
searched for the servers.
'nodename' A text, the name or IP address of the node to be searched. A null string denotes the current
node.
'user' A text, the name of the user account under which the remote OPC server browser is
launched (optional). The name may be prefixed by the domain name, for example "DOMAIN
\USER".
'password' A text, the password of the user.
Value: A list with the following attributes:
STATUS SCIL status code of the operation The following attribute is returned
only if STATUS = 0 (OK)
SERVERS A list vector. Each element describes an A&E server by the following
3 text attributes:
NAME The name of the server
PROGID The program ID of the server
CLSID The class ID of the server

In the first form of the function call (i.e. the node is defined by a base system node number), the
possible user account and its password are defined by the node object attribute OP (NODn:BOP).
See the System Objects manual for the details.

10.24.5 OPC_AE_VALIDATE(apl, unit) GUID-616664E2-BBC8-48C1-8042-1F455E71D83B v1

Cross-checks a process database and the name space of an OPC A&E server.

'apl' An integer, the logical application number, 0 = current application


'unit' An integer, the number of the process database unit that runs the OPC A&E client
Value: A list of the following attributes:
STATUS SCIL status code of the operation The following attributes are returned only
if STATUS = 0 (OK)
AREA_BROWSING_SUPPORTED
Boolean TRUE if the server implements the IOPCEventAreaBrowser
interface, FALSE if not. If the interface is not implemented, the attributes
INVALID_SOURCES and UNDEFINED_SOURCES are not present.
SOURCE_CONDITION_QUERY_SUPPORTED
Boolean TRUE if the server implements the QuerySourceConditions
method, FALSE if not. If the method is not implemented, the attribute
INVALID_SOURCE_CONDITIONS is not present.
INVALID_CATEGORY_IDS
A list vector of categories described in the database but not found in the
server. Each element of the vector is a list of the following two attributes:
EH The name of the erroneous event handling object
CI The category ID in the database
EVENT_TYPE_MISMATCHES
A vector of event type mismatch descriptors. The descriptor is a list that
describes one mismatch by the following four attributes:
EH The name of the erroneous event handling object
CI The category ID in the event handling object
ET The event type in the event handling object
CATEGORY_EVENT_TYPE
Table continues on next page

MicroSCADA X SYS600 10.5 299


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

The event type of the category in the server


INVALID_CONDITIONS
A vector of conditions described in the database but not found in the
server. Each element is a list of the following two attributes:
EH The name of the erroneous event handling object
CN The name of the missing condition
INVALID_SOURCES
A vector of invalid source name descriptors. Each descriptor reports a used
event source name (IN attribute value) that is not found in the server.
Present only if
AREA_BROWSING_SUPPORTED = TRUE. The invalid source name
descriptor is a list of the following two attributes:
IN The invalid source name
OBJECTS The process objects that have this IN attribute value as a
vector of lists of two attributes:
LN The name of the process object
IX The index of the process object
INVALID_SOURCE_CONDITIONS
A vector of invalid source condition descriptors. Each descriptor reports a
process object that either refers to an invalid condition or to a condition that
the event source does not have. Present only if
SOURCE_CONDITION_QUERY_SUPPORTED = TRUE.
The invalid source condition descriptor is a list of the following five
attributes:
LN The name of the process object
IX The index of the process object
IN The event source (IN attribute)
EH The event handling object
CN The name of the invalid condition
UNDEFINED_CONDITIONS
A text vector containing the names of the conditions that are defined in the
server but not in the process database.
UNDEFINED_SOURCES
A text vector containing the names of the event sources that are defined in
the server but not in the process database. Present only if
AREA_BROWSING_SUPPORTED = TRUE.

10.24.6 OPC_DA_NAMESPACE(nodenr [, clsid1 [, root]]),


OPC_DA_NAMESPACE(nodename, clsid2 [, root [, user,
password]]) GUID-61C8AFF2-D951-47F6-B69A-9A698D4EB33A v1

Lists the OPC item hierarchy of an OPC Data Access server.

'nodenr' An integer 1 ... 250, the node number of the type OPC_DA node object
describing the OPC DA server, or the node number of another type node
object locating the computer where the server is found.
'clsid1' A text, the class ID of the server (optional). This argument is given only when
the 'nodenr' argument only locates the computer (node type is not OPC_DA).
Otherwise, it is omitted or given as an empty text.
'root' A text, the OPC item ID of the browsing root (optional) If not given, the entire
name space is listed.
Table continues on next page

300 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'nodename' A text, the name or IP address of the node where the server is located A null
string denotes the current node.
'clsid2' A text, the class ID of the server. This value is obtained for example by the
OPC_DA_SERVERS function.
'user' A text, the name of the user account under which the remote OPC server is
launched (optional). The name may be prefixed by the domain name, for
example "DOMAIN\USER".
'password' A text, the password of the user.
Value: A list with the following three attributes:
STATUS An integer, SCIL status code of the
operation The following attributes are
returned only if STATUS = 0 (OK)
SUPPORTED Boolean TRUE if the OPC DA server
supports address space browsing,
FALSE if not
ROOT A list value, a name space node
descriptor containing the entire item
hierarchy below the 'root', see below.
This attribute is returned only if
SUPPORTED = TRUE.

A name space node descriptor is a data structure that describes one node in the OPC item hierarchy tree. It is a list
with the following six attributes:
BRANCH_NAMES A text vector containing the names of the branch nodes directly below this
node.
BRANCHES A list vector containing the name space node descriptors of these
descendant branch nodes (recursive definition!).
ITEM_NAMES A text vector containing the names of OPC items directly below this node.
ITEM_IDS A text vector containing the fully qualified OPC item ID’s of these items.
ITEM_DATATYPES An integer vector containing the native data types of these items. See the
OPC and Windows OLE documentation for the VARTYPE encoding of the
data types.
ITEM_ACCESS_RIGHTS An integer vector containing the access rights of these items encoded as
follows:
0 No access rights
1 Read only
2 Write only
3 Read / write

In the first form of the function call (i.e. the node is defined by a base system node number), the
possible user account and its password are defined by the node object attribute OP (NODn:BOP).
See the System Objects manual for the details.

10.24.7 OPC_DA_REFRESH(apl, unit, group [, wait]) GUID-47DE7592-7CDC-4726-9E2F-DF96D94475B7 v1

Requests a refresh of an item group from an external OPC DA server.

MicroSCADA X SYS600 10.5 301


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'apl' An integer, the logical application number, 0 = current application. The application must
be local.
'unit' An integer, the number of the process database unit that runs the OPC DA client
'group' A text, the name of the item group
'wait' A non-negative integer, milliseconds to wait for the reply. Optional, default value is 0
(do not wait for reply)
Value: An integer, the SCIL status code of the operation: 0 = OK_STATUS 8410 =
OPCC_REFRESH_TIMEOUT Other error status codes

OPC_DA_REFRESH requests a refresh of an item group from the connected OPC Data Access
Server and optionally waits until the item values have been updated in the process database.

Typically, this function is used for item groups whose update rate is set to -1. Such a group is not
cyclically updated, see the System Objects manual, attribute NOD:BOP.

The function may be used for cyclically updated groups as well, for example when the update cycle is
long and fresh item values are needed in the middle of the cycle.

Example:

#LOCAL REFRESH_STATUS
...
REFRESH_STATUS = OPC_DA_REFRESH(0, 100, "PassiveGroup", 2000)
#IF REFRESH_STATUS == 0 #THEN -
.SET INFO._TITLE = "Refreshed"
#ELSE_IF REFRESH_STATUS == STATUS_CODE("OPCC_REFRESH_TIMEOUT") #THEN -
.SET INFO._TITLE = "The server did not reply in 2 seconds"
#ELSE .SET INFO._TITLE = "? Failed: " +
STATUS_CODE_NAME(REFRESH_STATUS)

10.24.8 OPC_DA_SERVERS(nodenr), OPC_DA_SERVERS(nodename [,


user, password]) GUID-F665207F-2E3A-40BA-87C9-83E47D33691B v1

Lists the OPC Data Access servers found in a network node.

'nodenr' An integer 1 ... 250, the node number of the node object locating the computer to be
searched for the servers.
'nodename' A text, the name or IP address of the node to be searched. A null string denotes the current
node.
'user' A text, the name of the user account under which the remote OPC server browser is
launched (optional). The name may be prefixed by the domain name, for example "DOMAIN
\USER".
'password' A text, the password of the user.
Value: A list of the following attributes:
STATUS SCIL status code of the operation The following attributes are
returned only if STATUS = 0 (OK)
DA20_SERVERS A vector of server descriptors of the DA servers that support
the version 2.0 of the standard.
DA30_SERVERS A vector of server descriptors of the DA servers that support
the version 3.0 of the standard.
The server descriptor is a list of the following three text attributes:
NAME The name of the server
PROGID The program ID of the server
CLSID The class ID of the server

302 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

In the first form of the function call (i.e. the node is defined by a base system node number), the
possible user account and its password are defined by the node object attribute OP (NODn:BOP).
See the System Objects manual for the details.

10.25 RTU functions GUID-F603F572-28DF-4D69-96EC-FB05BD32D1CE v1

The following functions apply only to S.P.I.D.E.R. RTUs.

10.25.1 RTU_ADDR(key) GUID-F8CF7A49-56F6-48D6-A379-E3B0D13026D1 v1

Returns a list with the address of the object in a certain record.

'key' Text of three characters. The search key of the record.


Value: A list with the following attributes:
TP Integer, 0 ... 11. The type of the RTU200 object (see below).
BA Integer. The block address in RTU200.

The TP attribute contains the four most significant bits and the BA attribute the 12 least significant
bits of the object address (OA).

The TP attribute has the following meanings:

0 No object type
1 Object command
2 Regulation command
3 Digital set-point
4 Analog set-point
5 General persistent output
6 Analog value
7 Indication (single or double)
8 Pulse counter
9 Digital value
10 Indication event recording (indication with time stamp)
11 Analog event recording

Example:

@RTU = RTU_ADDR(RTU_KEY(X:POA1))
;Now
;RTU:VTP == 5
;RTU:VBA == 201

10.25.2 RTU_AINT(i) GUID-9F0AF950-AE5F-4311-966C-A1FB440739BD v1

Converts an integer to ASCII characters (according to the RP570 protocol).

'i' An integer number.


Value: A text of two characters.

Example:

MicroSCADA X SYS600 10.5 303


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

RTU_HEXASC(RTU_AINT(342)) ;returns "0156"

10.25.3 RTU_AREAL(r) GUID-F8FAB569-28B1-4F7A-8968-F600E64E9858 v1

Converts a real number to four ASCII characters (float DS801).

'r' A real number.


Value: A text of four ASCII characters.

Example:

RTU_HEXASC (RTU_AREAL(5.5)) ;returns "40B00000"

10.25.4 RTU_ATIME [(t [,msec])] GUID-A0F4A70E-9441-47B5-9099-AFCF32F88444 v1

Converts time data (operating system time) to ASCII (RTU200 time).

't' Time data. Default: the present time.


'msec' The milliseconds of the time. Default = 0.
Value: A text of 6 or 10 ASCII characters.

Example:

RTU_HEXASC (RTU_ATIME (OBJ:PRT)) ;returns "0EC5226ED990"

10.25.5 RTU_BIN(h) GUID-2A96F4F9-A01E-4246-825C-EDE73DEAF05D v1

Converts HEX-ASCII numbers given as a text to binary numbers in text form.

'h' A text or a text vector of HEX-ASCII numbers.


Value: Text or text vector. The texts represent binary numbers.

Example:

RTU_BIN("414243") ;returns "ABC"

10.25.6 RTU_HEXASC(b) GUID-14349647-4F52-4EFC-A831-E4A2DDAB9CEE v1

Converts binary numbers given as a text to hex-ascii numbers as a text.

'b' A text or text vector representing 8 bit binary numbers.


Value: A text of hex-ascii numbers.

Example:

RTU_HEXASC("ABC") ;returns "414243"

10.25.7 RTU_INT(a) GUID-4C2A1733-F5BC-4333-8B51-F498A572CB06 v1

Converts two ASCII characters (2's complement RP570) to an integer.

304 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

'a' A text of two ASCII characters.


Value: Integer.

Example:

RTU_INT(RTU_BIN("0156")) ;returns 342

10.25.8 RTU_KEY(oa) GUID-95DAB2CF-D240-4D28-89B1-93DC25818609 v1

Returns the search key for a record in an RTU200 configuration file.

The process object corresponding to the record must be known.

'oa' Integer. The object address, the OA attribute, of the process object stored in the record.
Value: A text of three characters. The search key for the record.

Example:

@UN = X:PUN1
#OPEN_FILE 1 0 "RTU'UN'.CFG" KL
#READ 1 RTU_KEY(X:POA1) RECORD
;%RECORD contains the configuration record associated with the object
X:P1.

10.25.9 RTU_MSEC(atime) GUID-C4CAAD52-6E08-4704-8C3C-EA2DBAE3DD6E v1

Returns the milliseconds of the 6-byte RTU time string 'atime'.

'atime' Text. The RTU time.


Value: Integer. The number of milliseconds.

10.25.10 RTU_OA(type, ba) GUID-DF3B8663-AD0E-4684-8C8A-E3E654153B04 v1

Returns the object address.

'type' Integer, 0 ... 11. The type of the object (see the TP attribute in the RTU_ADDR
description above).
'ba' Integer. The address (block address) of the object in RTU200, see the BA attribute in
the RTU_ADDR description above.
Value: Integer. The object address, the attribute OA of the process object.

Example:

RTU_OA(5,201) ;returns 20681

10.25.11 RTU_REAL(a) GUID-A38BF096-9FBD-4F73-9B85-509E9BCC5499 v1

Converts 4 ASCII characters (float DS801) to a real number.

'a' A text of four ASCII characters.


Value: A real number.

MicroSCADA X SYS600 10.5 305


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Example:

RTU_REAL(RTU_BIN("40B00000")) ;returns 5.5

10.25.12 RTU_TIME(a) GUID-62C0D077-1A7B-4077-8964-FF26C70CC2D2 v1

Converts ASCII (RTU200 time) to SYS600 time data.

'a' A text of 6 ASCII characters.


Value: Time data.

10.26 Printout functions GUID-E2D502A5-B71E-4BE4-B167-4483B1E33BBC v1

The functions described in this section are intended to be used only in printed pictures (format
pictures).

10.26.1 PRINT_TRANSPARENT(data [,log]) GUID-528AC6C4-1B5B-467F-BD23-553EC3D3F3AD v1

Sends printout to a printer.

The function sends a printout (data, printer commands and control codes) directly to printers defined
as 'transparent' and writes data to the printer log file. The function enables full printer control and
allows for freely formatted texts and graphics.

When called in a printed picture (printout activated by the #PRINT or #LIST command or by an event
in the process database), the function spools the output (printer commands, control codes and data)
to the printer (see Figure 18).

The function should be placed in the start program of all pictures used for printout on 'transparent'
printers. If the printed picture contains picture functions, the start programs are executed in the
following order: the start program of the main picture, the start program of the base function, the start
programs of the picture functions in the installation order. When used in other environments than
printed pictures (pictures shown on screen, command procedures), the function causes an error
message (SCIL_UNKNOWN_FUNCTION).

306 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

GUID-654150FA-F8B5-4CE9-9EDC-8D3B0C8FE7B1 V1 EN-US

Figure 18: SCIL defined or "transparent" printout


The target printer(s) of the printout are defined by the initiating #PRINT or #LIST command or the LD
attribute of the process object. If there is no transparent printer among the target printers, the
function has no effect. Printers defined as 'transparent' can only handle printout defined by this
function.

Unlike the semi-graphic picture based printout, the printout produced with the
PRINT_TRANSPARENT function does not automatically include any SYS600 picture elements, only
the texts, graphics and formatting specified by the function. However, complete pictures and picture
elements may be included as printout files.

MicroSCADA X SYS600 10.5 307


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

The first argument of the function, 'data', specifies the printout - i.e. the printed data, formatting and
print processing. The second (optional) argument, 'log', specifies the output to the log file. The
function returns the status of the printer spool operation.

'data' Vector value, the printout vector, or integer 0 = no printout.


The printout vector is an ordinary SCIL vector containing text, integer and vector type
elements. It may contain the following elements:

• The data to be sent to the printer. This is specified by texts and text vectors given as constants
or SCIL expressions. The texts may be encoded in any symbol set supported by the printer. The
SCIL expressions must be marked by the printout processing command -5 as the preceding
element (see below). They are evaluated at the moment of physical printing, and the result is
sent to the printer. Expressions can be used, e.g. to print the actual printout time of a report. The
text elements may also comprise printer control sequences for producing graphics. However,
this is generally not recommended, because they would make the print vector printer interface
dependent and the print processor would not be able to keep track of output pages. Instead,
printer control sequences can be defined in the CS attribute and included in the print vector as
printer control commands. Files (e.g. window dump files transferred to printout files) may be
included using the READ_TEXT function.
• Printer control commands. The printer control commands are logical commands that control the
printer. They are represented as positive integers defined by the printer specific CS attribute of
the printer object (see the System Objects manual). There is a tool for defining the printer
control commands.
• Print processor commands. The print processor commands control the processing of the print
vector itself. They are given as negative integers. The following print processor commands are
available:

-1 Auto-NL on Automatic new line feature on (default)


-2 Auto-NL off Automatic new line feature off
-3 Increment LN Increment line number attribute LN
-4 Increment PN Increment page number attribute PN
-5 Formula follows The next element in the vector will be interpreted
as a SCIL expression instead of plain text

The automatic new line feature (on by default) means that a new line command (printer
control command 1, see above) is automatically appended to each text element in the print
vector.
The increment LN and increment PN commands may be used to inform the print processor
that a new line or new page is started using printer control commands that are not predefined
(see the CS attribute).
'log' Vector (or integer 0). The contents of the vector is in full transferred to the log file (provided
that the printer has been defined with printer log output in the base system configuration).
SCIL expressions are evaluated before the transfer. 0 = no log file output.
Value: Integer. The status code generated by the print spool operation. 0 = OK or no 'transparent'
printer among the target printers.

The target printers can be examined by means of the PRINTER_SET function (see below). By
reading the SCIL_HOST function, the SCIL program can determine whether the picture is being
printed or displayed on the screen.

Example:

#LOCAL HOST, OX, CX, OV, S


HOST = SCIL_HOST
#IF HOST.NAME == "PRIN" #THEN #BLOCK
OX = 'LN':POX'IX'
CX = 'LN':PCX'IX'
OV = 'LN':POV'IX'

308 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

S = PRINT_TRANSPARENT((-2,TIMES, "OBJECT TEXT:",OX,-


"COMMENT TEXT:",CX, " OBJECT VALUE:",-1,DEC(OV)))
#BLOCK_END

This program block first checks whether the picture is being printed or shown on the screen. If it is
printed, the PRINT_TRANSPARENT function prints a row containing the present time and the values
of attributes OX, CX and OV of a process object.

10.26.2 PRINTER_SET GUID-29A8201C-B74F-4373-8745-8DE6B9577570 v1

Returns the target printer numbers.

Value: A vector of integer elements.

The function returns the logical target printer numbers (mapped through APL:BPR to find the physical
printer numbers) of the printed picture. By means of this function, the SCIL program may examine
the properties of target printers.

Called somewhere else than in a printed picture, the function has no meaning.

10.27 User session functions GUID-9B83D271-88E1-4EC0-8BD4-64829B494FD2 v1

The following functions are used manage a user session and read its attributes. A session begins by
login and ends either by logout or termination of the client program. Most of the functions can be
used only during an active session.

10.27.1 SET_EVENT_LIST_USER_NAME(name) GUID-F83116D5-10F2-4966-B0BE-7660A231F7E0 v1

Sets the name that is displayed in User Name column of the event list.

'name' Text The name that is used as the User Name in the Event List for events
generated by the calling SCIL program. In the Event List the name appears
prefixed by * for distinction between these artificial and proper user names.
Value: Integer SCIL status code:

0 OK_STATUS
8033 USER_ALREADY_LOGGED_IN
This function may not be used by a logged-in user.

This function is used by SCIL programs that run without a login (for example event and time channel
command procedures).

OPC Clients that run without a login appear as "OPCGuest" in the event list. The user name
OPCGuest is a reserved name that may not be used as a real user name.

The event list user name of external SCIL-API programs is of the format "SCIL-API: username",
where the 'username' is the Windows user name of the launcher of the SCIL-API program.

10.27.2 USM_ADDRESS GUID-F4662F10-24B7-48A0-AD29-2782433A3286 v1

Tells the address of the workplace computer where the user logged in.

MicroSCADA X SYS600 10.5 309


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Value: Text Address of the session, either computer name or IP address. Empty string
if not logged in.

10.27.3 USM_AOR_DATA GUID-B8DE355C-9B58-4AA5-AA5D-F5C18D552A61 v1

Reads the AoR(Area of Responsibility) related data of the user session.

Value: Vector Vector of lists with following attributes (empty vector if the user is not an
AoR operator):

AOR Name of the area


ROLE Name of the area role of the user
USERS Vector of lists describing the other users of the
area, see below
The following two attributes are given only when Exclusive Access
Rights (EAR) are in use:
EAR_ROLE Integer defining the EAR role of the user
0 = Viewer
1 = Secondary operator
2 = Primary operator
3 = Master operator
EAR_OWNER Name of the EAR owner user
The list describing other users contains the following attributes:
USER_NAME Name of user
EAR_ROLE EAR role of user (only when EAR is in use)
ROLE Area role of user
LOGGED_IN Boolean

10.27.4 USM_AUTHORIZATION_LEVEL(group) GUID-214FED38-6772-48B6-A177-61D19B6563A7 v1

Reads the authorization level of the user in a given authorization group.

'group' Text The name of the authorization group


Value: Integer The user's authorization level in the group
0 ... 5, or -1 if not logged in

10.27.5 USM_AUTHORIZATION_LEVEL_FOR_OBJECT(group,
object_name, object_index) GUID-0A45067B-0F27-402F-AAD8-E2DD06DA3A2B v1

Reads the authorization level of the user for controlling a process object.

'group' Text The name of the authorization group used for process object control
'object_name' Text The name of the process object to be controlled
'object_index' Integer The index of the process object to be controlled
Value: Integer The user's authorization level for the process object
0 ... 5, or -1 if no access

This function is used to determine user's authorization level for controlling a process object when
Area of Responsibility (AoR) concept is in use.

310 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

The area is determined by the Object Identifier (OI) attribute of the process object. If the user has a
role in the area, authorization level of that role is returned, otherwise -1 (no access) is returned. If the
process object is contained in more than one area (overlapping areas), the highest authorization
level in the user's area roles is returned.

If Exclusive Access Rights (EAR) concept is in use, only the current EAR owner is given the 'real'
authorization level. Other AoR operators are given authorization level 0.

If AoR concept is not used or the given process object is not contained in any area, the user's
authorization level in the group is returned according to the session role.

10.27.6 USM_AUTHORIZATIONS GUID-1E1FA630-4F51-4C17-9DD6-77601E4B4F32 v1

Reads the authorizations of current user.

Value: List vector Vector of lists with following attributes (empty vector if not logged in):

GROUP Authorization group name


LEVEL Authorization level for the group

10.27.7 USM_CHANGE_PASSWORD(old_password, new_password) GUID-50B5F13E-9637-479B-95C5-9DD4D640EF01 v1

Changes the password of the user.

'old_password' Text Old password


'new_password' Text New password
Value: Integer SCIL status code:

0 OK_STATUS
8035 USER_INVALID_USER_OR_PASSWORD
The old password is wrong.
8017 USER_PASSWORD_POLICY_VIOLATION
The new password is not valid.
8034 USER_NOT_LOGGED_IN
8036 USER_SESSION_NOT_VALID
The session has timed out.

10.27.8 USM_IS_NEW_APPLICATION GUID-F11D8CC8-8444-4DEE-ABE8-A1A82A26EC50 v1

Tells whether the current application is a new one.

Value: Boolean TRUE or FALSE

The word 'new' here means that the next user that logs in to the application becomes an
Administrator user of the application. This function may be called before login.

10.27.9 USM_LOGIN(name, password) GUID-DBA02271-CBCE-4BFD-9CAD-C294793AF0AC v1

Logs in a user starting a new session or silently joins an existing session as a sub-session.

MicroSCADA X SYS600 10.5 311


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'name' Text Name of the user. If this is a silent login to join an existing session, the id of
the session is given as 'name'.
'password' Text Password of the user. If this is a silent login, password is empty ("").
Value: Integer SCIL status code:

0 OK_STATUS
8033 USER_ALREADY_LOGGED_IN
The user is already logged in.
8049 USER_LOGIN_FAIL_WRONG_CR
Wrong credentials (user name or password)
8051 USER_LOGIN_FAIL_EXPIRED
The password has expired.
8052 USER_LOGIN_FAIL_LOCKED
The user account has been locked because of too many
retries.
8053 USER_LOGIN_FAIL_DISABLED
The user account has been disabled.
8055 USER_LOGIN_FAIL_NO_CAM
No connection to Centralized Account Management (CAM)

Obviously, this function is called before login.

10.27.10 USM_LOGOUT GUID-00F62193-9B4B-443C-966E-09F287380FF3 v1

Logs out the user.

Value: Integer SCIL status code:

0 OK_STATUS
8034 USER_NOT_LOGGED_IN
8036 USER_SESSION_NOT_VALID
Session has timed out.

After logout, the SCIL program runs in read-only mode.

10.27.11 USM_PASSWORD_CHANGE GUID-51CFC46D-FE7E-4E36-B1D2-13EC86A7125B v1

Tells the status of the password.

312 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Value: Text One of the following keywords:

"" No need to change password.


"FIRST_LOGIN" New user account. Administrator has
forced a password change.
"RESET" Administrator has given a new
password and forced a password
change.
"EXPIRED" Password has expired and must be
changed.
"EMERGENCY_LOGIN" This is an emergency login. A proper
permanent password must be given.

10.27.12 USM_PASSWORD_POLICY GUID-DFE61BDE-C8AF-4781-BA60-1D91C35504B2 v1

Reads the password policy of the application.

Value: List The following attributes (empty list if not logged in):

IU In use, one of the following values:

0 Password policy is not applied


1 Password policy is applied
-1 Not known. The contents of the policy and its use is
not known. This is the case, when CAM is used for
authentication.

The following attributes are listed only when IU is 1.


PL Minimum password length
UC Minimum number of upper case characters
LC Minimum number of lower case characters
NC Minimum number of numeric characters (digits)
SC Minimum number of special characters (other than UC, LC or
NC characters)

10.27.13 USM_RELEASE_USER_SESSIONS GUID-1582DE27-39DC-4200-9844-B73C11AC5A97 v1

Releases user login sessions. If optional parameter 'session nr' is not provided, all user sessions of
the specified 'user' are released.

MicroSCADA X SYS600 10.5 313


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

'user' Text The user name


'session nr' Integer Session number of the single session to be released. For example, the
'NR' field value of the return value of command USM_SESSIONS
Value: Integer SCIL status code:

0 OK_STATUS, command was performed.


8020 USER_INVALID_USER_NAME
User provided in parameter 'user' does not exist.
8083 USER_AUTHORIZATION_FAILURE
User not authorized to perform the operation.
8039 USER_CANNOT_REMOVE_OR_DISABLE_MYSELF

Example:

Release all user sessions of user "Operator".

USM_RELEASE_USER_SESSIONS("Operator")

Release a single user session of user "Operator" where the login sequence number is 18.

USM_RELEASE_USER_SESSIONS("Operator", 18)

10.27.14 USM_SELECT_ROLE(role) GUID-1291B198-412F-4661-A437-9DAD6D0A1E21 v1

Selects the role for the starting session.

'role' Text The name of the role to be selected


Value: Integer SCIL status code:

0 OK_STATUS
8034 USER_NOT_LOGGED_IN
8036 USER_SESSION_NOT_VALID
The session has timed out.
8002 USER_ROLE_CAN_BE_SELECTED_ONLY_AT_LOGIN
The role cannot be selected twice.

10.27.15 USM_SESSION_ATTRIBUTES GUID-8151AA7D-14DD-4495-9233-9FA52760CFEC v1

Reads the Monitor Pro session attributes.

Value: List The following attributes (empty list if not logged in):

MONITOR_PRO_SESSION_TIMEOUT
MONITOR_PRO_INACTIVITY_TIMEOUT

10.27.16 USM_SESSION_ID GUID-EDC27385-5D49-43D4-8273-F1354F2D2CE3 v1

Tells the id of current session.

314 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

Value: Text Id of current session. Empty string if not logged in.

10.27.17 USM_SESSIONS GUID-D952C44B-94ED-4800-A146-8EF6A35B04C9 v1

Lists the active sessions in the system.

Value: A list vector of active sessions. Each element describes a session by the following attributes:
APL Integer Application number
NR Integer Sequence number of the session
USER Text Name of the user
ROLE Text Name of the user's role in the session
ADDRESS Text Name or IP address of the workplace computer
LOGIN_TIME Time Local time of the login
BREAK_TIME Time Local time of the connection break between kernel
and workplace
SUBSESSIONS Integer Number of sub-sessions in the session
READ_ONLY Boolean TRUE, if the session runs in read-only mode

This function requires super-user access rights (authorization level of group GENERAL must be 5).

10.27.18 USM_USER_LANGUAGE GUID-3A2F0482-A00A-4E8B-BF38-168098C61F88 v1

Tells the user's preferred language.

Value: Text Two-letter ISO 639-1 abbreviation of the preferred language of the user.
Empty string if not logged in.

10.27.19 USM_USER_NAME GUID-493E0F20-A66E-497B-A10F-6455990F1199 v1

Tells the name of current user.

Value: Text Name of the user. Empty string if not logged in.

10.27.20 USM_USER_ROLE GUID-31C2A1C4-466F-484D-B9AA-1F807BE325D6 v1

Tells the name of the role that the user has selected at login.

Value: Text The role of the in this session. Empty string if not logged in.

10.27.21 USM_USER_ROLES GUID-7244A144-40C7-4C7B-8506-753D9702AC33 v1

Lists the roles that the user may select from after a successful login.

Value: Text vector Names of roles. Empty vector if not logged in.

10.27.22 USM_USER_SESSION_DATA GUID-1BDF5424-CFD1-40E8-AAB2-6E12409CC72E v2

Lists the attributes of the current user session.

MicroSCADA X SYS600 10.5 315


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

Value: A list of current user session attributes:


LANGUAGE Text Two-letter ISO 639-1 abbreviation of the preferred
language of the user
LOGIN_TIME_UTC Time UTC time of login
NR Integer Sequence number of the session
PASSWORD_CHANGE Integer Status of the password in integer format

0 ""
1 "FIRST_LOGIN"
2 "RESET"
3 "EXPIRED"
4 "EMERGENCY_LOGIN"

Refer to USM_PASSWORD_CHANGE for further


details.
PASSWORD_EXPIRATION_DAYS Integer Number of days until the password expires
SESSION_ATTRIBUTES List Integer attributes
MONITOR_PRO_SESSION_TIMEOUT and
MONITOR_PRO_INACTIVITY_TIMEOUT
SESSION_ID Text Id of the current session
USER_NAME Text Name of the user
USER_ROLES Text vector List of the user's roles

10.28 Miscellaneous functions GUID-42757021-77AB-4E1B-81D3-8C576932467D v1

10.28.1 ADD_INTERLOCKED(object, index, amount) GUID-F30A0994-6B03-4636-B6E3-F937BF1CBCAD v1

Modifies the UV or SV attribute of a SYS or an APL object.

ADD_INTERLOCKED supports synchronization of SCIL programs executing in parallel.

'object' Text keyword value, either "SYS" or "APL". Specifies the base system object. Note that
application number may not be given, the current application is always assumed.
'index' Integer or vector value.
If an integer, specifies the index of the UV attribute to be modified.
If a vector, specifies both the attribute and the index: The first element is a text value,
either "UV" or "SV". The second element is an integer value specifying the index.
'amount' Integer value to be added into the element of the UV or SV attribute.
Value: Integer value, the result of the addition.

Example:

#LOCAL DUMMY
#LOOP ADD_INTERLOCKED("SYS",("SV",77),1) <> 1 ;Try to reserve the resource
DUMMY = ADD_INTERLOCKED("SYS",("SV",77),-1) ;Didn't get it
#PAUSE 0.5 ;Wait a while
Table continues on next page

316 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 10
Functions

#LOOP_END ;and try again


;The resource is now reserved for exclusive use
DUMMY = ADD_INTERLOCKED("SYS",("SV",77),-1) ;Release the resource

A system wide (inter-application) binary semaphore may be implemented by this SCIL code.
SYS:BSV77 is used as the semaphore. It is supposed to been set to zero in SYS_BASCON.COM.
The value returned by 2nd and 3rd call of the function is not used anywhere. For clarity, the code to
handle a deadlock situation is omitted. In a real application, too long waits must be avoided.

10.28.2 AUDIO_ALARM(alarm_class, on_or_off) GUID-83235A6F-CBAA-4A38-B42C-01997B9AC5E3 v1

Sets and resets the specified audio alarm(s).

'alarm_class' Integer value 1 … 8 or text keyword "ALL"


'on_or_off' Text keyword "ON" or "OFF"
Value: Integer, the status code of the operation, (0=OK_STATUS).

The value "ALL" for the argument 'alarm_class' sets or resets the audio alarm for all alarm classes 1
to 7.

The value 8 is used to force the watchog flip-flop bit to 0 or 1 at system start-up or shutdown.

10.28.3 SCALE(v, scale_object [,direction]) GUID-8F009C51-8871-4095-9AC3-5E4B19598FB6 v1

Scales a value using a scale object.

'v' Real value, the value to be scaled.


'scale_object' Text value, the name of the scale object to do the scaling.
'direction' Text value, either "INPUT" or "OUTPUT". Defaults to "INPUT".
Value: Real value, the scaled value.

The direction "INPUT" corresponds to the scaling of analog input process objects, direction
"OUTPUT" corresponds to the scaling of analog output process objects.

Example:

@r_invalue=SCALE(100,"TEST_SCALE","INPUT")
@r_outvalue =SCALE(0.1,"TEST_SCALE","OUTPUT")

10.28.4 UNLOCK_PICTURE(picture) GUID-96C23B73-8DBE-4A0E-BF9B-2D83CF04BFFE v1

Unlocks a locked picture.

'picture' Text value, the name of the picture in SCIL ([path/]name) or operating system file name
format.
Value: Integer value, a SCIL status code.
0 OK_STATUS
4024 PICF_PICTURE_IS_NOT_LOCKED
Other status codes may also be returned if the argument is invalid.

MicroSCADA X SYS600 10.5 317


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 10 1MRK 511 664-UEN Rev. A
Functions

This function should be used only after a monitor process has crashed or silently
disappeared while the picture has been displayed or edited in the monitor, leaving the
picture locked. In the locked state a picture cannot be edited or in some cases not even
displayed, error 4005 (PICF_SHARE_ERROR) is raised instead.

318 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

Section 11 Graphics primitives GUID-8EA81FE5-61AC-4C43-8930-60F185B48C9F v1

This section describes the use of the graphics primitives, which constitute the base of all full graphics
elements in SYS600 pictures, partly also in dialogs. The first section introduces some concepts
related to the graphics primitives.

11.1 Introduction GUID-398C1533-20DD-4CE3-9B81-DBD58C7F97BD v1

SYS600 full graphics in pictures, partly also in dialogs, are realized using SCIL graphics commands.
There are SCIL commands for drawing various types of graphical elements, such as points, lines,
polylines and polygons, arcs, circles, ellipses, boxes (rectangles), and texts. The SCIL graphics
commands specify the geometry of the graphical elements, while the location and size, as well as
other features, are given as arguments.

The graphics commands can be included in any SYS600 picture program (see Section 4.1.) and in
the methods of the dialogs and dialog items. The BACKGROUND program of a picture contains the
graphics commands generated by the picture editor. As a rule, this program should not be edited
manually. Context dependent graphics in the background can be written in the DRAW program. Like
picture commands and Visual SCIL commands (Section 9), the graphics commands are not allowed
in command procedures, unless they are executed by #DO commands or DO functions situated in
user interface objects. The graphics commands are described in Section 11.2.

11.1.1 Graphics contexts GUID-FEBB05D5-7918-4F48-B981-F72661D37946 v1

The features of the graphical elements (color, type of line, line width, font, etc.) are defined by
graphics contexts, which are identified by integer numbers. A graphics context is a series of
properties, called "components", such as the ones mentioned. Several commands can use the same
graphics context, though all properties are not used by all graphics commands. The graphics
contexts are described in Section 11.3.

11.1.2 Graphics canvas GUID-3B2A2535-E818-42D8-8888-FEB820D488D7 v1

The graphical elements are displayed in the user interface object (picture, picture function, dialog
item) chosen as graphics "canvas". By default, the canvas is the picture or Visual SCIL object where
the graphical commands are situated.

Any picture and picture function can be chosen as graphics canvas. However, regarding the dialogs,
only certain types of dialog items can contain graphics elements. These are the dialog items that
allow the display of images (have the image attribute).

The location of a graphical element is given by x,y coordinates related to the home position of the
canvas. The upper left corner of the picture or picture function where the element will be displayed.
As the resolution of screens varies, the graphics commands use a screen independent coordinate
system. The coordinate system can contain SCIL coordinates or VS coordinates. The SCIL
coordinate system is fixed by a scaling factor. By means of an input command, the coordinates can
be read from the mouse position. Refer to Section 11.4. to learn about the SCIL and VS coordinates,
and the mouse input commands.

11.1.3 Miscellaneous GUID-97B2A869-A9D6-4FBE-927B-33E332A5A153 v1

The context definitions, canvas selection and scaling can be temporarily stored and restored within
the same picture, see Section 11.5.

MicroSCADA X SYS600 10.5 319


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

The display of the graphics on screen can be controlled by some display handling commands
(Section 11.5.2).

11.2 Full graphics SCIL commands GUID-9DE16B5D-EE8C-4B4E-96B4-649A3C594DC2 v1

11.2.1 Drawing graphical elements GUID-03519240-D175-4F27-8349-535CC636F569 v1

The commands below draw graphical elements on screen, in the user interface object selected for
canvas (default = the same object as where the commands are situated). Coordinate system is
different in pictures and in VS objects. The command .COORDINATE_SYSTEM is described in
Section 11.4.

The color and other features of the elements are fixed by the graphics contexts. The graphics
contexts are described in Section 11.3.

In most cases, several elements can be drawn with one command by giving vectors for coordinates
and sizes. If one coordinate or size is a scalar while the other one is a vector, the scalar argument is
handled as a vector with all elements equal, for example .POINT 0, (100,200) is equivalent to .POINT
(0,0), (100,200). If the coordinates fall outside the canvas (that is they are negative or too large), they
will still affect the shape of the graphical element. The part of the graphical element that falls outside
the canvas will not be displayed.

In the command syntax descriptions below, all arguments given in lower case letters can be SCIL
expressions of the data type required for the respective argument.

11.2.1.1 .ARC [[scope,]n :] x,y, r, a1,a2 [,FILL] GUID-58A93A67-56EA-4A9A-A208-50E9F971747E v1

Draws one or several arcs as circle segment arcs.

'scope' The scope of the context (see Section 11.3).


'n' Graphics context number, 0 ... 20 or 0 ... 50 depending on the scope. Default = 0. Used
components: FUNCTION, FOREGROUND, BACKGROUND, LINE_WIDTH,
LINE_STYLE, CAP_STYLE, DASH_OFFSET, DASH_LIST, ARC_MODE. See Section
11.3.
'x,y' The coordinates of the center of the circle. Real, integer or vector of real and integer
elements.
'r' The radius of the circle given in coordinate units, see Section 11.4. Real, integer or
vector of real and integer elements.
'a1' The angle from where the arc starts, given in degrees increasing counter-clockwise
from horizontal 0 value. Real, integer or vector of real and integer elements. See Figure
19.
'a2' The angle of the arc given in degrees. If a2 is positive, the arc is drawn counter-
clockwise. Otherwise, it is drawn clockwise. Real, Integer or vector of real and integer
elements. See Figure 19.

If the FILL option is given, the arc is filled according to the ARC_MODE component of the graphics
context.

320 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

GUID-7D146BB8-8082-4A11-8AD1-E9C4E55B69C1 V1 EN-US

Figure 19: Drawing an arc with the .ARC command

11.2.1.2 .BOX [[scope,]n :] x,y, width, height [,FILL] GUID-9B1E38ED-30FC-4649-A66E-C6B010E322C7 v1

Draws one or several boxes (rectangles).

'scope' The scope of the context, see Section 11.3.


'n' Graphics context number, integer 0 ... 20 or 0 ... 50 depending on the scope. Default =
0. Used components: FUNCTION, FOREGROUND, BACKGROUND, LINE_WIDTH,
LINE_STYLE, CAP_STYLE, JOIN_STYLE, DASH_OFFSET, DASH_LIST. See Section
11.3.
'x,y' Integer or real, or vector of integer or real data. The coordinates of the upper left corner
of the rectangle.
'width' Integer or real or vector of integer or real data. The width of the rectangle given in
coordinate units, see Section 11.4.
'height' Integer or real or vector of integer or real data. The height of the rectangle given in
coordinate units, see Section 11.4.

If the FILL option is given, the box is filled (in the FOREGROUND color).

11.2.1.3 .CIRCLE [[scope,]n :] x,y, r [,FILL] GUID-0722B2ED-29D9-40C0-94A2-F16B50A458D2 v1

Draws one or several circles.

'scope' The scope of the context, see Section 11.3.


'n' Graphics context number, integer 0 ... 20 or 0 ... 50 depending on the scope. Default =
0. Used components: FUNCTION, FOREGROUND, BACKGROUND, LINE_WIDTH,
LINE_STYLE, CAP_STYLE, DASH_OFFSET, DASH_LIST. See Section 11.3.
'x,y' Integer or real data, or integer or real vector. The coordinates for the center of the
circle.
'r' Integer or real data, or integer or real vector. The radius given in coordinate units, see
Section 11.4.

If the FILL option is given, the circle is filled.

11.2.1.4 .ELLIPSE [[scope,]n :] x,y, a,b [,FILL] GUID-0163BA8B-46A4-4DB0-9BBF-161B01C1BB72 v1

Draws one or more ellipses.

MicroSCADA X SYS600 10.5 321


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

'scope' The scope of the context, see Section 11.3.


'n' Graphics context number, 0 ... 20 or 0 ... 50 depending on the scope. Default = 0. Used
components: FUNCTION, FOREGROUND, BACKGROUND, LINE_WIDTH,
LINE_STYLE, CAP_STYLE, DASH_OFFSET, DASH_LIST
'x,y' Integer or real data, or integer or real vectors. The coordinates of the center of the
ellipse.
'a,b' Integer or real data, or integer or real vectors. The axes of the ellipse given in
coordinate units, see Section 11.4.

If the FILL option is given, the ellipse is filled.

11.2.1.5 .IMAGE x, y, w, h, filename, tag_1[, tag_2[, tag_3[, tag_4] ] ] GUID-539B61D0-B541-45D2-9664-85F226086972 v2

.IMAGE command draws a VS_IMAGE object into the current window or VS object.

'x' Real, x coordinate


'y' Real, y coordinate
'w' Real, width, 0 ... 32 767
'h' Real, height, 0 ... 32 767
'filename' Text, vso file name
'tag_1' Text, tag name within the vso file, image to be used when 8 x 10 font is used.
'tag_2' Text, tag name within the vso file, image to be used when 12 x 15 font is used.
'tag_3' Text, tag name within the vso file, image to be used when 16 x 20 font is used.
'tag_4' Text, tag name within the vso file, image to be used when 20 x 25 font is used.

The current coordinate system is SCIL, the coordinates x and y define the position of the upper left
corner of the image, otherwise the lower left corner.

'w' and 'h' specify the size of the rectangle the image is drawn into, the image is scaled to fill the
rectangle.

If 'w' is 0, no horizontal scaling is done. If 'h' is 0, no vertical scaling is done.

'filename' specifies the VSO file where the image is stored.

At least one image must and up to 4 images may be specified in the command. The one used in
drawing depends on the size of the current MicroSCADA font. If no image is specified for the current
font size, the image for the next smaller font is used. If there is no image for smaller fonts, the image
for the next larger font is used. When an image for a wrong font size is used, it is scaled in proportion
to font sizes (if 'w' and/or 'h' is 0).

11.2.1.6 .LINE [[scope,]n :] x1,y1, x2,y2 GUID-834AA66C-0C22-4282-8360-DD1CABE756A2 v1

Draws one or more lines from (x1,y1) to (x2,y2).

'scope' The scope of the context, see Section 11.3.


'n' Graphics context number, integer 0 ... 20 or 0 ... 50 depending on the scope. Default =
0 Used components: FUNCTION, FOREGROUND, BACKGROUND, LINE_WIDTH,
LINE_STYLE, CAP_STYLE, DASH_OFFSET, DASH_LIST. See Section 11.3.
'x1,y1' Integer or real, or vector of integer or real data. The coordinates of the start point. See
Section 11.4.
'x2,y2' Integer or real, or vector of integer or real data. The coordinates of the end point. See
Section 11.4.

322 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

11.2.1.7 .POINT [[scope,]n :] x,y, [RELATIVE] GUID-DDA39FEF-1383-4C99-81BF-4DF8BE2EC90F v1

Draws one or several points of one pixel's size at the coordinates (x,y). If any of x or y or both are
vectors, and the option RELATIVE is given, the first point is taken as canvas relative, the next one as
relative to the previous one, etc.

'scope' The scope of the context, see Section 11.3.


'n' Graphics context number, integer 0 ... 20 or 0 ... 50 depending on the scope. Default: 0.
Used components: FUNCTION, FOREGROUND. See Section 11.3.
'x,y' Integer or real, or vector of integer or real data. coordinates for the point, see Section
11.4.

11.2.1.8 .POLYLINE [[scope,]n :] x,y [,RELATIVE] [,FILL] GUID-23B596EC-83DC-4635-8F84-30A36101735C v1

Draws a polyline or a polygon.

'scope' is the scope of the context, see Section 11.3.


'n' Graphics context number, integer 0 ... 20 or 0 ... 50 depending on the scope. Default =
0. Used components: FUNCTION, FOREGROUND, BACKGROUND, LINE_WIDTH,
LINE_STYLE, CAP_STYLE, JOIN_STYLE, DASH_OFFSET, DASH_LIST.
'x' real or integer, or vector with real and integer elements, the x-coordinates in SCIL or
VS coordinate units.
'y' real or integer, or vector of real and integers, the y-coordinates in SCIL or VS
coordinate units.

The corresponding elements in the x and y vectors are taken as x,y-coordinates (see Figure 20). The
command draws a line between each of the coordinates.

If the RELATIVE option is included in the argument list, the first coordinate pair is placed relative to
the upper left corner of the canvas and each of the following coordinates are drawn relative to the
previous one.

If the first and last point coincide, the polyline will form a closed figure (a polygon), where the end
points are joined according to the JOIN_STYLE component of the graphical context.

If the FILL option is included in the argument list, the polygon outlined will be filled (with the
FOREGROUND color). In this case, the polyline is always closed.

GUID-9E23C605-9F31-4ADD-B95B-CE2E6F72E9CE V1 EN-US

Figure 20: Drawing a polyline with .POLYLINE

11.2.1.9 .TEXT [[scope,]n :] x,y, text [,FILL] [,align] GUID-DB00F3A1-15D3-4C5D-85DF-309AD6525C0D v1

This command draws horizontal text starting at (x,y). The size and font of the texts is determined by
the graphics context.

MicroSCADA X SYS600 10.5 323


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

'scope' The scope of the context, see Section 11.3.


'n' Graphics context number, integer expression 0 ... 20 or 0 ... 50 depending on the
scope. Default = 0. Used components: FUNCTION, FOREGROUND, BACKGROUND,
FONT. See Section 11.3.
'x,y' Integer, real or vector of integer or real. The coordinates of the start point of the text.
The starting-point (x,y) defines the location of the origin pixel of the first character (if left
alignment). The location of the origin pixel is font dependent. For the MicroSCADA
semi-graphic font, it is the upper left corner of a character.
'text' A SCIL expression of type text or a text vector.
'align' The alignment of the text: LEFT, RIGHT or CENTER. The default is LEFT, if the font is
a left-to-right font, and RIGHT if the font is a right-to-left font (e.g. Hebrew).

When multiple lines are drawn, i.e. 'text' is a text vector, the x,y coordinates can be vectors with the
coordinates for each new line or they can be scalars. In the latter case, the text lines are displayed
under one another starting from x,y with a line space adjusted to the font characteristics.

If the FILL option is given, the background of the text is filled with the BACKGROUND color of the
graphics context, otherwise the background is transparent.

11.3 Graphics contexts GUID-F0446616-84D6-46A1-8884-58287783190A v1

11.3.1 General GUID-E722B16B-8D4C-4486-989D-585EF9F15B20 v1

A graphics context is a collection of components (Section 11.3.3.) each of which define a graphical
property, for instance, background color, foreground color, font. A picture contains a number of
graphical contexts identified by a number. The context numbers are used as arguments in the
graphical commands. The maximum number of graphics contexts that can be used in one picture is
limited to 2 000.

The defined graphics contexts (together with the canvas selection and the scaling) can be
temporarily stored and restored, see Section 11.5.

11.3.1.1 Scope of graphics contexts GUID-F20F6630-E0CC-4FFF-9B64-CB36E5470B78 v1

The scope of a graphics context is the set of objects where the context applies. A graphics context
can be defined for a single object (picture, dialog object), for a group of objects, or for all objects
used in the monitor. There are five different scopes, each of which can contain a number of graphics
context definitions. In the context definition commands, the scope is given by a text, a single letter or
a word as follows:

"C" or "CURRENT" The scope is the object (picture or Visual SCIL object) containing the .GC
command. Max. number of contexts: 20.
"P" or "PARENT" The scope is the parent object of the object in which the context is defined
with .GC. Max. number of contexts: 20.
"R" or "ROOT" The scope is the root object (main dialog, picture container or main picture).
Max. number of contexts: 20.
"M" or "MONITOR" The scope is all object used in the monitor. Max. number of contexts: 50.
This scope is reserved for LIB 500 pictures.
"U" or "USER" The scope = all objects shown in the monitor. Max. number of contexts: 50.
This scope is for use in the application pictures.

The number of the context together with its scope identify the context and distinguishes it from other
contexts with different context number or scope.

324 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

When a part picture is shown, it inherits the contexts of its parent picture. However, changes in the
contexts of the parent picture do not affect the contexts of the part pictures which are already
displayed on screen. Likewise, the contexts are inherited downwards in the hierarchy of a dialog
system.

11.3.1.2 Default settings GUID-CB194650-0F41-4A90-ADCE-ADEFD85089E4 v1

As long as no component definitions have been done for a context in a certain scope, all the
components have the default values mentioned in the component descriptions Section 11.3.3. The
contexts (except number 99) can be modified any time with the commands described in Section
11.3.2.

Context number 99 contains the default settings of the components. This contexts cannot be
changed. It contains the following components:

FUNCTION "COPY"
FOREGROUND "WHITE"
BACKGROUND "BLACK"
LINE_WIDTH 0
LINE_STYLE "SOLID"
CAP_STYLE "BUTT"
JOIN_STYLE "MITER"
FONT "" (semi-graphic)
ARC_MODE "PIESLICE"
NAME ""

GC number 99 may only be used as a source in GC copy. For self-documentation, a predefined


constant name DEFAULT_GC may be used instead of number 99 (DEFAULT_GC == 99).

Context number 0 is the default context in those cases where no context number is given in the
graphics commands.

11.3.2 Defining graphics contexts GUID-5976CBA8-BF27-4271-9B47-50B99959FBCC v1

The following three commands are used for the modification of graphics contexts. The graphics
contexts can be read with a SCIL function described in Section 11.3.5.

11.3.2.1 .GC [[scope,]n [=[scope,]m]]:[[component = value]...[,component = value]] GUID-8F5EA0E7-7A6D-434B-9F81-DDBEA0A6F634 v1

Modifies the graphics context number 'n'.

MicroSCADA X SYS600 10.5 325


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

'scope' A text which specifies the scope of the context, i.e., the objects (pictures, and Visual
SCIL objects) where the context is valid. 'scope' can take the values "C" or
"CURRENT", "P" or "PARENT", "R" or "ROOT", "M" or "MONITOR", "U" or "USER".
See Section 11.3.1. Default value = "C".
'n' The number of the graphics context, integer 0 ... 20 or 0 .. 50. This number is used in
the graphical commands, see Section 11.2. Default: 0.
'm' The number of another graphics context which is copied to the current one before
modification. Integer, 0 ... 20 or 0 ... 50.
'component' The name of a component to be modified. The component names can be given in the
complete or abbreviated form, see Section 11.3.3.
'value' A SCIL expression, the value assigned to the component. The allowed data types are
mentioned in the component descriptions in Section 11.3.3.

The modification concerns all graphical elements subsequently drawn with the context in question. It
does not affect the graphical elements drawn previously with the same context number. Those
components which are not included in the component list are not affected by the command. The
graphics contexts are inherited to the pictures shown in windows and to the picture functions.

The ROOT, MONITOR and USER scopes represent separate sets of contexts, while the CURRENT
and PARENT scopes can mean the same or separate sets of contexts depending on the situation.

Example:

("C",5), ("R",5), ("M",5) and ("U",5) are all different graphics contexts. The contexts ("C",5) and ("P",5)
may be the same or different contexts. When a part picture is shown, its context is the same as the
one of the parent (i.e. CURRENT = PARENT). If the parent's context is changed later, they become
two different contexts and the parent's context is referred to as ("P",5).

The PARENT scope could, e.g., be used in a general purpose tool designed to change the
appearance of any picture it is used in. The MONITOR and USER scopes are suitable for defining
monitor specific graphics contexts in the start program of the APL_INIT picture, which is shown each
time a monitor is mapped for an application (either at system start-up or later).

Example:

.GC 0 = DEFAULT_GC : FOREGROUND = "RED"

11.3.3 Components of graphics contexts GUID-478B8FE7-011A-40D0-A75A-9159D7C4AC36 v1

This sub-section describes the components included in the graphics contexts. The components are
listed in alphabetical order.

The components are assigned values by means of the commands described in Section 11.3.2. The
values are given as SCIL expressions of the allowed data types. From the start, the components
have the default values given below. In the context defining commands, the component names can
be given in complete form or in the abbreviated form found to the left in the description below.

11.3.3.1 AM ARC_MODE GUID-831B8096-1F7A-4400-9509-931F8D54AFC6 v1

This component specifies how filled arcs are drawn, either as sectors or segments.

Value: "CHORD" The end points of the arc are connected and the resulting segment is
filled.
"PIESLICE" The end points of the arc are connected in the center of the circle
and the resulting sector is filled.
Default: "PIESLICE"

326 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

11.3.3.2 BG BACKGROUND GUID-317A8106-9AB1-4136-BC0A-6769108213DB v1

Specifies the "background color" of the full graphic lines and text. This BACKGROUND color is used
in the following cases:

• In the gaps of double dashed lines


• As the background of "filled" texts

Values: The color can be given in the following four ways (see Section 11.3.4):
With a color name given as a text, e.g., "LIGHT BLUE"
With a RGB number given as a vector of three elements, e.g., (10000,20000,30000)
With a color number given as an integer expression, e.g. 5
With scope and color number given as a vector of two elements:
(scope,color_number), e.g., ("M",5).
Default value: "BLACK"

11.3.3.3 CS CAP_STYLE GUID-E21DFF2D-6C6D-42CE-81D4-3D5BE693997D v1

Specifies the endpoints of the line, see Figure 22.

Values: "BUTT" The line is cut off in a 90° angle to the line direction at the end
point.
"NOTLAST" The same as "BUTT", but the line is cut off one pixel before the
end point.
"PROJECTING" The line is cut off in the same way as "BUTT" half its width past
the endpoint.
"ROUND" The line end is rounded in a half circle with r = half its width
past the endpoint.
Default value: "BUTT"

"PROJECTING" and "ROUND" are meaningful only for lines with a width larger than 1
pixel.

11.3.3.4 DL DASH_LIST GUID-53498DF1-51AB-42CB-A275-74BB8D8CF599 v1

Specifies the length of dashes and gaps when drawing dashed lines.

Value: Vector of even length. The odd indexes define the lengths of dashes and the even
indexes the lengths of the gaps. The lengths are given in coordinate units, see Section
11.4.
Default: The dashes as well as the gaps are four pixels long.

GUID-F6747BAC-70E5-443A-A73E-473E285365ED V1 EN-US

Figure 21: Wide lines are drawn centered in relation to the start and end points

MicroSCADA X SYS600 10.5 327


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

GUID-B5961E68-F1A5-42CB-8D48-09938C374839 V1 EN-US

Figure 22: The CAP_STYLE component

GUID-BA4FE396-E9CF-4E50-9314-36DA25CF27CB V1 EN-US

Figure 23: The JOIN_STYLE component

1.3.3.5 DO DASH_OFFSET GUID-032B2436-4B11-4BA1-938B-371658D029BC v1

Specifies the position in the dash pattern where to start a dashed line. For example, if DASH_LIST
== (5,2) and DASH_OFFSET == 5, the line starts with the gap.

Value: Positive integer


Default value: 0

11.3.3.6 FT FONT GUID-C2A5FE12-32D0-4165-BF94-47F06478C33D v1

Specifies the X-windows name of the font used to draw a text.

Value: The value can be given in the following four ways (see Section 11.3.4):
With a font name given as a text, e.g. "KANJI_24"
With a font number given as an integer expression, e.g. 3.
With scope and font number given as a vector of two elements: (scope,font_number),
e.g., ("M",3).
As a list with one or several of the following attributes: FAMILY (FA), POINT_SIZE
(PS), FACE (FC).
Default: The MicroSCADA semi-graphical font which is called "MICROSCADA-
SEMIGRAPHICS".

328 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

11.3.3.7 FG FOREGROUND GUID-3345A027-141E-4616-9CAB-6795CA5198D2 v1

This component specifies the color in which the graphical element is displayed.

Values: The color can be given in the following four ways (see Section 11.3.4.):
With a color name given as a text, e.g., "LIGHT BLUE".
With a RGB number given as a vector of three elements, e.g., (10000,20000,30000).
With a color number given as an integer expression, e.g. 5.
With scope and color number given as a vector of two elements:
(scope,color_number), e.g., ("M",5).
Default value: "WHITE"

11.3.3.8 FU FUNCTION GUID-1CF818F2-52C4-4224-B644-7F2F9B703DBF v1

This component states how the color (RGB values) of added pixels ('new') is combined with the color
of already existing pixels ('old') on screen by means of logical operators.

Value: "CLEAR" 0
"AND" new AND old
"ANDREVERSE" new AND (NOT old)
"COPY" new
"ANDINVERTED" (NOT new) AND old
"NOOP" old
"XOR" new XOR old
"OR" new OR old
"NOR" (NOT new) AND (NOT old)
"EQUIV" (NOT new) XOR old)
"INVERT" (NOT old)
"ORREVERSE" new OR (NOT old)
"COPYINVERTED" (NOT new)
"ORINVERTED" (NOT new) OR old
"NAND" (NOT new) OR (NOT old)
"SET" 1
"SCIL_XOR" Proprietary implementation of XOR, preserved for
compatibility
Default value: "COPY"

Examples:

"COPY" means that the added color replaces the former color.

Using "SCIL_XOR" or "XOR" repeatedly on the same graphic element alternately draws and deletes
the graphics.

11.3.3.9 JS JOIN_STYLE GUID-6B99CC1A-99CB-4D1C-8A41-BF972FE9DA45 v1

Specifies how corners are drawn for wide lines drawn with a single graphics command, see Figure
23.

MicroSCADA X SYS600 10.5 329


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

Values: "MITER" The outer edges of the two lines are extended to meet in one point.
"ROUND" The lines are joined by a circular arc with r = half the line width
centered on the join point.
"BEVEL" The outer edges of the lines are joined at the end points.
Default: "MITER"

11.3.3.10 LS LINE_STYLE GUID-3BDFDE5C-7B5D-4951-A307-8A165977BDF1 v1

Specifies how the line is drawn and in which colors.

Values: "SOLID" The line is continuous (without dashes) and drawn in the
FOREGROUND color.
"ONOFFDASH" The line is dashed with the dashes drawn in the foreground color.
"DOUBLEDASH" The line is dashed with the dashes drawn n the foreground color and
the gaps between the dashes in the background color.
Default value: "SOLID"

11.3.3.11 LW LINE_WIDTH GUID-537F8224-0429-4D1B-AFD2-F6C72218F2D4 v1

Specifies the width of the line in coordinate units (see Section 11.4). Wide lines are drawn centered
between the start and the end point given in the drawing command, see Figure 21.

Values: Integer or real, >= 0.


Default value: 0

LINE_WIDTH=0 specifies the width to one pixel regardless of the scaling. LW=0 is the
most efficient line width and fastest to draw.

11.3.3.12 NA NAME GUID-9817CA9D-A1B6-4904-BDBE-739723431CAD v1

A freely chosen name of the graphics context. This component is not copied when copying a context.

Value: Text.

11.3.4 Colors and fonts GUID-822A1B29-A14B-497D-9D9C-53E0CE1B0996 v1

11.3.4.1 Colors GUID-CB00BE2D-2D2C-48A3-8066-F408CA39E053 v1

The final color of a graphical element displayed on screen depends on the FOREGROUND
BACKGROUND and FUNCTION components of the graphics context (Section 11.3.3). The colors
can be defined in four manners:

• By color names. The names of the colors in the semi-graphic pictures are: WHITE, BLACK,
RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW.
• By RGB intensities given as a vector of three elements where the first element defines the red,
the second element the green and the third element the blue intensity of the color as an integer

330 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

or real value in the range 0 ... 65 535. Consequently, for example, (0,0,0) is black and
(65535,65535,65535) is white.
• By a color mix number. A color mix number is a given small integer used to identify a color
definition. The number is defined by the .COLOR command, see below.
• With scope and color mix number given as a vector of two elements: (scope,color_number),
e.g., ("M",5).

If the operating system is not capable to provide the requested color exactly (e.g.
because the palette of the server is full due to the use of many different colors on
screen), the nearest possible color is used.

The .COLOR command below is used for creating and modifying color mix numbers, and the
COLOR function for reading the RGB values of colors.

11.3.4.2 .COLOR [scope,] number : color [,SHARED] GUID-9ED86538-277E-4662-B28B-299FA57F901F v1

The .COLOR command defines a color mix number.

'scope' The scope of the color number. The scope is given in the same way as for graphics
contexts in Section 11.3.2.
'number' Color number given as a positive integer expression. Each scope can have the
following maximal number of colors: “C": 20, "R": 20, "M": 50, "U": 50.
'color' Color definition given in one of the four manners described above.

The color mix number can be used for color selection in the graphics contexts (BACKGROUND and
FOREGROUND).

The optional argument SHARED has been preserved for compatibility reasons. It has no effect in
current implementation.

11.3.4.3 COLOR([scope,]number) GUID-EE000E35-4B32-4886-A055-DE92B5FA7813 v1

Returns the RGB values of the color specified by the arguments.

'scope' The scope of the color


'number' The number of the color
Value: Vector of three elements

Example:

#local RGB
.COLOR 1: "NAVYBLUE"
.GC : FG = 1
.BOX 100, 100, 100, 100, FILL
RGB = COLOR(1)
RGB(1) = RGB(1) + 10000
.COLOR 1 : RGB
.BOX 200, 100, 100, 100, FILL

The example creates a color mix initialized as navy blue, then draws a filled box in the selected color.
More red is added to the color and another box is drawn adjacent to the first one.

MicroSCADA X SYS600 10.5 331


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

11.3.4.4 Fonts GUID-53168B6C-B035-43DE-8DB7-4BD19908B940 v1

The font used in texts is specified by the FONT component of the graphics context (Section 11.3.3).
Fonts can be given as follows:

• With a font name given as a text, e.g. "KANJI_24".


• With a font number given as an integer expression, e.g. 3. The font numbers are defined by
the .FONT command, see below.
• With scope and font number given as a vector of two elements: (scope, font_number), e.g., ("M",
3).
• As a list with one or several of the following attributes: FAMILY (FA), POINT_SIZE (PS), FACE
(FC).

The .FONT command below defines font numbers, and the FONT function is used for reading font
numbers.

11.3.4.5 .FONT [scope,] number : font GUID-449C6BF7-A524-41B0-B7CD-E6487ABF0E80 v1

Defines a font number.

'scope' The scope of the font number. The scope is given in the same way as for graphics
contexts in Section 11.3.2
'number' Font number given as a positive integer expression. Each scope can have the following
maximal number of fonts: "C": 10, "R": 10, "P": 10, "M": 20, "U": 20. 0 = the
MicroSCADA semi-graphic font. Do not change it!
'font' Font definition given in any of the four ways allowed for the FONT component, see
Section 11.3.3.

11.3.4.6 FONT([scope,] number) GUID-0C99BDCC-6A74-455A-87C6-FE0302596699 v1

Returns the attributes of a font.

'scope' The scope of the font.


'number' The number of the font.
Value: The font function returns a list with the attributes shown in Figure 24. Each attribute has a
two-letter alias name.

332 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

GUID-B154502F-461F-46C2-AC9D-4C6E67A010B5 V1 EN-US

Figure 24: The attributes returned by the font function

NAME, NA Name
HEIGHT, HE Height (number of pixels)
ASCENT, AS Ascent (logical extent above baseline in number of pixels)
DESCENT, DE Descent (logical descent below baseline in number of pixels)
WIDTH, WI Width (width of the widest character in the font in number of pixels)
FAMILY, FA Family (the name of the font family)
POINT_SIZE, PS Point size
SCIL_SIZE, SS SCIL size
FACE, FC Face
ENCODING, EN Encoding

Note that HEIGHT is always the sum of ASCENT and DESCENT.

11.3.5 Reading graphics contexts GUID-5A45C099-4B07-4863-94A8-C64FFA756765 v1

The defined graphics contexts can be read with the following SCIL functions:

11.3.5.1 GC([scope,]n) GUID-2429D8A1-99A4-4A1C-83BF-9A974609DDD8 v1

The function returns the values of the components of the context.

MicroSCADA X SYS600 10.5 333


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

'scope' The scope of the context, see Section 11.3.


'n' Graphics context number, integer 0 ... 20 or 0 ... 50 depending on the scope, see
Section 11.3.2.
Value: List, where the abbreviated names of the components are the attributes.

Example:

@GC_DEF = GC(0)
!SHOW INFO "CURRENT DEFAULT FONT IS " + GC_DEF:VFT

11.3.5.2 COLOR_IN([scope,] n) GUID-0623602E-F679-4A7D-9BC9-CB23BA0C51E2 v1

The function returns the RGB values of the foreground color in the context as a vector of three
elements.

'scope' Scope of the context.


'n' Graphics context number.

11.3.5.3 FONT_IN([scope,] n) GUID-91121224-48E3-4705-B635-89B501AD795C v1

The function returns a list value with the same attributes as for the FONT function, see Section
11.3.4.

'scope' Scope of the context.


'n' Graphical context number.

11.4 Graphics canvas GUID-6F06FDAF-5410-4D1F-9450-E54CC108E041 v1

11.4.1 General description GUID-228E2410-19E8-426A-A565-EF4E22CCDBAF v1

The graphical elements are displayed on the selected canvas which can be:

• The object (picture, picture function, dialog object) which contains the command (default).
• The root object - the main picture or the main dialog.
• A named window or dialog object.
• The parent object of the object where the command is executed.

The canvas can be selected with the commands in next section Selecting Canvas (together with the
context definitions and the scaling factor) can be temporarily stored. See Section 11.5.

11.4.2 Selecting canvas GUID-14DE23E8-999A-4D7F-B2DF-839C480114EF v1

If not changed with any of the commands listed below, the canvas for the graphics commands is the
object where the commands are executed. Use the following commands in order to get the elements
displayed on another canvas:

11.4.3 .CANVAS object GUID-90889A99-D924-4F9A-91CF-886BD8F94D8D v1

The command selects the named picture object (window picture or picture function) or dialog object
(dialog or dialog object) - for canvas.

'object' A picture reference or a Visual SCIL object reference, see Section 6.

334 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

11.4.4 .CANVAS ROOT GUID-E809F041-117E-4C4D-AEB3-8399C9E49B30 v1

The root object is used as canvas. In a picture the root object is the main picture. In a dialog system,
the root is the main dialog or picture container.

11.4.5 .CANVAS PARENT GUID-E535CF34-8434-4E87-B1CF-5FBBEBF036EE v1

The parent object is used as canvas. In a picture the parent object is the parent picture of the current
window picture or picture function. In a dialog system, the parent is the parent object of the current
object.

11.4.6 .CANVAS CURRENT GUID-54D38B4F-726C-4625-95A8-AEC2A7FE7311 v1

The current object is used as canvas, i.e., the object containing the graphics command. Hence, this
command returns the canvas to the default.

11.4.7 .COORDINATE_SYSTEM coordinate_system GUID-E9EDB41E-AF00-4D9A-A26E-CC1DA038470E v1

Specifies the coordinate system to be used in graphic drawing commands and mouse handling
commands.

The coordinate system is specified by one of the following key words: SCIL, VS.

Changes of the coordinate system with the COORDINATE_SYSTEM command are valid only within
the SCIL program where the change was made.

Example:

.COORDINATE_SYSTEM SCIL

11.4.8 The SCIL coordinate system GUID-EA3E4A36-AB29-42FD-89C7-B1CCF048234C v1

Within the SCIL coordinate system, the (0,0) coordinate lies in the upper left corner of the canvas.
The relation between SCIL coordinates and pixels on screen depends on the semigraphic font used
in the SYS600 Monitor and on the scaling factor used by the drawing commands. See Figure 25.
GUID-66EA9594-7AA9-44B7-801F-B8CDE28E2351 v1
pixel_coord = SCIL_coord *MicroSCADA_Monitor_Width / scaling_factor

where
pixel_coord = the pixel coordinates as displayed on screen.
SCIL_coord = the coordinates given in the graphics SCIL command.
MicroSCADA_Monitor_Width = 80 * Width of semigraphic character
= 80*8 or 80*12 or 80*15.
scaling_factor = the scaling factor. The default scaling factor is 1280. The scaling factor can
be changed with the .SCALING command see Section 11.4.11.

MicroSCADA X SYS600 10.5 335


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

GUID-DF440F94-6D83-472F-A7E0-D85983B91657 V1 EN-US

Figure 25: The SCIL coordinate system

11.4.9 The Visual SCIL coordinate system GUID-43E9B06C-7C4D-407A-BD0C-3F504B84982A v1

Within the Visual SCIL coordinate system, the (0,0) coordinate is situated in the lower left corner of
the canvas. The Visual SCIL coordinates are equal to the pixel positions within the canvas.

When handling dialogs, the origin of the coordinate system lies at the bottom left corner of the
screen. When handling dialog items, the origin is in the lower left corner of the parent object. A unit in
the coordinate system is a pixel.

Coordinates are also used, for example, when giving a position with the _GEOMETRY attribute and
when reading a position with the _GET_POINTER_POS method. For more information on VS
coordinates, see Section 2.4 in the Visual SCIL manual.

The Graphics Contexts components LW, DL, DO are defined according to the active coordinate
system. These Graphics Contexts components are not affected by the coordinate system used at
drawing.

Example:

.COORDINATE_SYSTEM VS
.GC : LW = 5
.LINE 10,10,100,100 ;line width is now 5 units according to
;the VS coordinate system (pixels).
.COORDINATE_SYSTEM SCIL
.LINE 10,10,100,100 ;line width is still 5 units according to
;the VS coordinate system (pixels),
;because the Graphics Components were defined under
;VS coordinate system

11.4.10 Changing Scaling Factor GUID-92B1E5A2-EFBC-443B-86E0-00171C44628F v1

The scaling factor can be changed by the following command:

11.4.11 .SCALING [s] GUID-81A24531-DAD9-427D-A41E-B38830CD6403 v1

Sets the scaling factor to be used in the subsequent SCIL graphics commands.

336 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

's' is an integer or real expression, the scaling factor. If 's' = 0, the coordinates are taken
as pixel coordinates of the screen where the graphical element is displayed. If 's' is
omitted, the scaling factor is returned to the default (= 1 280).

For example, a graphical element programmed with s = 0 will have different sizes depending on the
resolution of the screen where it is shown.

The scaling factor can be temporarily stored (together with context definitions and canvas selections)
by the commands in Section 11.5. Note that the scaling factor only affects the SCIL coordinate
system.

11.4.12 Mouse input GUID-F20DCE6D-ADCA-446C-B2BF-EA7EC9486795 v1

The coordinates can be read from the cursor position with the .MOUSE command. The .MOUSE
command can be used with or without tracing. If tracing is OFF, the command reads the cursor
position and the current mouse button states. If tracing is on, the command notes the following
mouse events: button press and release, movement of mouse (provided that motion event is on, see
the .MOUSE ON command). By means of the .MOUSE ON and .MOUSE OFF commands, tracing is
switched on and off (default = OFF).

The .MOUSE DISCARD command is used to discard the pending mouse clicks.

11.4.13 .MOUSE x, y [, button [, buttons [, RELATIVE] ] ] GUID-5CFAEA4F-A731-47B2-AF05-0D2EE8A4F84A v1

Reads the SCIL coordinates of the cursor and the mouse button states.

'x' and 'y' Two variables that get the value of the x and y coordinates respectively (SCIL or VS
coordinates).
'button' A variable that gets the value of the pressed or released mouse button number (1, 2 or
3). If the registered mouse event was a motion event, the variable gets the value 0. If
tracing is OFF, the variable gets the value 0. If a local variable by the name exists, it is
used, otherwise a global variable.
'buttons' A variable that receives the current mouse button states if tracing is OFF, or the button
states immediately before the mouse event if tracing is ON. The states are returned as
a bit mask, where each bit number represents a mouse button. The bit values have the
following meanings: 0 = the button is released, 1 = the button is held down. If a local
variable by the name exists, it is used, otherwise a global variable.
RELATIVE An optional keyword. If RELATIVE is given as the last argument of the command, the
coordinates are relative to the current canvas (If the canvas is not explicitly set, the
window or picture function executing the .MOUSE command acts as the current
canvas). If RELATIVE is not given, the coordinates returned by .MOUSE command are
relative to the part picture (picture shown in window) executing the command.

Examples:

.MOUSE X, Y, RELATIVE
.MOUSE X, Y, BUTTON, RELATIVE
.MOUSE X, Y, BUTTON, BUTTON_MASK, RELATIVE

11.4.14 .MOUSE ON [,MOTION], .MOUSE OFF GUID-B8C47176-D122-4A50-905C-E08A0DD88129 v1

.MOUSE ON sets the program in tracing state. If the MOTION option is given, also the motion of the
cursor is traced.

.MOUSE OFF ends the tracing state. The tracing state is automatically ended when a program is
completed.

Example:

MicroSCADA X SYS600 10.5 337


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 11 1MRK 511 664-UEN Rev. A
Graphics primitives

The following SCIL sequence draws a line segment from (0,0) to the position pointed by the user.
The final position is given by releasing button 1.

.MOUSE ON
@B1_PRESSED = FALSE
#LOOP NOT %B1_PRESSED
.MOUSE X, Y, BUTTON, BUTTONS
#IF (%BUTTON ==1) AND (BIT(%BUTTONS , 1)==0) #THEN #BLOCK
@B1_PRESSED = TRUE
#BLOCK_END
#LOOP_END

The program sequence above waits until mouse button 1 is pressed, then the following is executed:

.MOUSE ON, MOTION


.GC : FUNCTION = "XOR"
.LINE 0, 0, %X, %Y
#LOOP %B1_PRESSED
.MOUSE NEW_X, NEW_Y, BUTTON, BUTTONS
.LINE 0, 0, %X, %Y
#IF %BUTTON == 1 #THEN @B1_PRESSED = FALSE
#ELSE #BLOCK
.LINE 0, 0, %NEW_X, %NEW_Y
@X = %NEW_X
@Y = %NEW_Y
#BLOCK_END
#LOOP_END

The line is drawn and erased until the mouse button is released, then the following is executed:

.GC : FUNCTION = "COPY"


.LINE 0, 0, %NEW_X, %NEW_Y
.MOUSE OFF

The line is drawn from (0,0) to the coordinates given be the variables %NEW_X and %NEW_Y.

11.4.15 .MOUSE DISCARD GUID-CA115C8C-C548-482A-9160-E276B63A84FF v1

.MOUSE DISCARD discards all the pending mouse clicks, i.e. the mouse clicks that have not yet
been processed.

This command may be used after a lengthy calculation to discard the mouse clicks that are done by
an impatient operator.

After a new dialog has been displayed, this command may be used to cancel any mouse clicks that
may have been done before the dialog was seen.

Unlike other .MOUSE commands, .MOUSE DISCARD may be used both within a main dialog
context and within a picture container context (the others work only in a picture container context).

11.5 Miscellaneous graphical commands GUID-CDB542E9-F235-45BA-B30B-B30D366C9189 v1

11.5.1 Storing and restoring selections GUID-FD34FA6E-2107-4FA5-AEAE-E342F0AA4871 v1

11.5.1.1 .PUSH, .POP GUID-0FBBAAB4-8DB1-475F-93F7-D0D19BC8075C v1

The commands .PUSH and .POP are used for storing temporarily the context definitions, the scaling
factor and the canvas selection. They are useful when there is a need to store standard selections
while making other selections, and then restore the standard selections after a while. They are used,

338 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 11
Graphics primitives

for example, when a subroutine uses specific values for canvas, scaling and graphics contexts,
which should not interfere with the picture that executes the subroutine.

.PUSH stores the current canvas selection, scaling factor and graphics contexts definitions. .POP
restores the selections stored with .PUSH. The .POP command must be located in the same
program as the corresponding .PUSH command.

11.5.2 Display handling commands GUID-6EB9E71C-0485-41CA-ADEE-6E32EE0885A6 v1

11.5.2.1 .FLUSH GUID-BE14B166-C736-4A33-ACD1-EEACDB729BC4 v1

This command forces a blink timing and an immediate updating of the entire application window.
However, if there is an ongoing pending, the command has no effect. The command is rather time
consuming.

11.5.2.2 .PEND ON, .PEND OFF GUID-6E556F15-95E1-4056-BC2E-31BB3BD75D1F v1

Pending is used to prevent disturbing flickering when drawing related graphics primitives in sequence
(for example when changing position of an object in animation).

The graphics drawn after PEND ON are not shown on screen until the matching PEND OFF is
encountered. At PEND OFF the resulting output of the intervening commands is shown as a flash
(that is the drawn primitives are not displayed one by one). PEND ON and the matching PEND OFF
must be located in the same SCIL program. If a SCIL program ends while the output is pending, an
automatic PEND OFF is generated by the base software. PEND commands may be nested. In this
case, the outermost PEND OFF triggers the output.

An implicit PEND ON - PEND OFF is set by the base software around the semi-graphical
background and the draw program when a picture is displayed.

MicroSCADA X SYS600 10.5 339


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
340
1MRK 511 664-UEN Rev. A Section 12
SCIL programming guide

Section 12 SCIL programming guide GUID-244D22E8-D1EB-419B-8576-772838147545 v1

This section provides a programming guide for the most important SCIL tasks. The guide gives brief
instructions for accomplishing various tasks with SCIL and refers to the sections in this manual and
other manuals where the used SCIL elements are detailed. The following main subjects are
discussed:

• Picture handling
• Visual SCIL object handling
• Program execution
• Process supervision and control
• Alarm and event handling
• Calculations and reports
• System configuration and communication
• Application database management
• Error handling

12.1 Picture handling GUID-5AFBDC2B-AA98-4542-891D-1E328C65AC4E v1

Table 6: Loading Pictures

Task Use Comments


Loading a new picture !NEW_PIC command Section 9.3
Re-loading the previous picture !LAST_PIC command Section 9.4
Loading an alarm picture !INT_PIC command Section 9.4
The alarm picture is process
object specific and defined in the
process object definition.

Table 7: Window Handling

Task Use Comments


Showing or updating windows !SHOW command Section 9.4
Erasing windows !ERASE command Section 9.4
Showing window background !SHOW_BACK Section 9.4
Creating windows with SCIL !WIN_CREATE or !WIN_NAME Section 9.4
Positioning windows with SCIL !WIN_POS Section 9.4
Defining window expression with SCIL !WIN_INPUT or !SHOW Section 9.4
Defining window representation with !WIN_REP Section 9.4
SCIL
Defining window picture with SCIL !WIN_PIC Section 9.4
Changing window level !WIN_LEVEL Section 9.4
Reading window attributes attribute reference: {picture}.attribute Section 6.4
Writing window attributes .SET + attribute reference Section 9.3

MicroSCADA X SYS600 10.5 341


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 12 1MRK 511 664-UEN Rev. A
SCIL programming guide

Table 8: Named Programs

Task Use Comments


Executing named programs Program call: Section 6.4
{picture}.name{(arguments)}
Using named programs in expressions Program call as above. Section 6.4 Possible only for
named programs which return
values.
Building named programs which use Use the arguments ARGUMENT The ARGUMENT functions are
arguments and return a value functions to read the arguments described in Section 10. The
given in the program call. #RETURN command in Section
Use the #RETURN command to 9.2.
return a value.

Table 9: Updating Pictures

Task Use Comments


Cyclical updating Updating program. Start the Section 9.4 The updating program
updating and define the updating should not be comprehensive.
interval with the !UPDATE
command.
Event based updating #ON blocks + event object activation Section 9.2
Event object activation from
process objects requires that the
EE attribute is = 1.

Table 10: Miscellaneous

Task Use Comments


Stopping function key blinking !RESTORE Section 9.4
Hardcopy (semi-graphic) of picture !SEND_PIC Section 9.4
Closing application windows !CLOSE Section 9.4

12.2 Visual SCIL object handling GUID-F73F95F0-88D7-478D-A745-8B98F823AB7A v1

Table 11: Loading, Creating and Deleting Objects

Task Use Comments


Loading objects stored in a Visual SCIL .LOAD command Section 9.3.
object file
Creating objects with SCIL .CREATE command Section 9.3.
Deleting objects .DELETE command Section 9.3.

Table 12: Executing Methods

Task Use Comments


Executing methods from SCIL method call: Section 9.3. Such methods
{object}.method{(arguments)} which are executable with SCIL.
Using method calls in expressions Program call as above Section 9.3. Possible only for
methods which return values.
Building methods which use arguments Use the arguments ARGUMENT The ARGUMENT functions are
and return a value functions to read the arguments given described in Section 10. The
in the program call. #RETURN command in Section
Use the #RETURN command to 9.2.
return a value.

342 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 12
SCIL programming guide

Table 13: Reading and Writing Attributes

Task Use Comments


Reading attributes (functions and Attribute reference: Section 6.4
features) {object}.attribute{(arg:s)}
Modifying attributes .SET command + attribute Section 9.3. Attributes can also
reference .MODIFY command + be modified with the .LOAD
object reference + attribute list and .CREATE commands.

12.3 Program execution GUID-1CA7CCF6-66A9-4003-A18A-8CEF9FB0B665 v2

Table 14: Executing Programs

Task Use Comments


Executing command procedures #EXEC, #EXEC_AFTER Section 9.2. Also started by time
channels and event channels.
Executing named programs in pictures See above.
Executing methods in Visual SCIL See above.
objects
Executing a program written as text #DO command DO function Use Section 9.2. Section 10Section
vector, for example, in a text file TEXT_READ to read a file to a text 10
vector

Table 15: Miscellaneous

Task Use Comments


Conditional execution of program block #IF ... #THEN Section 9.2.
#ELSE_IF..... #THEN
#ELSE
Building program blocks within #BLOCK Section 9.2.
programs statements
#BLOCK_END
Executing different program blocks #CASE Section 9.2.
depending on the situation #WHEN
#OTHERWISE
#CASE_END
Executing program loops #LOOP Section 9.2.
#LOOP_END
#LOOP_WITH
#LOOP_EXIT
Declaring variables and arguments #LOCAL Section 9.2.
#ARGUMENT
Pausing the program execution #PAUSE Used in exceptional cases
User defined functions DO function with arguments in the Section 10Section 10Section 9.2.
program: read arguments with the
ARGUMENT functions. Return
values with the #RETURN
command.
Stopping program execution, possibly #RETURN Section 9.2.
returning a value

MicroSCADA X SYS600 10.5 343


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 12 1MRK 511 664-UEN Rev. A
SCIL programming guide

Table 16: Process Supervision and Control

Task Use Comments


Using process object value in Process object notation Section 6.3 Process objects are
expressions described in the Application Objects
manual.
Controlling process objects #SET command + process object Section 6.3 and Section 9.2.
notation

Table 17: Alarm and Event Handling

Task Use Comments


Alarm and event handling features Defined in the process objects, see
the Application Objects manual.
Building alarm and event lists APPLICATION_OBJECT_LIST Section 9.2. Section 10.
HISTORY_DATABASE_MANAGER
#INIT_QUERY
PROD_QUERY
Printing event and alarm information Automatically from process object Defined in process object.
or Section 9.2. Section 10. Requires a
with #PRINT command and printout picture.
PRINT_TRANSPARENT if full
graphic printout

Table 18: Calculations and Reports

Task Use Comments


Executing Command Procedures #EXEC, #EXEC_AFTER + Section 9.2. Command procedures
command procedure detailed in the Application Objects
manual.
Also: time channels, event
channels.
Acquiring Report Data #EXEC, #EXEC_AFTER + data Section 9.2. Data objects detailed
object in the Application Objects manual.
Also: time channels, event
channels.
Reading and Using Stored Data Data object notation Section 6.3
Editing report data #SET + data object notation Section 9.2.

Table 19: System Configuration and Communication

Task Use Comments


Creating base system objects #CREATE command + LIST Section 9.2. Section 10
function
Defining NET lines #SET + NET line attribute PO Section 9.2. The System Objects
manual May also be done in
preconfiguration
Creating communication system #SET + NET object and device Section 9.2. The System Objects
objects creation attribute manual May also be done in
preconfiguration
Setting system object attributes #SET + object notation Section 9.2. The System Objects
manual.
Starting PC-NET Defining link base system object The System Objects manual.

344 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 12
SCIL programming guide

Table 20: Application Database Management

Task Use Comments


Creating application objects #CREATE Section 9.2. Tools
Deleting application objects #DELETE Section 9.2. Tools
Modifying application objects #MODIFY Section 9.2. Tools
Searching among objects #SEARCH, NEXT, PREV Section 9.2. Section 10 Tools
APPLICATION_OBJECT_LIST Section 10.
Copying objects #CREATE + FETCH, Section 9.2. Section 10 Tools
PHYS_FETCH, DATA_FETCH

Table 21: Error Handling

Task Use Comments


Error handling policy #ERROR STOP #ERROR Section 9.2.
CONTINUE #ERROR IGNORE
Error handling programs In pictures: Named program named See below. See Visual SCIL User
ERROR_HANDLER Interface Design.
In Visual SCIL Objects: Error
handling method.
Reading and writing error status STATUS function SET_STATUS Section 10. The Status Codes
manual. Argument in error handling
programs

12.3.1 Error Handling in Pictures GUID-97C88DA4-AA5F-48BA-92A7-45EA613EB1A3 v1

The error handling in pictures can be defined by a named program with the name
ERROR_HANDLER. When a SCIL error occurs in a picture program, the ERROR_HANDLER
program, if it exists, is started. The following 6 arguments are transferred to the error handler and can
be used in the named program by means of the ARGUMENT functions (see Section 10.9).

• The SCIL status code (integer)


• The picture and the program where the error occurred (text) given as a picture path starting from
the main picture, for example:
GUID-3A0AE21B-55BB-4B73-8361-4AB74BAB69FC v1
.UPDATE (= the update program of the main picture)

WINDOW1/PIC_FUNC_1/WINDOW2.MY_NAMED_PROGRAM

• The erroneous SCIL line (text)


• The column position within the line (integer, may be 0)
• Current error handling policy (text), either "STOP" or "CONTINUE"
• Program line number (integer)

The error handler program is searched for in the following order:

1. The picture - main picture, window picture or picture function - where the error occurred.
2. The picture functions of the picture where the error occurred.
3. The parent of the picture where the error occurred.
4. The picture functions of the parent picture.
5. The parent of the parent picture, etc., up to the main picture.

The first error handler program found is executed.

If no error handler is found, the standard picture error message is shown on the top line of the main
picture. See the Status Codes manual.

MicroSCADA X SYS600 10.5 345


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
346
1MRK 511 664-UEN Rev. A Section 13
SCIL editor

Section 13 SCIL editor GUID-2A965E6A-DE5B-44CC-847F-BDEC85B4B051 v1

This section describes the SCIL Editor when it is accessed from the Tool Manager or from other tools
like Picture Editor, Command Procedure Object Definition tool and Dialog Editor for Visual SCIL.

13.1 General GUID-E98E4717-7E5F-4ED2-BCBA-4226FA74701E v1

GUID-054F7BC4-F062-4372-A2DA-7C3F63346FFE V1 EN-US

Figure 26: The SCIL editor as accessed from the Tool Manager
The SCIL editor is a text editor designed for editing text files and SCIL programs. The editor has
ordinary editing functions and tools for assisting design of SCIL program code. The assistant tools for
SCIL programming are dialogs for inserting SCIL commands, statements and functions as well as
syntax checking. Figure 26 shows the SCIL editor as opened from the Tool Manager. The menu bar
and the toolbar are located above the text window and below there is a status bar. The status bar
shows the current cursor position in terms of rows and columns. The active path is also shown in a
field on the status bar. Unsaved changes in the program are indicated with a colored pencil on the
status bar. The pencil is dimmed when there are no unsaved changes.

13.2 Menus GUID-1F494D09-D4FE-4D33-8063-C957A4514CA5 v2

Commands of the File menu:

MicroSCADA X SYS600 10.5 347


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 13 1MRK 511 664-UEN Rev. A
SCIL editor

New Open a new file with the default name ‘Untitled.txt’. In case there are
unsaved changes to the current file a dialog asking if changes are to be
saved is shown.
Open... Open an existing file. Clicking Open displays a File Chooser dialog box for
selecting the file to open.
Save Save the file without changing the filename. The Save command acts as
Save As if invoked on a new file.
Save As... Save the file. A File Chooser dialog box for choosing path and file name is
opened.
Import... Insert the contents of a text file after the current line. Opens a File Chooser
dialog box for selecting the file to be imported.
Export... Export the whole text or the selected text. Opens a File Chooser dialog box,
with a default file name EXPORTED.TXT, for selecting the file to export to.
Print Setup... This command opens a standard Print Setup dialog provided by the Windows
operating system.
Print... This command opens a standard Print dialog provided by the Windows
operating system.
File history commands The names and the paths of the most recently opened files. The maximum
number of the file names and paths shown can be determined from the File
history commands in the Options menu.
More History This submenu is placed under the 5th file history command and displays the
possible commands from 6 to 20. The submenu is visible if File history
commands is set to more than 5, and if more than 5 files have been opened
after the setting was made. The commands on the submenu do not contain
any mnemonics.
Exit Exit the SCIL editor. The user is informed if there are unsaved changes to the
text.

The commands of the File menu differ whether the SCIL editor is opened from the Tool Manager or
from within another tool. When the SCIL editor is opened from the Tool Manager the File menu
contains the commands New/Open/Save and Save As..., while opened from within another tool
these commands are replaced by the Update command.

Commands of the Edit menu:

Undo Undo last executed command.


Redo Redo last executed command.
Cut Cut selected text and place on the Clipboard.
Copy Copy selected text and place on the Clipboard.
Paste Paste the text of the Clipboard at current cursor position.
Clear Clear selected text. The cleared text is not placed on the
Clipboard.
Select All Select the whole text.
Comment Insert a semicolon at the beginning of the current or selected
line(s). The semicolon acts as sign for commenting and the SCIL
interpreter recognises lines starting with a semicolon as a remark.
Uncomment Delete the semicolon from the beginning of current or selected
line(s).
Indent Increase indent of current or selected line(s).
Unindent Decrease indent of current or selected line(s).
Modify All Lines/Upper Case Converts the lines to upper case letters.
Modify All Lines/Lower Case Converts the lines to lower case letters.
Table continues on next page

348 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 13
SCIL editor

Modify All Lines/Capitalize Converts the first character to upper case and the rest to lower
case letters.
Modify All Lines/Left Trim Removes leading spaces from the lines
Modify All Lines/Right Trim Removes trailing spaces from the lines
Modify All Lines/Compress Spaces Replaces multiple spaces with a single space.
Modify All Lines|Sort Alphabetically Sorts the lines in the alphabetical order.
Modify All Lines/Sort by Length Sorts the lines in the length order.
Modify All Lines/Reverse Order Reverses the order of the lines.
Modify All Lines/Remove Duplicates Removes duplicate lines.
Find/Replace... Open a Find/Replace dialog with a field for text to find and a field
for the optional replacement text.
Find Next Performs the last specified find operation from the current cursor
position.
Find Block Find subsequent blocks of code in a SCIL program. For example
blocks delimited by a loop command.
Go To Line Move cursor to a line which line number is given in the dialog
shown by the command.

Commands of the SCIL menu:

Naming Standards Open a dialog showing naming conventions for SCIL variables and Visual
SCIL objects / text identifiers.
Insert SCIL... Open a dialog for inserting SCIL commands, functions and objects. The
dialog shows the different categories in a tree structure. To expand a
category click the plus sign in front of the category name. Clicking an item in
the tree structure shows the syntax of the SCIL code in the text field to the
right in the dialog. Clicking the Insert button inserts the code at current
cursor position. Click Close to exit the dialog.
Check Syntax Check the syntax of SCIL code. Information of no found errors is shown as a
message. A found error is shown in a dialog along with an error code and the
line number of the invalid program code. The line containing invalid syntax is
shown in the text field. Edit the program and click the Check button to verify
the correction. If the correction pass the syntax check, the next error is
located and shown. When no more errors are found, a Syntax Checking
Successful message is displayed.
Status Codes... Show Status Code dialog. The inserted status code is shown as the
mnemonic status message.

Commands of the Options menu:

Toolbar Toolbar visible/invisible option. Checked means toolbar is visible.


Assistant View Open or update read-only secondary window with a copy of the current program.
Slice View Makes possible to show slices from a program. The item is enabled, when the
program has more than 10000 lines.
Status Updating On/off option for status bar field, menu bar items and toolbar buttons. Checked
means that menu items and toolbar buttons are enabled and the status bar fields
are updated according to the current status of the program.
Check Syntax at Save Toggle item for turning on or off the automatic syntax checking of the program
during program saving.
Default state is off.
Compilation In Use Toggle item for turning on or off the auto-compilation of the program during
program saving. Turning off also deletes the possible existing compiled program.
Enabled only if the calling tool supports program compilation. Includes syntax
checking.
Table continues on next page

MicroSCADA X SYS600 10.5 349


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 13 1MRK 511 664-UEN Rev. A
SCIL editor

File History Length Determines the maximum number of the names and the paths, of the most
recently opened files, displayed as file history commands under the File menu.
The file history length can be set between 0 and 20. Giving the length 0 means
that the file history is disabled.
Indent... Open a dialog for setting indent character count and the state for indenting new
lines.
Font|Set Font Brings up a Font Chooser for selecting the editor font.
The selected font is saved in the parameter file, and restored when the editor is
opened next time.
Font/Enlarge Size Find the next larger point size and set the editor font.
Font/Reduce Size Find the next smaller point size and set the editor font.
Font/Reset Font Set the editor font to the default value: Courier Medium Modern 10.

Commands of the Help menu:

Shortcut Keys Shows a dialog with the sequences of keystrokes that corresponds to certain
actions not included in the menus.
User Parameter Saving Shows information about whether tool or user specific parameters are used to
save the properties and geometry of the SCIL editor.
About Shows a dialog with Tool information and System information.

13.3 Toolbar GUID-7A57F504-2D17-4062-862A-631E0B3FC677 v1

The toolbar of the SCIL editor is a collection of buttons corresponding to commands found in the
menus. The toolbar is shown in Figure 27. The corresponding command of each button is explained
in Table 22.The last button Evaluate in test dialog (in Table 22) is present on the tool bar when the
editor is opened from the Test Dialog.

GUID-AD0C2DB3-F71A-43D6-9322-DC4C26B0ED37 V1 EN-US

Figure 27: Toolbar of the SCIL editor as opened from the Tool Manager

Table 22: Corresponding commands of the buttons on the toolbar

File|Exit Edit|Copy Edit|Find/Replace

File|New Edit|Paste Edit|Find Next

File|Open Edit|Comment Edit|Find Block

File|Save Edit|Uncomment SCILInsert SCIL...

Edit|Undo Edit|Indent SCIL|Check Syntax

Edit|Cut Edit|Unindent Evaluate in test dialog

350 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 13
SCIL editor

13.4 Opening and closing the SCIL editor GUID-E2772CED-F40B-4DAC-A8C7-43365A96922F v1

13.4.1 Opening the SCIL editor GUID-6A487001-7E4F-4011-86BE-531682B1B62B v1

The SCIL Editor is opened when you select a program for editing in the Picture Editor, Command
Procedure object definition tool, Test Dialog or the Dialog Editor. The programs and the procedures
for starting the program editing are described in the manuals Picture Editing, Visual SCIL User
Interface Design and Application Objects.

The SCIL program editor can also be opened from the Tool Manager by clicking the SCIL Editor icon
in the Miscellaneous page.

When the SCIL Editor is opened from a tool, the user already chosen a program for editing. If it
exists, its contents is shown in the editor. If it is new, the editor is empty.

13.4.2 Opening files GUID-31B9DAAB-7600-4435-937D-D89FCB66B383 v2

After having opened the editor from the Tool Manager, the user can open a text file for editing or
create a new file. This possibility is usually not available when the editor has been opened from an
object tool. To open a file:

1. Click Open from the File menu. A file chooser dialog box appears.
2. Select directory from the directory tree. All files are listed as default. Four different path selection
modes are supported, as described below. The default is SYS600 Relative Paths. The file list
can be viewed as a list or with details by clicking on either the List ( ) or the Details ( ) button
on the right, above the file list box.
3. Click the name of the text file, or type the file name in the data entry field below the file list. A file
can be opened also as a read-only file by selecting the Read-only check box.
4. Click Open.

To close a file and start editing of another file, open another file or click New from the File menu to
open a new file. If the previous file was not saved, the user is asked to save the changes or abandon
them.

In the File Chooser the paths can be selected in four different modes:

Application Relative Paths Path representation in the SYS600 path format relative to the current
SYS600 application home directory. The application home directory itself
can't be referenced.
SYS600 Relative Paths Path representation in the SYS600 path format relative to the SYS600
root directory. The SYS600 root directory itself can't be referenced.
Logical Paths Path representation in the SYS600 logical path format.
Operating System Paths Path representation in the format used by the operating system.

13.4.3 Creating files GUID-036948CD-008C-482F-A4C9-57F35CB94A2F v1

File name is given when the file is saved. If the file does not exist, a new file is created.

13.4.4 Saving files GUID-825BC940-CFF7-47F8-8B37-FC8E1DA556CE v1

The work can be saved anytime. To save a file:

MicroSCADA X SYS600 10.5 351


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 13 1MRK 511 664-UEN Rev. A
SCIL editor

1. Click Save or Save As from the File menu. The Save command saves the file with the same
name, if it already exists. Use the Save As command to save the file with another name.
2. When selecting Save for the first time or Save As, the file chooser dialog box appears. Select
the correct folder from the directory tree and click on the file name, or type it in the Save as text
box. Four different path selection modes are supported, as described above. A new folder can
also be created by clicking on the Create New Folder button ( ) above the file list.
3. Click Save.

If the SCIL Editor has been opened from an object tool, save the program by choosing Update on
the File menu.

13.4.5 Undo operation GUID-ABA33AD6-FFBB-4F92-96E4-AB815F0115A3 v1

To undo the last editing operation, click Undo on the Edit menu. The undo operation revokes the last
editing operation. The maximum number of actions that can be undone is 50.

13.4.6 Closing the SCIL editor GUID-C567E650-51A6-428A-8BE9-5260AB56C43D v1

To close the editor, click Exit on the File menu.

If changes has been made since the last time the program was saved, a dialog box appears
prompting to save changes.

13.5 Typing and editing programs and texts GUID-16751DB7-1D81-474C-841D-D0D83B78D75D v1

13.5.1 Typing GUID-BEA88C72-1CE5-4787-B7EB-93BAB3EF511C v1

The basic function of the SCIL Editor compares to common text editing programs. Most keyboard
keys have their natural functions. The functions of some important keys are explained below:

Insert toggles between insert and overwrite.


Home moves the cursor to the beginning of the line and the End key to the end of
line.
CTRL+Home moves the cursor to the beginning of the program.
CTRL+End moves the cursor the end of the program or text.
<- and -> moves the cursor one step to the left and right respectively.
CTRL+<- and CTRL+-> moves the cursor to the beginning of the next/previous word.
TAB inserts a specified number of spaces defined by the user and moves the
cursor the same number of steps to the right.

More information on shortcut keys is found by choosing Shortcut Keys from the Help menu.

13.5.2 Scroll feature GUID-A768F1B1-B567-4E1B-A9FC-83F0C141AC48 v1

A lengthy program/content in the SCIL editor can be scrolled up/down by scrolling the middle mouse
button.

13.5.3 Selecting text for editing GUID-DDDC3102-3210-4859-9DF9-274C1194E12E v1

The whole program or parts of it can be selected for moving, copying and deleting as follows:

352 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 13
SCIL editor

• To select a word, double-click it.


• To select a text section, place the cursor at the beginning of the section, press the mouse button
and hold it down while dragging the cursor to the end of the text.
• To select the whole program or text, press CTRL+A or choose Select All from the Edit menu.

The selected text is shown in reversed colors. It can be moved, copied and deleted as described
below. Text strings can also be replaced in the selected section.

13.5.4 Copying GUID-371EF212-6207-4302-BC8A-A3B9B2A9F13E v1

To copy a text within the program or from one program to another:

1. Select the text you want to copy as described above.


2. Choose Copy from the Edit menu or press CTRL+C. The text is copied to the clipboard.

To move text from one program to another, activate the program to be copied.

1. Place the cursor at the position where the copied text should be inserted.
2. Click Paste from the Edit menu or press CTRL+V.

13.5.5 Moving text GUID-60117BFD-6597-4C82-BDB2-288506CB297B v1

To move text:

1. Select the text to be moved as described above.


2. Choose Cut from the Edit menu or press CTRL+X. The selection is removed from the screen
and placed in the clipboard.
3. To move text from one program to another, activate the program to which the text will be moved.
4. Click the place where you want to insert the text.
5. Choose Paste from the Edit menu or press CTRL+V.

13.5.6 Deleting GUID-5E0DE65C-B922-4CC4-953D-E64596C7C36A v1

To delete text:

1. Select the text wanted as described above.


2. Click Clear from the Edit menu or press DELETE.

The selected text disappears.

13.5.7 Commenting GUID-6C850853-8702-400B-B085-571C419F6D6E v2

A comment in a SCIL program is a line or a part of a line marked by a comment mark (;) at the
beginning. When this sign appears in a program line, the rest of the line is regarded as a comment
and not executed. Comments can be used, for example, to explain how the program works or to
prevent the execution of a program line without deleting it permanently. The comment signs may be
inserted and deleted using the ordinary text editing functions. To mark several subsequent lines as
comments, the Comment and Uncomment commands of the Edit menu can aslo be used.

To mark a program section as comments:

1. Select the lines to be marked as comments, see above.


2. Click Comment on the Edit menu.

A semicolon is inserted as the first character of each line in the selection.

To remove the comment marks located in the beginning of lines:

MicroSCADA X SYS600 10.5 353


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 13 1MRK 511 664-UEN Rev. A
SCIL editor

1. Select the lines from which the comment marks should be removed.
2. Click Uncomment on the Edit menu.

All the comment marks that are located at the beginning of the lines are removed. Semicolons
located elsewhere are not removed.

13.5.8 Indenting GUID-98B72E60-C6F7-4DDC-A842-50959991AA87 v1

Text in paragraphs usually extends from the left margin to the right margin. A paragraph can be
indented to set it off from other text. Indenting is used to increase readability of program code.
Setting the measurement for indenting is done by choosing Indent... from the Options menu. The
checkbox Auto-indent enabled means that a new line is indented according to previous line.

To indent a section:

1. Select the lines to be indented. If no text is selected, the current line is indented.
2. Click Indent from the Edit Menu.

To unindent a section:

1. Select the lines to be unindented.


2. Click Unindent from the Edit Menu.

13.5.9 Finding text GUID-29DFE25A-B44F-400E-9D68-FDF522648D2C v1

The Find/Replace command searches for a given text in the program. It stops when it finds the first
match and shows it as a selection. To use the Find/Replace command:

1. To search a certain part of the text, select the text to be searched. Otherwise the entire
document is searched. The Find or Replace operation is always started from the current cursor
position.
2. Click Find/Replace from the Edit menu. The dialog box shown in Figure 28 appears. Moving
the cursor is possible in the main window while the Find/Replace dialog box is open.

GUID-1E9093A3-654C-4FDD-BAEE-450373E5098C V1 EN-US

Figure 28: You can search for text that is located somewhere in the same program using
the Find/Replace command on the Edit menu
3. In the Find what field, type the text to be searched for. A document can be searched either in an
upward or downward direction of the program by selecting Forwards or Backwards under
Direction in the dialog. If the case of the text (uppercase/lowercase) is of importance, select the
check box Match Case. If a text was selected in step 1, Selection is selected under Scope.
4. Click Find First. If a matching text is found, the first match is shown selected in the text window.
If no matching text is found, a dialog box saying “Text not found” appears. After the first find
operation the Find First command button is replaced with Find Next command button, which
can be used for finding the next occurrence. Find Next may be invoked repeatedly to search for
the string until Close is clicked.

354 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 13
SCIL editor

The Find Next operation in the main window is not possible while the Find/Replace dialog is open.

The last twenty items of the Find/Replace word lists are saved and restored when closing and
opening the SCIL Editor. The lists are sorted in the chronological order, last used words first.

13.5.10 Replacing text GUID-11ECCC2A-8AB3-4F10-96AE-34024BFC71CE v2

To replace the occurrences of a text string with another one:

1. To replace the occurrences found in a certain text section, select the section. Otherwise the
entire document is considered. The Find or Replace operation is always started from the
current cursor position.
2. Click Find/Replace from the Edit menu. The dialog shown in Figure 29 appears. Moving the
cursor is possible in the main window while the Find/Replace dialog box is open.

GUID-47D99EB8-D307-4832-8DA7-A21E0369B469 V1 EN-US

Figure 29: With this dialog you can replace one text with another
3. In the first text box, type the text you want to replace, and in the second box, type the text to be
replaced it with. The user can also select whether the entire document or just the selected text
section is replace. If the case of the text is of importance, select Match Case. Select search
direction under Direction.
4. Click Find First to find the first occurrence of the text string without replacing it immediately.
After the first find operation the Find First command button is replaced with Find Next
command button, which can be used for finding the next occurrence. Find Next may be invoked
repeatedly to search for the string until Close is clicked.
5. When an occurrence to be replaced is found, click Replace. This replaces the selected text and
searches the next occurrence of the text string. If the found text is edited manually in the main
window during a Find or a Replace operation, clicking Replace button replaces nothing, but the
Find Next operation is performed. Replace All replaces all occurrences of the text string.

The Find Next operation in the main window is not possible while the Find/Replace dialog is open

The last twenty items of the Find/Replace word lists are saved and restored when closing and
opening the SCIL Editor. The lists are sorted in the chronological order, last used words first.

13.5.11 Finding blocks GUID-4C0F8C66-A529-4A15-BD8D-ACEC6C69E73C v1

To go to a certain SCIL block in the program, click Find Block in the Edit menu. The Find Block
command searches for the following Block commands downwards in the program starting from the
cursor:

#BLOCK .... #BLOCK_END


#LOOP ....#LOOP_END
#CASE ....#CASE_END

MicroSCADA X SYS600 10.5 355


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 13 1MRK 511 664-UEN Rev. A
SCIL editor

When a block is found, it is selected in the text window. To find another block, place the cursor after
the command that ends the previous block and then click Find Block again.

13.5.12 Finding a line GUID-AC984BAE-96EC-4248-8C33-61FB3BB1C2A0 v1

To move quickly to a certain line number:

1. Click Go To Line from the Edit menu or press CTRL+L on the keyboard.
The dialog shown in Figure 30 appears.

GUID-28E9526F-FFCA-4957-A55E-97D89BBE4A8F V1 EN-US

Figure 30: A certain line can be moved using this dialog.


2. In the text box, type the number of the line to which you want to move and click OK.

If the line number is invalid, the cursor is moved to the first line and if the given line number is too big
the cursor is moved to the last line.

13.5.13 Importing and exporting text GUID-581E9D0D-E9FB-43E8-B66E-E8C5ABFF97D1 v1

Importing text means that the contents of a text file is inserted after the current line except for the
case when the cursor is located at the beginning of the text, then the text is inserted at the beginning.
To import a text file:

1. Click Import... from the File menu. The file chooser dialog box appears.
2. Select the correct folder from the directory tree and click on the name of the file.
3. Click OK.

Exporting a file means that the selected or the whole text is stored in a file. To export a text:

1. Select a text if only part of the text is to be exported.


2. Click Export from the File menu. The file chooser dialog box appears with the default file name
EXPORTED.EXE in the File name text box.
3. Select the correct folder from the directory tree and enter a name for the file in the File name
text box. A new folder can also be created by clicking on the Create New Folder button ( )
above the file list.
4. Click OK.

If there is an existing file with the same name, the user is asked to confirm overwriting of the existing
file.

In the file chooser four different path selection modes are supported, as described in Section 10.17.

13.5.14 Undoing and redoing operations GUID-F8D05E0F-C834-4B7D-BED3-6253B1D2DF31 v1

Most editing operations can be cancelled using the Undo command, for example Cut/Copy/Paste
and Replace commands. When the user chooses to undo typing, undo will affect all that was written
since the last editing operation, for example Copy/Undo/Save.

To undo an operation, click Undo from the Edit menu.

356 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 13
SCIL editor

The operations that have been cancelled by using Undo, can be done again. This means that an
Undo operation can also be canceled. To do this, click Redo from the Edit menu.

13.5.15 Insert SCIL commands, functions and objects GUID-1CA6907A-0771-4327-8270-6A2BA0F7CD04 v1

This assisting tool in the SCIL editor is designed to help writing SCIL code. The dialog below appears
as the Insert SCIL... command on the SCIL menu is invoked. The text box to the left in the dialog
contains the different categories of commands, functions and objects. Expand the nodes in the tree
by clicking the plus sign. Subcategories appear as leafs in the tree structure. Select a subcategory by
clicking it. When this is done commands, functions or object definition attributes appear in the text
box to the right in the dialog. The desired command, function or attribute is selected by clicking. The
status bar at the bottom of the dialog displays a short description of the selected command, function
or attribute.

GUID-25B23889-336E-49E9-AEC8-41B1D4559189 V1 EN-US

Figure 31: The Insert SCIL Commands, Functions & Objects dialog of the SCIL editor
To insert a SCIL command:

1. Place the cursor where the command is to be inserted.


2. Click Insert SCIL... on the SCIL menu.
3. Expand one of the categories by clicking the plus sign in front.
4. Select one of the subcategories by clicking.
5. Select a command by clicking.
6. Click Insert. The command is inserted at current cursor position. Possible arguments are
replaced by the user.
7. Repeat steps 3 to 6 to insert next command or click Close to exit the tool. The cursor position
may also be moved while the Insert SCIL Commands, Functions & Objects dialog is open.

13.5.16 Syntax checking of a SCIL program GUID-6356275C-D1B9-45D9-9657-D4D1EE48829A v1

The syntax check, independent of the current cursor position, always starts at the beginning of the
program. A successful syntax check displays Syntax Checking Successful in a message box. The
syntax check command itself does not alter the code, changes are made by the user. The first
encountered invalid code is displayed in a dialog as shown in the picture below. The erroneous line is
shown in the dialog and it is also made the current line of the editor. The error is corrected in the text
window and then checked by clicking the Check button in the SCIL Syntax Error dialog. If the
correction passes the syntax check, the next error is displayed. This procedure continues until no

MicroSCADA X SYS600 10.5 357


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 13 1MRK 511 664-UEN Rev. A
SCIL editor

more errors are found and the Syntax Checking Successful message is shown. To exit the dialog
while errors still exist, click Close.

GUID-E8EC569A-23CA-4F0D-8B46-0F2ECDD3C041 V1 EN-US

Figure 32: The Syntax check command shows a dialog like this when a syntax error is
encountered
To check the syntax of a SCIL program:

1. Open a SCIL program.


2. Click Syntax Check on the SCIL menu. If an error is found a dialog showing the invalid code is
displayed. If no errors are found in the program code, Syntax Checking Successful is
displayed.
3. The erroneous line is shown in the SCIL Syntax Error dialog and the line is selected in the
editor.
4. In the text window, correct the invalid code and click the Check button in the SCIL Syntax Error
dialog. The next found error is displayed.
5. Repeat steps 3 and 4 until Syntax Checking Successful is displayed in a message box.

358 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 14
SCIL compiler

Section 14 SCIL compiler GUID-EC74C404-5ACE-41B9-B399-4AC19C93E8A0 v1

14.1 General GUID-4EC64CAB-DCAE-4C01-9F57-D0137BC5D6C5 v1

The SCIL programs of pictures and command procedures can be compiled for better performance.
Compiling a SCIL program means that it is converted into an operating system independent format,
which is then executed by a so called virtual SCIL machine. The compiled code is stored, in addition
to the original SCIL code, in the picture or in the command procedure. Once a SCIL program is
compiled, the compiled version is automatically used instead of the original SCIL code. The
compilation is controlled by means of the corresponding tools, picture editor and command
procedure tool.

14.2 Performance improvement GUID-1BE09F54-5A9F-4E30-84FB-64C00D70F152 v2

By compiling the SCIL code, the interpretation time is reduced to only a fraction of the original time.
However, the total time needed to execute a SCIL statement depends very much on what the
statement does, and thereby no single performance improvement between executing uncompiled
and compiled SCIL code can be given. The performance improvement varies between no
improvement and up to 50 times faster. Two extreme cases are shown below:

The following program is 50 times faster when compiled compared to uncompiled:

#loop_with i = 1 .. 1000
#if TRUE #then #block
#block_end
#loop_end

The following program is not faster when compiled compared to uncompiled:

#pause 1

The picture change time of a typical single line diagram picture built with LIB500, which is compiled,
is approximately 2/3 of the time of the uncompiled version.

14.3 Impact on SCIL programs GUID-2D85C61A-71C7-46D9-8A81-B22080D61C5C v1

In most cases, a valid SCIL program executes exactly in the same way whether compiled or not
(apart from the speed). However, there are some rare cases that must be considered:

1. A valid SCIL program may be impossible to compile.


2. A SCIL program may compile but generates a run-time error when run by the Virtual SCIL
Machine.
3. The compiled and uncompiled program may generate different results.

Case 1 is the simplest one to handle as it is discovered during compilation. The program must be
corrected and recompiled. Case 2 is more difficult, and careful retesting is required to point out the
possible problems. Case 3 is the most difficult one to solve, but it is also an almost academic case
which is hard to encounter unless deliberately written. Because of these possible incompatibilities, a
compiled SCIL program must be thoroughly retested.

In most cases, the problems arise from wild usage of variable expansions. The cases are described
in more detail below. Recommendations on how to avoid this kind of problems are given as well.

A compiled SCIL program may be harder to debug than an uncompiled one, because the source
lines are not available at run-time. The error message field on the top left corner of a picture is not
able to show the erroneous SCIL line (only the line number is given). The standard error dialog of VS

MicroSCADA X SYS600 10.5 359


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 14 1MRK 511 664-UEN Rev. A
SCIL compiler

objects is also unable to display the line that caused the error. It is recommended that a SCIL
program is first debugged uncompiled, and after that compiled to a product version.

14.3.1 Programs that do not compile GUID-E9345BCF-4C3F-46E0-A5C6-3A1385961D5E v2

There are two cases when a valid SCIL program does not compile:

• HMI commands do not compile. HMI commands are commands that are addressed to the HMI
program started by !MODULENAME command (such as the old picture editor program PICG). In
normal pictures they generate an error; 896 (PICO_NO_MODULE_TO_SEND_MESSAGE).
This restriction is a deliberate choice. HMI commands are seldom needed, and it is easy to write
a HMI command by mistake, for example, by omitting character # or @ at the beginning of a
line.
• Variable expansions are used in a way that hides the program structure from the reader.

Examples of the second case:

Example 1:

@CONDITION = "#IF A == B"


'CONDITION' #THEN .DO_SOMETHING

Example 2:

@END = "_END"
#BLOCK
.DO_SOMETHING
#BLOCK'END'

Example 3:

@A = "1 + "
@B = 'A' 2

14.3.2 Programs that generate run-time error GUID-B4312EAA-32B6-439F-9F42-1C5189C7A07D v1

There are two cases when a program runs without errors when uncompiled but not when compiled:

• Alias checking is always performed by the Virtual SCIL Machine regardless of the revision
compatibility switch (NO_ALIAS_CHECKING). The SCIL program design must be corrected to
enable compilation if the compiled program fails with error code 580
(SCIL_VARIABLE_ALIASING_ERROR).
• Variable expansions are used in a way that hides certain syntactical language elements from the
reader.

Here are some examples of the second case:

Example 1:

@V = "AI(%INDEX)"
@POWER = OBJECT:P'V' ;Index expression hidden

This one works:

@V = "AI5"
@POWER = OBJECT:P'V'

Example 2:

360 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Section 14
SCIL compiler

@A = 1
@B = 2
@C = 'A'.'B' ;The compiler assumes that the right hand
;expression is a VS object or window
attribute reference

14.3.3 Programs that produce wrong results GUID-D253B0B7-BE57-44C6-A223-A347A04078A6 v1

If variable expansions are used in a way that hides the correct evaluation order of an expression, the
results of compiled and uncompiled program may be different.

Example:

@A = "1 + 2"
@B = "3 + 4"
@C = 'A' * 'B'

As uncompiled, the meaning of the third line is

@C = 1 + 2 * 3 + 4

after the expansions, which is evaluated as 1 + ( 2 * 3 ) + 4 = 11.

The compiler relies on what it sees as it generates byte code which expands and evaluates A first,
then B and finally multiplies the two. The result is (1 + 2) * (3 + 4) = 21.

14.3.4 Recommendations GUID-810EDEC7-D995-4895-AD90-2A51F14FD597 v1

To avoid the potential problems described above (and to make SCIL programs more readable),
following recommendations on the use of variable expansions may be given:

• Use direct variable access instead of expansion whenever possible.

Instead of 'A' + 'B', write %A + %B.

Instead of "'A'", write %A ( if A has a text value ).

Instead of "X'A'Z", write "X" + %A + "Z" ( if A has a


text value ).

As another advantage, the direct variable access is faster than expansion even in uncompiled
programs.

• Use variable expansion mainly for generating various identifiers.

Examples of good usage of expansions:

#SET 'LN':PBO1 = 1 ;As an object name

#SET ABC'POSTFIX':PBO1 ;As a part of an object name


= 1

@OLD_ERROR_STATE = ERROR_STATE

Table continues on next page

MicroSCADA X SYS600 10.5 361


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Section 14 1MRK 511 664-UEN Rev. A
SCIL compiler

#ERROR IGNORE

.DO_SOMETHING

#ERROR 'OLD_ERROR_STATE' ;As a command keyword value

.SET 'DIALOG'\BUTTON.TITLE = "Push me" ;As a VS object name

!NEW_PIC ;As a picture name


'NEXT_PICTURE'

When variable expansions are used as recommended above, the compiled and uncompiled program
always behave identically. Even most cases of other 'non-pathological' (or even 'pathological') use of
expansions work as they are expected.

Examples:

@V = "PBO1"
#SET OBJECT:'V' = 1

@V = "OBJECT:PBO1"
#SET 'V' = 1

@V = "DIALOG\BUTTON"
.SET 'V'.TITLE = "Push me"
.SET 'V'_2.TITLE = "Push me too"

@NAME = "ABC"
@'NAME' = %'NAME' + 1

362 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Appendix A
ODBC ERROR CODES

Appendix A ODBC ERROR CODES GUID-9E4C3D88-FFCB-4CC0-BE4C-0DCA2E7687A0 v1

1.1 About this appendix GUID-563B51CF-CE90-4A6A-95B5-E0CF989BB92E v1

This appendix lists the ODBC error codes which the SCIL SQL interface may return.

1.2 General GUID-12D08795-F4D6-47C0-BB8A-C0858F53E1A1 v1

The character string value consists of a two character class value followed by a three character
subclass value. A class value of "01" indicates a warning and is accompanied by a return code of
SQL_SUCCESS_WITH_INFO. The class values other than "01", except for the class "IM", indicate
an error and are accompanied by a return code of SQL_ERROR. The class "IM" is specific to
warnings and errors that derive from the implementation of ODBC itself. The subclass value "000" in
any class is for implementation defined conditions within the given class.

Note 1 Although successful execution of a function is normally indicated by a return value of


SQL_SUCCESS, the SQLSTATE 00000 also indicates success.

Note 2 Although the SCILSQL interface has only eight functions the user can call, it includes several
different ODBC functions. ODBC error codes may also refer to those hidden functions.

1.3 List of codes GUID-57C172E0-8748-47C3-8B5C-7186334383B2 v1

SQLSTATE Error
01000 General warning
01002 Disconnect error
01004 Data truncated
01006 Priviledge not revoked
01S02 Option value changed
01S03 No rows updated or deleted
01S04 More than one row updated or deleted
07001 Wrong number of parameters
07006 Restricted data type attribute violation
08001 Unable to connect to data source
08002 Connection in use
08003 Connection not open
08004 Data source rejected establishment of connection
08007 Connection failure during transaction
08S01 Communication link failure
21S01 Insert value list does not match column list
21S02 Degree of derived table does not match column list
22003 Numeric value out of range
22005 Error in assignment
22008 Datetime field overflow
22012 Division by zero
23000 Integrity constraint violation
Table continues on next page

MicroSCADA X SYS600 10.5 363


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Appendix A 1MRK 511 664-UEN Rev. A
ODBC ERROR CODES

SQLSTATE Error
24000 Invalid cursor state
25000 Invalid transaction state
28000 Invalid authorization specification
34000 Invalid cursor name
37000 Syntax error or access violation
40001 Serialization failure
42000 Syntax error or access violation
IM001 Driver does not support this function
IM002 Data source name not found and no default driver specified
IM003 Specified driver could not be loaded
IM004 Driver’s SQLAllocEnv failed
IM005 Driver’s SQLAllocConnect failed
IM006 Driver’s SQLSetConnect-Option failed
IM009 Unable to load translation DLL
IM013 Trace file error
S0001 Base table or view already exists
S0002 Base table not found
S0011 Index already exists
S0012 Index not found
S0021 Column already exists
S0022 Column not found
S1000 General error
S1001 Memory allocation failure
S1002 Invalid column number
S1003 Program type out of range
S1008 Operation cancelled
S1009 Invalid argument value
S1010 Function sequence error
S1011 Operation invalid at this time
S1012 Invalid transaction operation code specified
S1090 Invalid string or buffer length
S1092 Option type out of range
S1109 Invalid cursor position
S1C00 Driver not capable
S1T00 Timeout expired

364 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Appendix B
PARAMETER FILES

Appendix B PARAMETER FILES GUID-655600F4-D5DB-4F9E-8691-E8A9DC031281 v1

1.1 About this appendix GUID-6FBF81F0-DA17-444C-94B8-3AEBF14EF077 v1

This appendix describes the parameter files used in SYS600. First, it gives a general description,
then a detailed description in BNF format.

1.2 General GUID-0D4B5389-616D-47AC-A8C1-1C0735358252 v1

Parameter files contain data in a Windows ini-file style format. A parameter file consists of any
number of sections and any number of comment lines. Each section consists of a section header and
any number of keys: value pairs, empty lines and comment lines. However, the total number of lines
in a file is limited to the maximum length of SCIL vector.

Example:

[SECTION1]

KEY=VALUE

;this is a comment

[SECTION2]

KEY=VALUE

A section begins with a header, the name of the section enclosed in brackets, e.g. [section name],
and ends at the beginning of another section or at the end of the file. The enclosing brackets ([]) are
required, and the left bracket must be in the leftmost column.

Comment lines begin with a semicolon (;).

1.3 BNF description GUID-B2BE89C3-5988-425F-BF43-8CDA2E4569F7 v1

In the following description:

• NL represents new line characters (ASCII CR and LF)


• SP represents any number of space characters
• CH represents any non-control character (ASCII codes 32 to 255)
• NC represents any visible character, except ; [ ] and =

ini_file ::= {comment_line}* {section}*

section ::= section_header {item}*

section_header ::= [section_name] NL

section_name ::= name

item ::= NL | key_line | comment_line

comment_line ::= SP ; character_string NL

key_line ::= SP key_name SP = SP key_value NL

key_value ::= character_string

MicroSCADA X SYS600 10.5 365


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Appendix B 1MRK 511 664-UEN Rev. A
PARAMETER FILES

character_string ::= {CH}*

key_name ::= name

name ::= NC{extended_name_char}*

extended_name_char ::= SP NC

366 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Index

Index

_ BCD_TO_INTEGER.............................. 141, 181


_ATTRIBUTE_NAMES.................................... 69 BG................................................................. 327
_CHILD_OBJECTS......................................... 70 BIN.........................................................141, 182
_COMPILED....................................................70 BIN_SCAN.............................................141, 182
_FILE_REVISION............................................70 BINARY_SEARCH................................ 141, 195
_FLAG_FOR_EXECUTION.......................68, 69 Binary Coded Decimal numbers............182, 185
_OBJECT_CLASS...........................................70 Binary files....................................................... 73
_OBJECT_NAME............................................ 71 BIT......................................................... 141, 191
_OBJECT_PATH............................................. 71 BIT_AND............................................... 141, 192
_QUEUE_FOR_EXECUTION................... 68, 69 BIT_CLEAR........................................... 141, 192
_SG_GEOMETRY...........................................71 BIT_COMPL.......................................... 142, 192
_SOURCE_FILE_NAME................................. 71 BIT_MASK.............................................142, 193
_VARIABLE_NAMES...................................... 71 BIT_OR..................................................142, 193
BIT_SCAN............................................. 142, 183
A BIT_SET................................................ 142, 193
ABS....................................................... 141, 159 BIT_STRING......................................... 142, 194
Absolute value....................................... 141, 159 BIT_XOR............................................... 142, 194
Accuracy..........................................................42 Bit function.....................................................191
ADD_INTERLOCKED........................... 141, 316 Bit string.............................................41, 44, 191
Addition......................................................86, 87 BLOCK...................................................... 98, 99
AEP_PROGRAMS.................................141, 211 BLOCK_END.............................................98, 99
Alarm buffer..................................................... 55 Boolean..................................................... 43, 89
Alarm list..........................................................55 BOX....................................................... 320, 321
Alarm picture........................................... 97, 127 Byte string........................................................45
Alarm picture queue...................................... 127
AM................................................................. 326 C
AND................................................................. 91 Canceling in SCIL Program Editor.................356
APL............................................................51, 52 Canvas.. 319, 320, 323, 324, 334, 335, 338, 339
APL_OPCNAM.SDB......................................295 CANVAS CURRENT..................................... 335
APPEND................................................141, 194 CANVAS PARENT.........................................335
Application................................................. 51, 54 CANVAS ROOT.............................................335
APPLICATION_ALARM_COUNT..........141, 236 CAP_STYLE..................................................327
APPLICATION_ALARM_LIST......... 55, 141, 237 CAPITALIZE.......................................... 142, 183
APPLICATION_OBJECT_ATTRIBUTES......141, CASE_END............................................... 98, 99
228 CASE command........................................ 98, 99
APPLICATION_OBJECT_COUNT........ 141, 229 CASE function....................................... 142, 153
APPLICATION_OBJECT_EXISTS........ 141, 229 Characters....................................................... 38
APPLICATION_OBJECT_LIST............. 141, 230 Child object......................................................64
APPLICATION_OBJECT_SELECT.......141, 233 CHOOSE............................................... 142, 154
Application engineering................................... 25 CIRCLE................................................. 320, 321
Application objects...........................................49 CLASSIFY............................................. 142, 195
ARC....................................................... 320, 326 CLOCK.................................................. 142, 167
ARC_MODE.................................................. 326 CLOSE.................................................. 126, 352
ARCCOS............................................... 141, 159 CLOSE_FILE................................................. 118
ARCSIN................................................. 141, 159 COLLECT.............................................. 142, 183
ARCTAN................................................ 141, 160 Color.............................................. 329, 330, 331
Argument................................... 85, 98, 141, 206 COLOR_IN............................................ 333, 334
ARGUMENT_COUNT........................... 141, 207 Command.................................................. 29, 85
Argument list..................................................140 Command procedure...........................33, 53, 58
Arguments....................................... 95, 141, 207 Comma Separated Value.............................. 282
Arithmetical operator....................................... 86 Commenting in SCIL Program Editor............ 353
ASCII..................................................... 141, 181 Comment Mark.............................................. 353
ASCII_CODE.........................................141, 181 Comments....................................................... 37
Assignment......................................................79 Communication system object...................50, 52
Assignment statement..................................... 98 Communication unit...................................50, 52
Attribute......................................... 46, 50, 51, 54 COMPILE.............................................. 142, 215
ATTRIBUTE_EXISTS............................ 141, 205 Component.... 319, 325, 326, 330, 332, 333, 334
AUDIO_ALARM.....................................141, 317 CONSOLE_OUTPUT............................ 142, 211
CONTINUE....................................................101
B COORDINATE_SYSTEM.............................. 335
BACKGROUND.............................................327 Coordinate system.........................................319
Background color...........................................327 Copying in SCIL Program Editor................... 353
Background program....................................... 32 COS.......................................................142, 160
BASE_SYSTEM_OBJECT_LIST.......... 141, 234 CREATE........................................ 108, 122, 351
Base system object................................... 50, 51 CREATE_FILE...............................................118
BCD....................................................... 182, 185 CS..................................................................327

MicroSCADA X SYS600 10.5 367


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Index 1MRK 511 664-UEN Rev. A

CSR_BOL......................................................135 DRIVE_MANAGER GET_ATTRIBUTES......144,


CSR_EOL......................................................135 271
CSR_LEFT.................................................... 135 DRIVE_MANAGER GET_DEFAULT..... 144, 271
CSR_RIGHT..................................................135 DRIVE_MANAGER LIST.......................144, 271
CSV_TO_SCIL...................................... 142, 282 DUMP.................................................... 144, 155
CSV functions................................................282 duration curves...................................... 196, 199
CUMULATE........................................... 142, 196 E
CURRENT............................................. 324, 326
CURSOR_POS............................................... 82 EDIT...................................................... 144, 184
Element........................................................... 45
D ELEMENT_LENGTH............................. 144, 155
DASH_LIST................................................... 327 ELLIPSE................................................ 320, 321
DASH_OFFSET............................................ 328 ELSE....................................................... 98, 102
Dashed line....................................................327 ELSE_IF.................................................. 98, 102
DATA_FETCH....................................... 142, 239 Endpoints.......................................................327
DATA_MANAGER................................. 142, 258 ENTER.......................................................... 135
DATA_STORE....................................... 143, 240 ENTER_POS...................................................83
DATA_TYPE.......................................... 143, 154 ENVIRONMENT.................................... 144, 212
Data object.......................................... 34, 53, 57 EQUAL.................................................. 144, 155
Data type......................................................... 41 Equal to........................................................... 89
DATE..................................................... 143, 167 ERASE.................................................. 129, 130
DAY....................................................... 143, 167 ERROR_STATE.................................... 144, 208
Day of Week.......................................... 144, 168 ERROR CONTINUE................................98, 101
Day of Year............................................144, 168 ERROR EVENT.......................................98, 101
DDE_CONNECT................................... 143, 285 Error handling policy................................96, 101
DDE_DISCONNECT............................. 143, 285 ERROR IGNORE.................................... 98, 101
DDE_EXECUTE.................................... 143, 287 ERROR RAISE........................................98, 101
DDE_POKE........................................... 143, 286 ERROR STOP.........................................98, 101
DDE_REAL............................................143, 288 EVALUATE............................................ 144, 156
DDE_REQUEST....................................143, 286 EVEN.....................................................144, 160
DDE_VECTOR...................................... 143, 288 EVENT...........................................................101
DDE client......................................................284 Event channel............................................53, 60
DDE protocol........................................... 36, 288 Event handling object...................................... 56
DDE Server................................................... 288 Event list.......................................................... 55
Debugging..................................................... 227 Event object...............................................54, 61
DEC....................................................... 143, 184 EXEC.......................................................59, 109
DEC_SCAN........................................... 143, 184 EXEC_AFTER............................................... 109
Default path names........................................116 Execute..........................................................284
DELETE.........................................108, 122, 123 Execution mode...............................................28
DELETE_ATTRIBUTE...........................143, 205 Execution time................................................. 60
DELETE_FILE............................................... 119 Exit program.................................................... 32
DELETE_PARAMETER........................ 143, 261 EXP....................................................... 144, 160
Deleting in SCIL Program Editor................... 353 Exponent......................................................... 87
Dialogs.............................................................25 Exponential operator....................................... 86
Dialog systems................................................ 64 Export............................................................ 356
DIRECTORY_MANAGER COPY.......... 143, 273 Expression...................................29, 81, 97, 132
DIRECTORY_MANAGER COPY CONTENTS... F
143, 274
DIRECTORY_MANAGER CREATE...... 143, 272 FALSE............................................................. 43
DIRECTORY_MANAGER DELETE...... 143, 273 FAST_PIC......................................................126
DIRECTORY_MANAGER DELETE_CONTENT FG..................................................................329
S....143, 273 Fictitious process objects................................ 55
DIRECTORY_MANAGER EXISTS....... 143, 273 FILE_LOCK_MANAGER....................... 144, 261
DIRECTORY_MANAGER GET_ATTRIBUTES... FILE_MANAGER COPY........................144, 276
143, 275 FILE_MANAGER DELETE....................144, 276
DIRECTORY_MANAGER LIST.............143, 272 FILE_MANAGER EXISTS..................... 144, 276
DIRECTORY_MANAGER MOVE..........143, 274 FILE_MANAGER GET_ATTRIBUTES.. 144, 277
DIRECTORY_MANAGER RENAME.....143, 274 FILE_MANAGER LIST.......................... 144, 275
Directory name................................................ 72 FILE_MANAGER MOVE....................... 144, 276
Directory tag.................................................... 72 FILE_MANAGER RENAME.................. 144, 276
DIV.............................................................86, 87 File name.........................................................72
Division...................................................... 86, 87 File naming...................................................... 72
DL.................................................................. 327 File tag.............................................................72
DO................................................... 98, 100, 328 FIND_ELEMENT................................... 144, 197
DO function............................................143, 207 Finding...........................................................354
DOW......................................................144, 168 FLUSH...................................................338, 339
DOY.......................................................144, 168 FM_APPLICATION_DIRECTORY.................277
Draw program..................................................31 FM_APPLICATION_FILE.............................. 277
DRIVE_MANAGER EXISTS..................144, 271 FM_COMBINE.......................................144, 278
FM_COMBINE_NAME.......................... 144, 278

368 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Index

FM_DIRECTORY.................................. 145, 278 HISTORY_DATABASE_MANAGER SET_DIRE


FM_DRIVE............................................ 145, 278 CTORY....146, 244
FM_EXTRACT.......................................145, 279 HISTORY_DATABASE_MANAGER SET_ORD
FM_FILE................................................145, 279 ER....146, 245
FM_REPRESENT................................. 145, 279 HISTORY_DATABASE_MANAGER SET_PERI
FM_SCIL_DIRECTORY........................ 145, 280 OD....146, 243
FM_SCIL_FILE......................................145, 280 HISTORY_DATABASE_MANAGER SET_TIME
FM_SCIL_REPRESENT....................... 145, 280 OUT....146, 245
FM_SPLIT_NAME................................. 145, 281 HISTORY_DATABASE_MANAGER SET_WIND
FONT.............................328, 330, 332, 333, 334 OW....146, 244
Font number.................................................. 332 HISTORY_DATABASE_MANAGER WRITE.......
FOREGROUND.....................321, 323, 329, 330 146, 248
Format picture................................................114 History database..............................................55
Free type object...............................................54 HOD.......................................................146, 168
FT.................................................................. 328 HOUR.................................................... 146, 168
FU..................................................................329 HOY.......................................................146, 168
Function.............................29, 85, 139, 329, 330 HR_CLOCK........................................... 146, 168
Function call.................................................. 139
Function key program......................................32 I
Identifiers......................................................... 39
G IF command.............................................98, 102
GC......................................................... 325, 333 IF function..............................................146, 157
General SCIL commands................................ 95 IGNORE........................................................ 101
GENERATE_HISTORY_EVENT........... 145, 249 IMAGE................................................... 320, 322
GET............................................................... 110 Import............................................................ 356
GET_STATUS....................................... 145, 157 Index....................................................51, 54, 56
Global variables...............................................79 INIT_QUERY......................................... 110, 242
Go To............................................................. 356 Initialization time.............................................. 60
Graphical element................. 319, 320, 326, 334 INPUT_KEY...................................................135
Graphics command....................... 319, 325, 334 INPUT_POS.................................................. 136
Graphics commands........................................95 INPUT_VAR...................................................136
Graphics context.. 319, 320, 324, 325, 326, 330, INSERT_ELEMENT.............................. 146, 198
332, 333, 339 Inserting SCIL commands, functions and object
Greater than.................................................... 89 s....357
Greater than or equal to.................................. 89 INT_PIC.................................................126, 127
Group...............................................................56 Integer............................................................. 41
INTEGER_TO_BCD.............................. 146, 185
H INTERP................................................. 146, 199
HEADER........................................................135 INVERSE...............................................146, 199
HELP............................................................. 135 IP_PROGRAMS.................................... 146, 212
HEX....................................................... 145, 185 Item..................................................................36
HEX_SCAN........................................... 145, 185 Item name......................................................284
HIGH..............................................145, 147, 197
HIGH_INDEX.................................145, 147, 197 J
HIGH_PRECISION_ADD...................... 145, 160 JOIN...................................................... 146, 186
HIGH_PRECISION_DIV........................145, 161 JOIN_STYLE......................................... 327, 329
HIGH_PRECISION_MUL...................... 145, 161 JS.................................................................. 329
HIGH_PRECISION_SHOW...................145, 161 K
HIGH_PRECISION_SUB...................... 145, 162
HIGH_PRECISION_SUM......................145, 162 KEY_POS........................................................82
High precision arithmetics............................. 160 KEYED_FILE_MANAGER.....................146, 262
HISTORY_DATABASE_MANAGER................55 Keyed files....................................................... 74
HISTORY_DATABASE_MANAGER CLOSE....... L
145, 243 LAST_PIC..............................................126, 127
HISTORY_DATABASE_MANAGER GET_PARA Less than......................................................... 89
METERS....145, 246 Less than or equal to....................................... 89
HISTORY_DATABASE_MANAGER OPEN..145, Level parameter...............................97, 129, 132
242 LIB500............................................................. 25
HISTORY_DATABASE_MANAGER QUERY...... Library representation..............................97, 134
145, 247 LIN................................................................... 51
HISTORY_DATABASE_MANAGER READ..145, LINE.......................................320, 322, 327, 330
248 LINE_STYLE................................................. 330
HISTORY_DATABASE_MANAGER SET_ATTRI LINE_WIDTH.................................................330
BUTES....145, 246 List..................................... 41, 46, 114, 146, 205
HISTORY_DATABASE_MANAGER SET_COM LIST_ATTR............................................146, 206
MENT....146, 248 List aggregate..................................................46
HISTORY_DATABASE_MANAGER SET_CON LN.......................................................... 146, 162
DITION....146, 246 LOAD.....................................................122, 124
HISTORY_DATABASE_MANAGER SET_DIRE LOCAL.....................................................98, 102
CTION....146, 245 LOCAL_TIME........................................ 146, 169

MicroSCADA X SYS600 10.5 369


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Index 1MRK 511 664-UEN Rev. A

LOCAL_TIME_ADD...............................146, 169 N
LOCAL_TIME_INFORMATION............. 146, 169 NA..................................................................330
LOCAL_TIME_INTERVAL.....................146, 170 Name................................................. 51, 54, 330
LOCAL_TO_SYS_TIME........................ 146, 170 NAME_HIERARCHY..................................... 249
LOCAL_TO_UTC_TIME........................146, 170 Named program.........................................32, 68
Local variables.................................................79 Natural logarithm................................... 146, 162
LOCATE................................................ 146, 187 NET................................................................. 52
Logging profile................................................. 53 NETWORK_TOPOLOGY_MANAGER..147, 255
LOGICAL_MAPPING............................ 147, 253 Network Topology.......................................... 255
Logical names................................................. 39 NEW_PIC.............................................. 126, 127
Logical operator.........................................86, 91 New Folder............................................ 352, 356
Logical path................................................... 116 NOD...........................................................51, 52
Logical representation library...................96, 117 Normal Mode................................................... 28
LOOP.......................................................98, 103 NOT................................................................. 91
LOOP_END..................................... 98, 103, 104 Notification window................................ 142, 211
LOOP_EXIT.............................................98, 105
LOOP_WITH........................................... 98, 104 O
LOW.............................................. 145, 147, 197 Object.................................... 29, 49, 53, 96, 108
LOW_INDEX................................. 145, 147, 197 OBJECT_ATTRIBUTE_INFO................ 148, 218
LOWER_CASE......................................147, 187 Object notation.......................................... 50, 54
LS.................................................................. 330 Object query............................................ 96, 110
LW................................................................. 330 OCT....................................................... 148, 187
OCT_SCAN........................................... 148, 188
M Octal number................................................... 41
Main picture..................................................... 31 ODBC functions.............................................289
MAX.......................................................147, 162 ODD.......................................................148, 164
MAX_APPLICATION_NUMBER............147, 216 ON..................................................... 61, 98, 105
MAX_BIT_STRING_LENGTH............... 147, 216 ON ERROR............................................. 98, 106
MAX_BYTE_STRING_LENGTH........... 147, 216 ON KEY_ERROR.................................... 98, 106
MAX_INTEGER.....................................147, 216 OPC_AE_ACKNOWLEDGE..................148, 296
MAX_LINK_NUMBER........................... 147, 216 OPC_AE_NAMESPACE........................148, 297
MAX_LIST_ATTRIBUTE_COUNT.........147, 216 OPC_AE_REFRESH.............................148, 298
MAX_MONITOR_NUMBER.................. 147, 216 OPC_AE_SERVERS.............................148, 298
MAX_NODE_NUMBER.........................147, 217 OPC_AE_VALIDATE............................. 148, 299
MAX_OBJECT_NAME_LENGTH..........147, 217 OPC_DA_NAMESPACE....................... 148, 300
MAX_PICTURE_NAME_LENGTH........ 147, 217 OPC_DA_REFRESH.............................148, 301
MAX_PRINTER_NUMBER................... 147, 217 OPC_DA_SERVERS.............................148, 302
MAX_PROCESS_OBJECT_INDEX...... 147, 217 OPC_NAME_MANAGER...................... 149, 295
MAX_REPRESENTATION_NAME_LENGTH..... OPC Name Database....................................294
147, 217 OPEN_FILE................................................... 119
MAX_STATION_NUMBER.................... 147, 217 Operands.........................................................85
MAX_STATION_TYPE_NUMBER.........147, 217 Operator.............................................. 85, 86, 91
MAX_TEXT_LENGTH........................... 147, 218 OPS_CALL............................................ 149, 208
MAX_VECTOR_LENGTH..................... 147, 218 OPS_NAME...........................................149, 213
MAX_WINDOW_NAME_LENGTH........ 147, 218 OPS_PROCESS................................... 149, 209
MEAN.................................................... 147, 200 OR................................................................... 91
MEMORY_POOL_USAGE....................147, 212 OTHERWISE.............................................98, 99
MEMORY_USAGE................................147, 208
MERGE_ATTRIBUTES......................... 147, 206 P
Method.......................................................33, 50 PACK_STR............................................149, 188
Method call.................................................... 124 PACK _TIME......................................... 149, 171
Method calls.................................................... 66 PAD....................................................... 149, 189
MIN........................................................ 147, 163 Parameter files................................................ 73
MIN_INTEGER...................................... 147, 218 PARENT................................................ 324, 326
MINUTE.................................................147, 171 Parent object................................................... 64
Mix................................................................. 331 PARSE_FILE_NAME.............................149, 263
MOD.......................................................... 86, 87 Part picture...................................................... 31
MODIFY......................................... 111, 124, 125 PATH..............................................115, 149, 264
MON................................................................ 51 PATHS................................................... 149, 264
Monitor.....................................97, 126, 324, 326 PAUSE.....................................................98, 106
MONTH................................................. 147, 171 Pending......................................................... 339
MOUSE......................................................... 337 PEND OFF............................................ 338, 339
MOUSE DISCARD........................................ 338 PEND ON.............................................. 338, 339
Mouse input................................................... 337 Peripherals equipment.....................................52
MOUSE OFF................................................. 337 PHYSICAL_MAPPING.......................... 149, 254
MOUSE ON................................................... 337 PIC_NAME...................................................... 82
Moving in SCIL Program Editor..................... 353 PICK...................................................... 149, 200
Multiplication..............................................86, 87 Picture......................................... 25, 66, 97, 133
Picture commands...........................................95
Picture Editor................................................... 31

370 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Index

Picture handling commands.......................... 126 RTU_TIME.............................................150, 306


Picture path..................................................... 67 RTU function..................................................303
Picture programs............................................. 31 RUBOUT....................................................... 137
Picture queue........................................ 126, 127 RUBOUT_BOL.............................................. 137
POINT....................................................320, 323 RUBOUT_CUR..............................................137
Poke.............................................................. 284 RUBOUT_EOL.............................................. 137
Polygon..........................................................323 S
POLYLINE............................................. 320, 323
POP....................................................... 338, 339 Save.............................................................. 351
Predefined picture variable..............................82 Scale..........................................53, 57, 150, 317
PRI.............................................................51, 52 SCALING.......................................................336
PRINT............................................................ 114 Scaling factor.........319, 334, 336, 337, 338, 339
PRINT_TRANSPARENT....................... 149, 306 SCIL.................................................................25
PRINTER_SET......................................149, 309 SCIL_HOST...........................................150, 214
Printout.............................................96, 114, 115 SCIL_LINE_NUMBER........................... 150, 227
Printout function.....................................149, 306 SCIL_TO_CSV...................................... 150, 283
Process database............................................54 SCIL coordinate.............................................335
Process object........................................... 53, 55 SCIL database.................................................75
Process query..........................................96, 110 SCIL Data Derivation Language......................91
PROGRAM.................................................... 135 SCIL defined printout.....................................306
PUSH.............................................................338 SCIL Editor.................................................... 347
SCIL program.................................................. 37
R SCIL Program Editor............................... 31, 352
RANDOM...............................................149, 164 Scope............................................................ 326
random number..................................... 149, 164 SDDL............................................................... 91
random order......................................... 151, 202 SEARCH................................................112, 236
READ.............................................................119 Searching...................................................... 354
READ_BYTES.......................................149, 264 SECOND............................................... 150, 171
READ_COLUMNS.................................149, 265 SELECT.................................................150, 201
READ_KEYS................................................. 120 Selecting Text................................................ 352
READ_NEXT................................................. 120 SEND_PIC.....................................................137
READ_PARAMETER............................ 149, 265 SEPARATE............................................150, 189
READ_PREV.................................................121 Service.............................................................36
READ_TEXT......................................... 149, 266 Service name.................................................284
Read-only...................................................... 351 Session..........................................................309
Read-only Mode.............................................. 28 SET..........................................55, 113, 124, 125
Real........................................................... 41, 42 SET_CLOCK......................................... 150, 171
RECALL_PIC.........................................126, 128 SET_EVENT_LIST_USER_NAME........150, 309
Redoing in SCIL Editor.................................. 356 SET_LANGUAGE..................................150, 226
REGISTRY............................................ 149, 213 SET_LOCAL_TIME............................... 150, 172
Relational operator.............................. 86, 89, 90 SET_RANDOM_SEED..........................150, 165
Remote terminal unit....................................... 53 SET_STATUS........................................150, 158
REMOVE....................................................... 121 SET_SYS_TIME....................................151, 172
REMOVE_DUPLICATES.......................149, 200 SET_TIME............................................... 98, 107
RENAME_FILE..............................................121 SET_UTC_TIME....................................151, 172
REP_LIB................................ 115, 117, 149, 266 SHADOW_FILE.....................................151, 267
REP_LIBS............................................. 150, 266 SHOW................................................... 129, 130
REPLACE......................................150, 189, 355 SHOW_BACK........................................129, 131
Replacing in SCIL Program Editor.................354 SHUFFLE.............................................. 151, 202
Report database.............................................. 54 SIN.........................................................151, 165
Reporting object.............................................. 54 Sine............................................................... 159
Request......................................................... 284 Snapshot variables.......................................... 80
RESET...................................................137, 138 SORT.....................................................151, 203
RESTORE............................................. 126, 128 SPACOM............................................... 151, 281
RETURN..................................................98, 107 SPREAD................................................151, 203
REVERSE............................................. 150, 201 SQL............................................................... 289
REVISION_COMPATIBILITY................ 150, 210 SQL_BEGIN_TRANSACTION.............. 151, 292
ROOT.................................................... 324, 326 SQL_COMMIT.......................................151, 293
ROUND................................................. 150, 164 SQL_CONNECT....................................151, 289
RTU......................................................... 53, 303 SQL_DISCONNECT..............................151, 290
RTU_ADDR........................................... 150, 303 SQL_EXECUTE.................................... 151, 291
RTU_AREAL......................................... 150, 304 SQL_FETCH......................................... 151, 291
RTU_ATIME.......................................... 150, 304 SQL_FREE_STATEMENT.................... 151, 292
RTU_BIN............................................... 150, 304 SQL_ROLLBACK.................................. 151, 294
RTU_HEXASC...................................... 150, 304 SQL statement...............................................291
RTU_INT............................................... 150, 304 SQRT.....................................................151, 165
RTU_KEY.............................................. 150, 305 Square root............................................151, 165
RTU_MSEC...........................................150, 305 STA............................................................51, 52
RTU_OA................................................ 150, 305 Stacking order............................................... 129
RTU_REAL............................................150, 305 Start program...................................................32

MicroSCADA X SYS600 10.5 371


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
Index 1MRK 511 664-UEN Rev. A

Statement.................................................. 27, 29 UPDATE................................................ 126, 129


Station............................................................. 53 Update program...............................................32
STATUS.................................................151, 210 Update time interval.................................97, 129
STATUS_CODE.................................... 151, 220 UPPER_CASE...................................... 152, 191
STATUS_CODE_NAME........................ 151, 220 USER.....................................................324, 326
Status code....... 41, 57, 101, 145, 150, 157, 158 User Interface Objects...............................49, 66
STOP.............................................................101 USM_ADDRESS................................... 152, 309
STORE_PIC.......................................... 126, 129 USM_AOR_DATA..................................152, 310
String function................................................181 USM_AUTHORIZATION_LEVEL.......... 152, 310
STY..................................................................51 USM_AUTHORIZATION_LEVEL_FOR_OBJEC
Sub-picture...................................................... 31 T....152, 310
SUBSTR................................................ 151, 190 USM_AUTHORIZATIONS..................... 152, 311
Subtraction................................................ 86, 87 USM_CHANGE_PASSWORD...............152, 311
SUM.......................................................151, 204 USM_IS_NEW_APPLICATION............. 152, 311
SUM_NEG.............................................151, 204 USM_LOGIN..........................................152, 311
SUM_POS............................................. 151, 204 USM_LOGOUT..................................... 152, 312
Syntax check................................................. 357 USM_PASSWORD_CHANGE.............. 152, 312
SYS................................................................. 51 USM_PASSWORD_POLICY.................152, 313
SYS_TIME.............................................151, 173 USM_RELEASE_USER_SESSIONS....152, 313
SYS_TIME_ADD................................... 151, 173 USM_SELECT_ROLE...........................152, 314
SYS_TIME_INTERVAL......................... 151, 173 USM_SESSION_ATTRIBUTES............ 152, 314
SYS_TIME.PAR.............................................177 USM_SESSION_ID............................... 152, 314
SYS_TO_LOCAL_TIME........................ 151, 174 USM_SESSIONS.................................. 152, 315
SYS_TO_UTC_TIME............................ 151, 174 USM_USER_LANGUAGE.....................152, 315
System Objects......................................... 49, 50 USM_USER_NAME.............................. 153, 315
USM_USER_ROLE...............................153, 315
T USM_USER_ROLES............................ 153, 315
tangent...........................................................160 UTC_TIME.............................................153, 179
Text............................................ 41, 44, 320, 323 UTC_TIME_ADD................................... 153, 179
TEXT_READ......................................... 151, 267 UTC_TIME_INTERVAL......................... 153, 179
Text files...........................................................73 UTC_TO_LOCAL_TIME........................153, 180
Text Selecting................................................ 352 UTC_TO_SYS_TIME............................ 153, 180
THEN.......................................................98, 102
Time.................................................41, 151, 174 V
TIME_SCAN.......................................... 151, 175 VALIDATE..............................................153, 221
TIME_ZONE_RULES............................ 151, 175 VALIDATE_OBJECT_ADDRESS.......... 153, 221
Time channel....................................... 35, 53, 59 Variable......................................................29, 79
time functions................................................ 165 VARIABLE_NAMES...............................153, 211
TIMEMS.................................................151, 177 Variable Assignment........................................80
Time of day............................................152, 178 Variable expansion.......................................... 82
TIMEOUT.............................................. 152, 281 Variable object........................................... 54, 62
Time-out........................................................ 281 Vector........................................ 41, 45, 153, 205
TIMES....................................................152, 178 Vector aggregate............................................. 45
Time stamp......................................................57 Vector function...............................................194
TOD....................................................... 152, 178 VIDEO_NR...................................................... 82
TODMS..................................................152, 178 Visual SCIL......................................................25
TODS.....................................................152, 179 Visual SCIL Commands.................................. 95
TOGGLE_MOD............................................. 137 Visual SCIL objects................................. 63, 122
Topic................................................................ 36 W
Topic name.................................................... 284
TRACE_BEGIN..................................... 152, 227 WEEK.................................................... 153, 180
TRACE_END.........................................152, 227 WHEN........................................................98, 99
TRACE_PAUSE.................................... 152, 228 WIN_BG_COLOR..................................129, 131
TRACE_RESUME................................. 152, 228 WIN_CREATE....................................... 129, 131
Tracing...........................................................337 WIN_INPUT...........................................129, 132
TRANSLATE..........................................152, 226 WIN_NAME........................................... 129, 133
TRANSLATION......................................152, 226 WIN_PIC................................................129, 133
Transparent printout...................................... 306 WIN_POS.............................................. 129, 134
TREND.................................................. 152, 204 WIN_REP.............................................. 129, 134
TRUE...............................................................43 Window............................................97, 129, 130
TRUNC.................................................. 152, 165 Window level................................................. 129
Type...................................................51, 54, 352 Workstation......................................................52
TYPE_CAST..........................................152, 158 WRITE........................................................... 122
WRITE_BYTES..................................... 153, 268
U WRITE_COLUMNS............................... 153, 268
Uncommenting.............................................. 353 WRITE_PARAMETER...........................153, 268
Undo.............................................................. 352 WRITE_TEXT........................................153, 269
Undoing in SCIL Program Editor................... 356 X
Unequal........................................................... 89
UNPACK_STR.......................................152, 190 XOR.................................................................91

372 MicroSCADA X SYS600 10.5


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
1MRK 511 664-UEN Rev. A Index

Y
YEAR.....................................................153, 180

MicroSCADA X SYS600 10.5 373


Programming Language SCIL
© 2023 Hitachi Energy. All rights reserved.
374
375
Hitachi Energy Finland Oy
Grid Automation
PL 688
65101 Vaasa, Finland

https://hitachienergy.com/microscadax Scan this QR code to visit our website


1MRK 511 664-UEN

© 2023 Hitachi Energy.


All rights reserved.

You might also like