0% found this document useful (0 votes)
12 views307 pages

Programming Guide

This document is a comprehensive guide for creating scripts in Axxon PSIM, covering both the embedded language and JScript. It includes detailed sections on programming tools, syntax, debugging, and numerous examples of scripts for various applications. The guide also provides appendices for additional resources and custom object creation instructions.

Uploaded by

Rousal Valino
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views307 pages

Programming Guide

This document is a comprehensive guide for creating scripts in Axxon PSIM, covering both the embedded language and JScript. It includes detailed sections on programming tools, syntax, debugging, and numerous examples of scripts for various applications. The guide also provides appendices for additional resources and custom object creation instructions.

Uploaded by

Rousal Valino
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Guide for creating scripts (programming)

PSIM 1.0.0-1.0.1 (english)

Last update 08/02/2024


1. Guide for creating scripts (programming) . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Guide for creating scripts. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 The Program object. Programming using the embedded language of Axxon
PSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.1 Programming tools in Axxon PSIM . . . . . . . . . . . . . . . . . . . . . . . . . 10
[Link] The Program system object . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
[Link] Debug window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
[Link] Syntax analyser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
[Link] Recommended procedure of writing programs . . . . . . . . . . . . . . 15
1.2.2 Description of syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
[Link] Description of variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
[Link] Description of procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
[Link].1 Standard procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
[Link].2 Creating custom procedures . . . . . . . . . . . . . . . . . . . . . . . 22
[Link] Description of operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
[Link] Operators and expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
[Link] Description of functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.2.3 Examples of scripts in the embedded language . . . . . . . . . . . . . . . . 40
[Link] Examples with Cameras and Video surveillance monitors . . . . . . 41
[Link] Examples with Computer and Display . . . . . . . . . . . . . . . . . . . . 47
[Link] Examples with Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
[Link] Examples with Archive and Edge storage . . . . . . . . . . . . . . . . . 50
[Link] Examples with Macros and Time zones . . . . . . . . . . . . . . . . . . . 51
[Link] Examples with PTZ devices and Control devices . . . . . . . . . . . . 53
[Link] Example with Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
[Link] Examples with Incident server and Incident manager . . . . . . . . . 58
[Link] Examples with Operator protocol and Event Viewer . . . . . . . . . . 59
[Link] Examples with Operator query panel and SIP-terminal . . . . . . . 60
[Link] Examples with Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
[Link] Example with Videogate . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
[Link] Examples with Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
[Link] Example with User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
[Link] Examples with Captions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
[Link] Examples with System restart service and Failover service . . . . 68
[Link] Example with BacNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
[Link] Examples with Relay and Sensors . . . . . . . . . . . . . . . . . . . . . 70
[Link] Examples with Message services and notification services . . . . . 72
1.2.4 Appendix 1. Priorities of the start and stop recording commands . . . . 75
1.2.5 Appendix 2. Defining the param_id and param_value values for the
SET_IPINT_PARAM reaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.3 The Script object. Programming using the JScript language . . . . . . . . . . . 80
1.3.1 Purpose and features of the JScript language . . . . . . . . . . . . . . . . . . 82
1.3.2 Programming in JScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
[Link] The Script system object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
[Link] The Editor-Debugger utility . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
[Link] The Debug window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
[Link].1 Enabling the Debug window . . . . . . . . . . . . . . . . . . . . . . . 90
[Link].2 Working with Debug window . . . . . . . . . . . . . . . . . . . . . . 92
[Link] Getting the list of system names of objects, reactions and events in
Axxon PSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

1
1.3.3 Creating your first script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
1.3.4 Working with script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
[Link] Creating a script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
[Link] Saving a script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
[Link] Deleting a script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
[Link] Searching text in script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
[Link] Replacing text in script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.3.5 Script debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
[Link] Script debugging features . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
[Link] Creating and using test events . . . . . . . . . . . . . . . . . . . . . . . 118
[Link] Working with the debugging windows of the Editor-Debugger utility
120
[Link].1 Viewing the script messages . . . . . . . . . . . . . . . . . . . . . . 121
[Link].2 Displaying messages about starting, verifying, changing and
executing scripts in the debugging windows . . . . . . . . . . . . . . . . . . 123
[Link] Using third-party debugger programs . . . . . . . . . . . . . . . . . . . 125
1.3.6 Examples of scripts in the JScript language . . . . . . . . . . . . . . . . . . 126
[Link] Examples of scripts with Video surveillance monitor and Cameras . 1
27
[Link] Examples of scripts with Map . . . . . . . . . . . . . . . . . . . . . . . . 131
[Link] Examples of scripts with detection tools . . . . . . . . . . . . . . . . . 132
[Link] Examples of scripts with Macros . . . . . . . . . . . . . . . . . . . . . . 133
[Link] Example of script with Users . . . . . . . . . . . . . . . . . . . . . . . . . 135
[Link] Examples of scripts with Incident server and Incident manager . 137
[Link] Example of script with Failover service . . . . . . . . . . . . . . . . . . 138
[Link] Examples of scripts with BacNet . . . . . . . . . . . . . . . . . . . . . . 139
[Link] Example with Telegram bot . . . . . . . . . . . . . . . . . . . . . . . . . . 141
[Link] Examples of scripts with Event Viewer . . . . . . . . . . . . . . . . . 142
1.3.7 Appendix 1. Description of the Editor-Debugger utility . . . . . . . . . . 143
[Link] The purpose of the Editor-Debugger utility . . . . . . . . . . . . . . . 144
[Link] The interface of the Editor-Debugger utility . . . . . . . . . . . . . . . 145
[Link].1 The Editor-Debugger interface . . . . . . . . . . . . . . . . . . . . 146
[Link].2 The Debug-edit script tab . . . . . . . . . . . . . . . . . . . . . . . . 147
[Link].3 The Script messages tab . . . . . . . . . . . . . . . . . . . . . . . . 149
[Link].4 Main menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
[Link].5 Description of the Filter dialog window . . . . . . . . . . . . . . . 158
[Link].6 Description of the Highlight dialog window . . . . . . . . . . . . 159
[Link].7 Description of the toolbar of the Editor-Debugger utility . . 161
1.3.8 Appendix 2. Creating custom objects with ability to set events, reactions
and states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
[Link] Purpose of custom objects and their implementation in Axxon PSIM
163
[Link] How to create a custom object . . . . . . . . . . . . . . . . . . . . . . . 164
[Link].1 DBI file preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
[Link].2 DDI file preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
[Link].3 XML file preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
[Link].4 Creating and using a custom object in Axxon PSIM . . . . . . 170
1.4 Description of events and reactions of system objects . . . . . . . . . . . . . . 173
1.4.1 GRABBER Video capture device . . . . . . . . . . . . . . . . . . . . . . . . . . 174
1.4.2 CAM Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

2
1.4.3 MONITOR Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
1.4.4 MACRO Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
1.4.5 SLAVE Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
1.4.6 DISPLAY Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
1.4.7 PLAYER Audio player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
1.4.8 CORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
1.4.9 MAP Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
1.4.10 OLXA_LINE Microphone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
1.4.11 TELEMETRY PTZ device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
1.4.12 TELEMETRY_EXT Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
1.4.13 JOYSTICK Control device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
1.4.14 TIME_ZONE Time zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
1.4.15 ARCH Backup archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
1.4.16 FAILOVER Failover service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
1.4.17 OPERATORPROTOCOL Operator protocol . . . . . . . . . . . . . . . . . . . 217
1.4.18 EVENT_VIEWER Event Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
1.4.19 GATE Videogate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
1.4.20 CAM_VMDA_DETECTOR VMDA detection . . . . . . . . . . . . . . . . . . . 221
1.4.21 TITLEVIEWER Captions search . . . . . . . . . . . . . . . . . . . . . . . . . . 222
1.4.22 PERSON User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
1.4.23 CAM_FACECAPTURE Face Detection . . . . . . . . . . . . . . . . . . . . . . 224
1.4.24 IPSTORAGE Edge storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
1.4.25 CAM_TITLE Captioner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
1.4.26 TELEGRAM Telegram bot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
1.4.27 CAM_IP_DETECTOR Embedded detection . . . . . . . . . . . . . . . . . . . 228
1.4.28 SIP_TERMINAL SIP-terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
1.4.29 INC_MANAGER Incident manager . . . . . . . . . . . . . . . . . . . . . . . . 230
1.4.30 INC_SERVER Incident server . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
1.4.31 DIALOG Operator query panel . . . . . . . . . . . . . . . . . . . . . . . . . . 232
1.4.32 MMS Mail Message Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
1.4.33 MAIL_MESSAGE Mail message . . . . . . . . . . . . . . . . . . . . . . . . . . 234
1.4.34 VMS Voice Message Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
1.4.35 GRELE Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
1.4.36 GRAY Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
1.4.37 VNS Voice notification service . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
1.4.38 SMS Short Message Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
1.4.39 SSS_WATCHDOG System restart service . . . . . . . . . . . . . . . . . . . 242
1.4.40 BACNET BacNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
1.5 Description of the object model in Axxon PSIM . . . . . . . . . . . . . . . . . . . 244
1.5.1 The Core object and its built-in methods . . . . . . . . . . . . . . . . . . . . 245
[Link] The Core object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
[Link] The SetObjectParam method . . . . . . . . . . . . . . . . . . . . . . . . . 247
[Link] The SetObjectState method . . . . . . . . . . . . . . . . . . . . . . . . . 248
[Link] The DebugLogString method . . . . . . . . . . . . . . . . . . . . . . . . . 249
[Link] The Base64Decode method . . . . . . . . . . . . . . . . . . . . . . . . . . 250
[Link] The Sleep method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
[Link] The Itv_var method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
[Link] The Int_var method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
[Link] The GetObjectParentType method . . . . . . . . . . . . . . . . . . . . . 254
[Link] The GetIPAddress method . . . . . . . . . . . . . . . . . . . . . . . . . . 255

3
[Link] The GetObjectName method . . . . . . . . . . . . . . . . . .... . . . 256
[Link] The GetObjectState method . . . . . . . . . . . . . . . . . .... . . . 257
[Link] The GetObjectParam method . . . . . . . . . . . . . . . . . .... . . . 258
[Link] The GetObjectParentId method . . . . . . . . . . . . . . . .... . . . 259
[Link] The DoReactStr method . . . . . . . . . . . . . . . . . . . . .... . . . 260
[Link] The DoReact method . . . . . . . . . . . . . . . . . . . . . . .... . . . 262
[Link] The DoReactSetupCore method . . . . . . . . . . . . . . . .... . . . 263
[Link] The DoReactSetup method . . . . . . . . . . . . . . . . . . .... . . . 264
[Link] The DoReactGlobal method . . . . . . . . . . . . . . . . . . .... . . . 265
[Link] The NotifyEventStr method . . . . . . . . . . . . . . . . . . .... . . . 266
[Link] The NotifyEvent method . . . . . . . . . . . . . . . . . . . . .... . . . 267
[Link] The NotifyEventGlobal method . . . . . . . . . . . . . . . . .... . . . 268
[Link] The CreateMsg method . . . . . . . . . . . . . . . . . . . . . .... . . . 269
[Link] The Lock and Unlock methods . . . . . . . . . . . . . . . . .... . . . 270
[Link] The IsAvailableObject method . . . . . . . . . . . . . . . . .... . . . 272
[Link] The GetUserId method . . . . . . . . . . . . . . . . . . . . . .... . . . 273
[Link] The GetEventDescription method . . . . . . . . . . . . . . .... . . . 274
[Link] The GetObjectIdByParam method . . . . . . . . . . . . . .... . . . 275
[Link] The SaveToFile method . . . . . . . . . . . . . . . . . . . . . .... . . . 276
[Link] The GetLinkedObjects method . . . . . . . . . . . . . . . . .... . . . 277
[Link] The WriteIni method . . . . . . . . . . . . . . . . . . . . . . . .... . . . 278
[Link] The ReadIni method . . . . . . . . . . . . . . . . . . . . . . . .... . . . 279
[Link] The AddIni method . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 280
[Link] The SetTimer method . . . . . . . . . . . . . . . . . . . . . . .... . . . 281
[Link] The KillTimer method . . . . . . . . . . . . . . . . . . . . . . .... . . . 282
[Link] The GetObjectChildIds method . . . . . . . . . . . . . . . .... . . . 283
[Link] The Base64EncodeFile method . . . . . . . . . . . . . . . . .... . . . 284
[Link] The Base64EncodeW method . . . . . . . . . . . . . . . . . .... . . . 285
[Link] The run_cmd and run_cmd_timeout methods . . . . . .... . . . 286
[Link] The WriteIniAny method . . . . . . . . . . . . . . . . . . . . .... . . . 287
[Link] The ReadIniAny method . . . . . . . . . . . . . . . . . . . . .... . . . 288
[Link] The AddIniAny method . . . . . . . . . . . . . . . . . . . . . .... . . . 289
1.5.2 The MsgObject and Event objects and their built-in methods and
properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 290
[Link] The MsgObject and Event objects . . . . . . . . . . . . . . .... . . . 291
[Link] The GetSourceType method . . . . . . . . . . . . . . . . . . .... . . . 292
[Link] The GetSourceId method . . . . . . . . . . . . . . . . . . . . .... . . . 293
[Link] The GetAction method . . . . . . . . . . . . . . . . . . . . . . .... . . . 294
[Link] The GetParam method . . . . . . . . . . . . . . . . . . . . . . .... . . . 295
[Link] The SetParam method . . . . . . . . . . . . . . . . . . . . . . .... . . . 296
[Link] The MsgToString method . . . . . . . . . . . . . . . . . . . . .... . . . 297
[Link] The StringToMsg method . . . . . . . . . . . . . . . . . . . . .... . . . 298
[Link] The StringToParams method . . . . . . . . . . . . . . . . . . .... . . . 299
[Link] The Clone method . . . . . . . . . . . . . . . . . . . . . . . . .... . . . 300
[Link] The GetObjectIds method . . . . . . . . . . . . . . . . . . . .... . . . 301
[Link] The GetObjectParams method . . . . . . . . . . . . . . . . .... . . . 302
[Link] The SourceType property . . . . . . . . . . . . . . . . . . . .... . . . 303
[Link] The SourceId property . . . . . . . . . . . . . . . . . . . . . .... . . . 304
[Link] The Action property . . . . . . . . . . . . . . . . . . . . . . . .... . . . 305
1.6 Programming guide. Conclusion . . . . . . . . . . . . . . . . . . . . . . .... . . . 306

4
Guide for creating scripts (programming)
Guide for creating scripts. Introduction
The Program object. Programming using the embedded language of Axxon PSIM
Programming tools in Axxon PSIM
The Program system object
Debug window
Syntax analyser
Recommended procedure of writing programs
Description of syntax
Description of variables
Description of procedures
Standard procedures
Creating custom procedures
Description of operators
Operators and expressions
Description of functions
Examples of scripts in the embedded language
Examples with Cameras and Video surveillance monitors
Examples with Computer and Display
Examples with Map
Examples with Archive and Edge storage
Examples with Macros and Time zones
Examples with PTZ devices and Control devices
Example with Core
Examples with Incident server and Incident manager
Examples with Operator protocol and Event Viewer
Examples with Operator query panel and SIP-terminal
Examples with Audio
Example with Videogate
Examples with Detection
Example with User
Examples with Captions
Examples with System restart service and Failover service
Example with BacNet
Examples with Relay and Sensors
Examples with Message services and notification services
Appendix 1. Priorities of the start and stop recording commands
Appendix 2. Defining the param_id and param_value values for the SET_IPINT_PARAM reaction

The Script object. Programming using the JScript language


Purpose and features of the JScript language
Programming in JScript
The Script system object
The Editor-Debugger utility
The Debug window
Enabling the Debug window
Working with Debug window
Getting the list of system names of objects, reactions and events in Axxon PSIM
Creating your first script
Working with script
Creating a script
Saving a script
Deleting a script
Searching text in script
Replacing text in script
Script debugging
Script debugging features
Creating and using test events
Working with the debugging windows of the Editor-Debugger utility
Viewing the script messages
Displaying messages about starting, verifying, changing and executing scripts in the debugging windows
Using third-party debugger programs
Examples of scripts in the JScript language
Examples of scripts with Video surveillance monitor and Cameras
Examples of scripts with Map

5
Examples of scripts with detection tools
Examples of scripts with Macros
Example of script with Users
Examples of scripts with Incident server and Incident manager
Example of script with Failover service
Examples of scripts with BacNet
Example with Telegram bot
Examples of scripts with Event Viewer
Appendix 1. Description of the Editor-Debugger utility
The purpose of the Editor-Debugger utility
The interface of the Editor-Debugger utility
The Editor-Debugger interface
The Debug-edit script tab
The Script messages tab
Main menu
Description of the Filter dialog window
Description of the Highlight dialog window
Description of the toolbar of the Editor-Debugger utility
Appendix 2. Creating custom objects with ability to set events, reactions and states
Purpose of custom objects and their implementation in Axxon PSIM
How to create a custom object
DBI file preparation
DDI file preparation
XML file preparation
Creating and using a custom object in Axxon PSIM

Description of events and reactions of system objects


GRABBER Video capture device
CAM Camera
MONITOR Monitor
MACRO Macro
SLAVE Computer
DISPLAY Display
PLAYER Audio player
CORE
MAP Map
OLXA_LINE Microphone
TELEMETRY PTZ device
TELEMETRY_EXT Keyboard
JOYSTICK Control device
TIME_ZONE Time zone
ARCH Backup archive
FAILOVER Failover service
OPERATORPROTOCOL Operator protocol
EVENT_VIEWER Event Viewer
GATE Videogate
CAM_VMDA_DETECTOR VMDA detection
TITLEVIEWER Captions search
PERSON User
CAM_FACECAPTURE Face Detection
IPSTORAGE Edge storage
CAM_TITLE Captioner
TELEGRAM Telegram bot
CAM_IP_DETECTOR Embedded detection
SIP_TERMINAL SIP-terminal
INC_MANAGER Incident manager
INC_SERVER Incident server
DIALOG Operator query panel
MMS Mail Message Service
MAIL_MESSAGE Mail message
VMS Voice Message Service
GRELE Relay
GRAY Sensor
VNS Voice notification service
SMS Short Message Service
SSS_WATCHDOG System restart service
BACNET BacNet

Description of the object model in Axxon PSIM


6
The Core object and its built-in methods
The Core object
The SetObjectParam method
The SetObjectState method
The DebugLogString method
The Base64Decode method
The Sleep method
The Itv_var method
The Int_var method
The GetObjectParentType method
The GetIPAddress method
The GetObjectName method
The GetObjectState method
The GetObjectParam method
The GetObjectParentId method
The DoReactStr method
The DoReact method
The DoReactSetupCore method
The DoReactSetup method
The DoReactGlobal method
The NotifyEventStr method
The NotifyEvent method
The NotifyEventGlobal method
The CreateMsg method
The Lock and Unlock methods
The IsAvailableObject method
The GetUserId method
The GetEventDescription method
The GetObjectIdByParam method
The SaveToFile method
The GetLinkedObjects method
The WriteIni method
The ReadIni method
The AddIni method
The SetTimer method
The KillTimer method
The GetObjectChildIds method
The Base64EncodeFile method
The Base64EncodeW method
The run_cmd and run_cmd_timeout methods
The WriteIniAny method
The ReadIniAny method
The AddIniAny method
The MsgObject and Event objects and their built-in methods and properties
The MsgObject and Event objects
The GetSourceType method
The GetSourceId method
The GetAction method
The GetParam method
The SetParam method
The MsgToString method
The StringToMsg method
The StringToParams method
The Clone method
The GetObjectIds method
The GetObjectParams method
The SourceType property
The SourceId property
The Action property

Programming guide. Conclusion


Export to PDF

7
Guide for creating scripts. Introduction
You can use programming with the help of scripts if Axxon PSIM interface settings of objects or Macros capabilities aren’t enough to
implement any operating scenario of Axxon PSIM. For more details about interactions between objects, see the table below.

There are two options for writing scripts in Axxon PSIM:

1. In the embedded programming language. You can use the Program system object of the Programming tab—see The
Program object. Programming using the embedded language of Axxon PSIM.
2. In the JScript language. You can use the Script system object of the Programming tab—see The Script object.
Programming using the JScript language.

Both options work, but the Program object is deprecated and is no longer developed. We recommend using the Script object and the
JScript language to write scripts.

This guide had the following information:

description of the settings for both objects,


syntax of the scripts and their debugging,
examples of scripts for each language.

The scripts use:

events, reactions and commands of Axxon PSIM objects. The main ones are described in Description of events and reactions of
system objects.
the Core, MsgObject, Event objects and their embedded methods described in Description of the object model in Axxon PSIM.

Methods of setting logical interactions between objects in Axxon PSIM


Axxon PSIM functionality is based on logical interactions between objects. General information on methods of setting logical
interactions:

Method of Description Implementation Example


setting
logical
interaction

Setting Basic configuration of interaction Implemented using functionality of system objects—see Axxon Configuring video display
panels of between system objects PSIM configuration and setup from the Camera in the M
system onitor interface window
objects

Macro Configuration of simple Implemented using the Macro object—see Creating and using Enabling actuator (relay)
interactions between objects if macros when sensor is closed
basic object settings are
insufficient

Program Configuration of complex Implemented using the Program object as the code in the Return PTZ cameras to
interactions between objects if embedded programming language of Axxon PSIM—see The their original position and
functionality of the Macro object Program object. Programming using the embedded language of take a photo every 15
is insufficient Axxon PSIM minutes

Script Implemented using the Script object as JScript code—see The


Script object. Programming using the JScript language

8
The Program object. Programming using the
embedded language of Axxon PSIM

9
Programming tools in Axxon PSIM

10
The Program system object
The Program system object is used to initialize the program written in the Axxon PSIM programming language in Axxon PSIM and set
its parameters.

The Program system object is created on the basis of the Programs object on the Programming tab of the System settings dialog
window.

Attention!

Creation of more than 100 Program system objects can cause system instability.

See the settings panel of the Program system object in the figure below:

11
On the settings panel of the Program system object, specify the time schedule of program execution and computers (cores) on which
the program must be executed.

Note

To set all checkboxes next to all computers, select a cell in the column with checkboxes and press Ctrl+A. To clear all
checkboxes, select a cell and press Shift+A.

To pre-filter events processed by the program, set the value in the Filter field. The filter format is TYPE|ID|EVENT divided by
semicolon, for example CAM||MD_STOP;CAM||MD_START to filter Alarm and Alarm end events from all Camera objects.

There is the word processor on the settings panel of the Program system object. It is used for writing and editing the program code.

You can undo or redo some action using hotkeys in the word processor on the settings panel of the Program system object. To undo
some action, press Alt+Backspace, to redo, press Ctrl+Y.

12
Debug window
The Debug window is used to view data about all events logged in the system.

You can call the Debug window by using the Debug command in the Run menu on the Main control panel. The Debug window is
displayed at the bottom of the screen.

By default, the Debug window isn't available. You can enable the Debug window by using the [Link] utility (see The Debug
window section of The Script object. Programming using the JScript language).

13
Syntax analyser
Embedded syntax analyser enables spell check of basic registered words, such as OnEvent, DoReact, OnTime, Wait, Sleep, and so on.
These registered words are marked in black in the program text field. Note that the analyser doesn't check if command parameters are
written correctly, so you must be very attentive in these cases.

To change the font size, use the key combinations:

CTRL and + to make font larger

CTRL and – to make font smaller

14
Recommended procedure of writing programs
On the page:

Setting a general task


Outlining the task into subtasks
Writing subtasks and debugging them
Finding and fixing bugs

1. Set a general task.


2. Outline the task into subtasks.
3. Write subtasks and debug them.
4. Find and fix bugs.

Setting a general task


You must have a clear vision of what must happen in the system when certain event occur. Specify the ID of devices that participate in
generating events and actions.

Outlining the task into subtasks


If several events must be processed in one task, then it must be clear what to do with each event. If possible, exclude the possibility of
loop script execution, it means, exclude any recursive actions if they are not related to task execution.

Writing subtasks and debugging them


The most difficult part of writing scripts is creating the list of actions with possible use of logic and cycle operations. Debugging of this
part of programming takes much time. Events generation that needs processing is not usually easy-to-use, especially on a real object—
for example fire sensor triggering or motion by camera that is far programming place (from the server with the system core). In this
case, it is recommended to generate an event manually at the stage of debugging, the best way is to run an empty macro. After the
body of the script is debugged, there is a real event instead of running the empty macro. Moreover, you can make sure whether the
event is written correctly events without starting the action list by running an empty macro and watching its performance in the Debug
window.

Finding and fixing bugs


At program startup, embedded syntax analyzer checks if names of functions are spelled correctly, but does not check the program
syntax (position of key characters: commas, semicolons and nested parentheses). In order to track the bugs in the program, if any,
you must activate the Debug 4 debug mode (see Enabling and configuring the debug mode of Axxon PSIM). In there are syntax
errors, the Critical errors window will be displayed at the stage of the program body execution. This window lists the names of
functions with incorrect syntax and other debugging information.

15
Note

If the syntax is correct, but the program still doesn't work or works with errors, we recommend rewriting the program as a
script in JScript (see The Script object. Programming using the JScript language).

16
Description of syntax
Script consists of the set of procedures.

All operators executed inside procedures are enclosed in {..} blocks.

If you want to write a comment, you need to put reserved characters // before the comment.

17
Description of variables
All variables in the system are string variables.

To compare string variables and values, use the bool strequal (string1,string2) function. The strequal function returns the nonzero
value if strings are equal (see Description of functions).

To do integer operations, use the str(string1) function (see Description of functions).

18
Description of procedures

19
Standard procedures
There are three standard procedures that can be performed when the corresponding event occurs:

1. OnInit()—used for initialization of variables (setting initial values) that will be used in scripts. It is executed before starting all
modules of the system. We recommend calling the procedure once for all scripts.
Example of use:

OnInit(){
flag=1;
num=8; //variables will be initialized at startup
}

2. OnTime(DOW (1-7), day-month-year, hours, minutes, seconds)—running at specific time.

OnTime(W,D,X,Y,H,C,S)
{
//W - DOW (0 - Monday, 6 - Sunday);
//D - date in the day-month-year format, 16 August 2001 is "16-08-01"
//X,Y - reserved
//H - hour
//C - minutes
//S - seconds
// COMPARING WITH PARAMETERS, THE ACTION IS SPECIFIED FURTHER
}

Examples of use:

OnTime(W,"16-08-01",X,Y,"11","11","30")
{
//the code will be executed on 16 August, 2001 at 11:11:30
}

OnTime(W,D,X,Y,"11","11","30")
{
//the code will be executed every day at 11:11:30
}

OnTime(W,"16-08-01",X,Y,H,C,S)
{
//the code will be executed on 16 August, 2001
//every second
}

OnTime(W,"16-08-01",X,Y,"11","11",S)
{
//the code will be executed on 16 August, 2001
//every second from 11:11 to 11:12
}

OnTime("0",D,X,Y,"21","0","0")
{
//the code will be executed every Monday
// at 21:00:00
}

3.
20
3. OnEvent(source type, number,event)—running if there is a specific event from the system object. This is the main procedure
when writing scripts.
Examples of use:

OnEvent("GRAY","1","ON")
{
//will be executed when closing sensor 1
}

OnEvent("CAM","12","MD_START")
{
//will be executed when motion detection tool of camera 12 triggers
}

Each procedure that has parameters can be seen in a code many times with various parameters. When an event occurs, the system
will execute those of them that have the same parameters as one that has occurred.

The procedure parameter can be defined or not. If it is defined, then its value is in quotes, otherwise the parameter is written in Latin
letters and the procedure will be executed for all events for which it can be defined.

Examples of use:

OnEvent("GRAY","1","ON") // will be executed when closing sensor 1


{
i=1;
i=i+1; //as variables are string, then the sum will be 11
j=1;
j=str(j+1); // str is a number-to-string conversion function. Inside the str
//function all string variables (if any) are converted to integers and
//then all integers are added together, therefore, the sum will be 2.
}

OnEvent("GRAY",N,"ON") //will be executed when any sensor is closed


{
if(strequal(N,"3")
{
// will be executed if this is sensor 3
}
}

21
Creating custom procedures
All custom procedures described in the script must be in the same program body and before procedures in which they are called.

procedure ProcedureName(list of parameters){


//procedure body
}

Attention!

The names of parameters must consist of one uppercase character.

Examples of use:

procedure ProcedureName(A,B)

{
n=A+" "+B;
//when running macro 1 n=«Macro 1», when running macro 16 n=«Macro 16»
}

OnEvent("MACRO",N,"RUN")

{
a1=N;
a2="Macro";
ProcedureName(a2,a1);
}

22
Description of operators
The list of operators used to describe actions:

1. DoReact(object type, number, action[,Parameters])—execute an action.


Example of use:

OnEvent("GRAY","1","ON")
{
DoReact("GRELE","1","ON"); //close relay 1 when closing sensor 1
}

2. DoCommand(command line)—run the command line.


Examples of use:

OnEvent("GRAY","1","ON")
{
DoCommand("[Link]"); //when sensor 1 is closed, run "Notepad"
}

3. Wait(number of seconds)—wait for N seconds;


Sleep(number of milliseconds)—wait for N milliseconds.
Await operators must be in a single thread. Single thread must be inside square brackets.
Example. When Sensor 1 is closed, Relay 1 is closed for five seconds.

OnEvent("GRAY","1","ON")
{
[
DoReact("GRELE","1","ON");
Wait(5);
DoReact("GRELE","1","OFF");
]
}

4. Function to check the object state:


CheckState(object type, number, state)—the result is 1, if the state of an object is factually accurate, otherwise 0.
Expressions can be used as parameters. Constant values are quoted.
Example. Check the state of camera 2 when closing sensor 1 and if the state is “Alarmed“, then close relay 1

OnEvent("GRAY","1","ON")
{
if(CheckState("CAM","2","ALARMED"))
{
DoReact("GRELE","1","ON");
}
}

5. Conditional operator:

If (expression)
{
... // if the result is not equal to 0
}
else
{
... // if the result is equal to 0
}

else {} part can be absent.


Example of use:

23
OnEvent("MACRO","1","RUN"){
x=5;
if(x>10) {y=2;} // if "x" is greater than 10, then y=2
else {y=3;} //otherwise y=3
}

6. For operator:

For(expression 1; expression 2; expression 3){


...
}

Expression1 is executed at the beginning of the loop; loop body is executed if expression2 is true; expression3 is executed
after each execution of the loop body.
Example. When sensor1 is closed, relay1 is closed and opened every second and it will happen 10 times.

OnEvent
("GRAY","1","ON")
{
[
for(i=0;i<10;i=str(i+1))
{
DoReact("GRELE","1","ON");
Wait(1);
DoReact("GRELE","1","OFF");
Wait(1);
}
]
}

7. DoReactGlobal(object type, number, state)—function that creates reactions of system objects. Meanwhile, the created
reaction is sent to all cores connected over the network.
Example. When running macro 1, camera 1 is armed.

OnEvent("MACRO","1","RUN")
{
DoReactGlobal("CAM","1","ARM");
}

8. NotifyEventGlobal(object type, number, state)—function that creates system events. Meanwhile, the created events are sent
to all cores connected over the network.
Example. When running macro 1, create event “Recording” for camera 1. The command is sent to all cores as an event in order
to be logged.

OnEvent("MACRO","1","RUN")
{
NotifyEventGlobal("CAM","1","REC");
}

Note

If there is no need to send event to all system cores, then use the NotifyEvent function.

24
Operators and expressions
The table below lists and describes comparison, arithmetic and conditional operators.

Operato General description, example of use


r

Comparison operators

> Comparison operator—greater.

See example in Description of operators

< Comparison operator—less.

See example in Description of operators

Arithmetic operators

+ Addition operator. Example of use:

OnEvent ("MACRO","1","RUN")
{
x=5;
y=10;
i=x+y; // add strings, i.e. 5+10=510
e=str(x+y); // add integers 5+10=15
}

- Subtraction operator. Example of use:

OnEvent ("MACRO","1","RUN")

{
x=5;
y=10;
i=x-y; // subtract integers 5-10=-5
e=str(x-y); // subtract integers 5-10=-5
}

* Multiplication operator. Example of use:

OnEvent ("MACRO","1","RUN")
{
x=5;
y=10;
i=x*y; // multiply integers 5*10=50
e=str(x*y); // multiply integers 5*10=50
}

/ Division operator. Example of use:

OnEvent ("MACRO","1","RUN")
{
x=5;
y=10;
i=x/y; // divide integers 5/10=0.5
e=str(x/y); // divide integers 5/10=0.5
}

25
% Remainder after integer division. Example of use.

OnEvent ("MACRO","1","RUN")
{
a=1120.0;
b=100;
e=a%b; // remainder after integer division, i.e 1100 is divided by 100 and 20 is remainder.
// if there is division without remainder, then result is 0
}

() Group of arithmetic operators. Example of use.

OnEvent ("MACRO","1","RUN")
{
x=100/((5*8)/1.028);
}

Logical operators

&& Logical AND operator. Example of use:

OnEvent ("MACRO","1","RUN")
{
a=1;
b=2;
z=3;
if((a<b)&&(b<z))
{
y=1; //if false, then else
}
else
{
x=0;
}
}

! Logical inversion operator. Example of use:

OnEvent ("CAM",N,"MD_START")
{
if(!(strequal(N,"1",)))
{
DoReact("GRELE","1",""ON)
}
else
{
DoReact("GRELE","2",""ON)
}
}

26
Description of functions
General description and examples of use of math functions, conversion functions, as well as format functions and string functions are
represented in the table.

Functions General description, example of use

(The number of executable


parameters is specified in
square brackets)

MATH

sin[1] Trigonometric function for calculating the sine of an angle.

Format: y=sin(x); where y—function value, x—argument of function (in radians)

Example:

y=sin(1.6)

Event received:

Event : CORE VAR_CHANGED nt_obj_id<1>,value<0.997495>,name<y>,time<15:26:41>,


date<21-09-04>

cos[1] Trigonometric function for calculating the cosine of an angle.

Format: y=cos(x); where y—function value, x—argument of function (in radians)

Example:

y=cos(2.2)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<-0.588501>,name<y>,time<16:00:45>,


date<21-09-04>

tan[1] Trigonometric function, returns the tangent of an angle.

Format: y=tan(x); where y—function value, x—argument of function (in radians)

Example:

y=tan(1)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<1.557408>,name<y>,time<16:43:45>,


date<21-09-04>

asin[1] Returns the arc sine of the specified numeric expression.

Format: y=asin(x); where y—function value (in radians), x—argument

Example:

y=asin(0.5)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<0.523599>,name<y>,time<16:46:39>,


date<21-09-04>

27
acos[1] Returns the arc cosine of the specified numeric expression.

Format: y=acos(x); where y—function value (in radians), x—argument

Example:

y=acos(0.55)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<0.988432>,name<y>,time<16:46:39>,


date<21-09-04>

atan[1] Returns the arc tangent of the specified numeric expression.

Format: y=atan(x); where y—function value (in radians), x—argument

Example:

y=atan(1.2)

Event received:

Event : Event : CORE VAR_CHANGED int_obj_id<1>,value<0.876058>,name<y>,time<17:


07:09>,date<21-09-04>

sinh[1] The sinh function returns hyperbolic sine of the argument value.

Format: y=sinh(x); where y—function value, x—argument of function

Example:

y=sinh(0.8)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<0.888106>,name<y>,time<17:12:26>,


date<21-09-04>

cosh[1] The cosh function returns hyperbolic cosine of the argument value.

Format: y=cosh(x); where y—function value, x—argument of function

Example:

y=cosh(0.35)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<0.336376>,name<y>,time<17:25:25>,


date<21-09-04>

tanh[1] Trigonometric function for an angle calculation.

Format: y=tanh(x); where y—function value, x—argument of function

Example:

y=tanh(0.35)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<1.419068>,name<y>,time<17:25:25>,


date<21-09-04>

28
exp[1] Returns the value of the e^x function, where x—specified numeric expression.

Format: y=exp(x); where y—function value, x—argument

Example:

y=exp(1.65)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<5.20698>,name<y>,time<17:39:22>,


date<21-09-04>

log[1] Returns the natural logarithm (base-e) of the specified numeric expression.

Format: y=log(x); where y—function value, x—argument

Example:

y=log(0.65)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<-0.430783>,name<y>,time<17:43:22>,


date<21-09-04>

log10[1] Returns the common logarithm (base-10) of the specified numeric expression.

Format: y=log10(x); where y—function value, x—argument

Example:

y=log10(0.05)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<-1.30103>,name<y>,time<17:46:28>,


date<21-09-04>

sqrt[1] Returns the square root of the specified numeric expression.

Format: y=sqrt(x); where y—function value, x—argument

Example:

y=sqrt(9)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<3>,name<y>,time<17:25:25>,date<21-


09-04>

abs[1] The abs function returns the absolute value of the argument.

Format: y=abs(x); where y—function value, x—argument

Example:

y= abs(-1)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<1>,name<y>,time<13:39:37>,date<22-


09-04>

29
deg[1] Trigonometric function for an angle calculation. Returns the grade measure.

Format: y=deg(x); where y—function value in grades, x—argument value in radians

Example:

y=deg(3.14)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<179.908748>,name<y>,time<13:13:51>,


date<22-09-04>

rad[1] Trigonometric function for an angle calculation.

Format: y=rad(x); where y—function value in radians, x—argument value in grades

Example:

y=rad(180)

Event received:

Event : CORE VAR_CHANGED value<3.141593>,name<y>,time<15:04:17>,date<17-03-08>

CONVERSION

floor[1] Integer conversion function (rounding downward).

Format: x= floor(y); where x—function value, y—fraction or integer

Example:

x= floor(5.55)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<5>,name<x>,time<20:51:48>,date<21-


09-04>

ceil[1] Integer conversion function (rounding upward).

Format: x= ceil (y); where x—function value, y—fraction or integer

Example:

x= ceil(5.55)

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<6>,name<x>,time<20:51:48>,date<21-


09-04>

str[1] Integer-to-string conversion function.

Format: x=str(y); where x—function value, y—argument

Example:

z=(9);

a=str(z);

b=sqrt(a);

Events received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<9>,name<z>,time<14:27:31>,date<22-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<9>,name<a>,time<14:27:31>,date<22-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<3>,name<b>,time<14:27:31>,date<22-


09-04>

30
atof[1] String-to-integer conversion function.

Format: x=atof(y); where x—function value, y—argument

Example:

x="0";

x=str(atof(x)+10);

Event received:

Event : CORE VAR_CHANGED value<0>,name<x>,time<15:34:44>,date<17-03-08>

Event : CORE VAR_CHANGED value<10>,name<x>,time<15:34:44>,date<17-03-08>

val[1] Integer-to-string conversion function.

Format: x=val(y); where x—function value, y—argument

Example:

x="10";

x=str(val(x)+2);

Event received:

Event : CORE VAR_CHANGED value<10>,name<x>,time<15:34:44>,date<17-03-08>

Event : CORE VAR_CHANGED value<12>,name<x>,time<15:34:44>,date<17-03-08>

int[1] Conversion of fraction into integer (without fractional part).

Format: x=int(y); where x—function value, y—argument (fraction for conversion)

Example:

y=(2.33);

x=int(y);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<2.33>,name<y>,time<16:05:28>,


date<22-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<2>,name<x>,time<16:05:28>,date<22-


09-04>

long2time[1] It is used to convert specified number of seconds into time.

Format: x=long2time(y); where x—function value(time), y—number in seconds

Format of the initial recording (argument): <MM>

Format of final recording: <HH:MM:SS>

Example:

x=long2time(12345);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<03:25:45>,name<x>,time<13:53:02>,


date<20-09-04>

31
time2long[1] Convert time into a number of seconds.

Format: x=time2 long(y); where x—value in seconds, y—time in the <hours>.<minutes>


format

Example:

y=(0.15);

x=time2long(y);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<0.15>,name<y>,time<19:39:49>,


date<22-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<900>,name<x>,time<19:39:49>,


date<22-09-04>

scalar2date[1] Convert a number of days into a date (number of days is calculated AD).

Format: x= scalar2date (y); where x—value(date), y—number of days

Example:

y=(731500);

x=scalar2date(y);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<731500>,name<y>,time<19:57:46>,


date<22-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<12-10-03>,name<x>,time<19:57:46>,


date<22-09-04>

scalar[1] Convert date to number of days (number of days is calculated AD).

Format: x=scalar(y); where x—numerical value (in days), y—date

Recording format: <[Link]>

Example:

x=scalar(“19.10.2004”)

Event received:

Event : CORE VAR_CHANGED int_obj_id<10>,value<731873>,owner<WS1>,name<x>,


time<15:24:11>, guid_pk<{42E93AF5-4862-485E-AEF6-D14C7BF79C5B}>,date<08-12-09>

convert_num[1] Convert a number into the string.

Format: x=convert_num(y); where x—string value of the number, y—convertible number

Example:

y=(24009921);

x=convert_num(y);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<24009921>,name<y>,time<12:37:20>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<Twenty four million nine thousand nine


hundred twenty-one >,name<x>,time<12:37:20>,date<23-09-04>

32
convert_cur[1] Convert a number (sum of money) into the string and add dollars and cents.

Format: x=convert_cur(y); where x—string value of the sum of money, y—number (sum of
money)

Recording format: <[Link]>

Example:

y=(17999.98);

x=convert_cur(y);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<17999.98>,name<y>,time<12:49:30>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<Seventeen thousand nine hundred ninty-


nine dollars ninty-eight cents>,name<x>,time<12:49:30>,date<23-09-04>

FORMATTING

number_frm[2] Formatting a number.

Format: x=number_frm(y,z); where x—function value, y—initial number, z—number of figures


after the decimal

Example:

y=(17999.09998);

x=number_frm(y,3);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<17999.09998>,name<y>,time<14:21:


24>,date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<17999.100>,name<x>,time<14:21:24>,


date<23-09-04>

int_frm[2] Formatting number.

Format: x=int_frm(y,z); where x—value, y- operand, z—number of output digits

Example:

y=(17999.99);

x=int_frm(y,10);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<17999.99>,name<y>,time<14:31:46>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<0000017999>,name<x>,time<14:31:


46>,date<23-09-04>

currency_std[1] Formatting currency value (from '.' to '-').

Format: x=currency_std(y); where x—function value with modified format, y—number (sum of
money)

Example:

x=currency_std(3.62);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<3-62>,name<x>,time<13:40:01>,


date<23-09-04>

33
IsVarExist[1] The function that checks a specified parameter in the event.

Format: y=IsVarExist(“x”); where y—value, x—parameter

If the parameter exists, then “1” returns, otherwise “0”.

Example:

p=IsVarExist(“param0”)

Event received:

Event : CORE VAR_CHANGED int_obj_id<10>,value<0>,owner<WS1>,name<p>,time<12:


02:11>, guid_pk<{6A8B5BC9-919C-4098-844A-FBF78FA20820}>,date<14-12-09>

The function that returns the first object ID found by a specified parameter.

GetObjectIdByParam [3] Id=GetObjectIdByParam ("x","y","z"); where id—returned value, x—object type, y—parameter,
z—parameter value

Example:

Id=GetObjectIdByParam("CAM","color","0");

Event received:

Event : CORE VAR_CHANGED date<28-02-11>,value<2>,int_obj_id<1>,fraction<218>,


name<Id>, guid_pk<{F903A28C-3243-E011-901F-6CF049E58698}>,time<15:02:04>,
owner<D-IVANOV>

* Id=2 (see value<2>), if the function returns empty value (value< >), then check if the
function and its parameters are written correctly

STRING

strequal[2] Comparing strings.

Format: x= strequal(z,y); where x—value, z and y—compared strings

Example:

z=str(1019);

y=str(1019);

x=strequal(z,y);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<1019>,name<z>,time<16:51:45>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<1019>,name<y>,time<16:51:45>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<1>,name<x>,time<16:51:45>,date<23-


09-04>

* «value<1>» (see example above)—in the received event we get «value<>»—compared


strings differ, or «value<1>»—compared strings are the same

34
strsub[2] Determining if there is a substring in the string.

Format: x=strsub(y,z); where x—value, y—string in which the search is performed, z—substring

Example 1:

z=str(888123);

y=str(123);

x=strsub(z,y);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<888123>,name<z>,time<16:07:07>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<123>,name<y>,time<16:07:07>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<4>,name<x>,time<16:04:34>,date<23-


09-04>

Example 2:

z="67hb8vc56";

y="vc";

x=strsub(z,y);

Event received:

Event : CORE VAR_CHANGED value<67hb8vc56>,name<z>,time<12:15:09>,date<18-03-08>

Event : CORE VAR_CHANGED value<vc>,name<y>,time<12:15:09>,date<18-03-08>

Event : CORE VAR_CHANGED value<6>,name<x>,time<12:15:09>,date<18-03-08>

* "value<4>" (see example 1)—index in the initial string. Starting from this index, the first
occurrence of the substring in the string is detected. If the search result is negative, the
function returns value<>

strempty[1] Determining if the string is empty.

Format: x=strempty(y); where x—value (1 if string is empty), y—string

Example:

y=("");

x=strempty(y);

Event received:

Event : CORE VAR_CHANGED value< >, name<y>,time<12:27:32>,date<18-03-08>

Event : CORE VAR_CHANGED value<1>,name<x>,time<12:27:32>,date<18-03-08>

* function value value <> means that string is not empty

35
straleft[2] Left alignment.

Format: x=straleft(y,z); where x—aligned string, y—string, z—alignment value

Example:

y=str(123456789);

x=straleft(y,5);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<123456789>,name<y>,time<18:04:05>,


date<23-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<12345>,name<x>,time<18:04:05>,


date<23-09-04>

Note. If z is larger than the number of characters in the string, then the function adds spaces
to the initial string on the right until its length becomes z

strmid[3] Get substring.

Format: x=strmid(y,z,w); where x—string value, y—string, z—string position, w—substring


length

Example:

z=(7);//position

w=(9);//length

x=strmid("get substring (1 - string, 2 - position, 3 - length)",z,w);

y=strmid("get substring (1 - string, 2 - position, 3 - length)",17,10);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<6>,name<z>,time<14:18:08>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<9>,name<w>,time<14:18:08>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<substring>,name<x>,time<14:18:08>,


date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<1 – string>,name<y>,time<14:18:08>,


date<24-09-04>

strletf[2] Get left side of string.

Format: y=strleft(s,w); where y—string value, s—string, w—length (from string beginning)

Example:

w=(5);//length

s=("Get left side of string");//string

y=strleft(s,w);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<5>,name<w>,time<14:54:31>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value< Get left side of string>,name<s>,


time<14:54:31>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<Get>,name<y>,time<14:54:31>,


date<24-09-04>

36
strright[2] Get right side of string (1—string, 2—length).

Format: y=strleft(s,w); where y—string value, s—string, w—length (from string end)

Example:

w=(6);// length

s=("Get right side of string");//string

y=strright(s,w);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<6>,name<w>,time<15:10:36>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value< Get right side of string>,name<s>,


time<15:10:36>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<strings>,name<y>,time<15:10:36>,


date<24-09-04>

strnleft[2] Get without left side of string.

Format: y=strnleft(s,w); where y—string value, s—string, w—length of left side that will be cut

Example:

w=(6);//length

s=("get without left side of string");//string

y=strnleft(s,w);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<6>,name<w>,time<15:32:38>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<get without left side of string>,name<s>,


time<15:32:38>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<without left side of string>,name<y>,


time<15:32:38>,date<24-09-04>

srtnright[2] Get without right side of string.

Format: y=strnright(s,w); where y—string value, s—string, w—length of right side that will be
cut

Example:

w=(6);//length

s=("get without right side of string");//string

y=strnright(s,w);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<6>,name<w>,time<15:44:31>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<get without right side of string>,


name<s>,time<15:44:31>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value< get without right side of string>,


name<y>,time<15:44:31>,date<24-09-04>

37
get_substr[3] Get substring (1—string, 2—substring to start with, 3—substring to end with, "\r"—end of
string).

Format: y=get_substr(s,w,x); where y—value(substring), s—string, w—substring to start with,


x—substring to end with("\r"—end of string)

Recording format: <[Link]>

Example:

s=("get substring 1234567890");//string

w=("to");// substring to start with

x=("\r");//substring to end with, "\r"—end of string

y=get_substr(s,w,x);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<get substring 1234567890>,name<s>,


time<16:34:13>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<sub>,name<w>,time<16:34:13>,


date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<\r>,name<x>,time<16:34:13>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<substring 1234567890>,name<y>,


time<16:34:13>,date<24-09-04>

Example:

s=("get substring 1234567890");//string

w=("to");// substring to start with

x=(1);//substring to end with, "\r"—end of string

y=get_substr(s,w,x);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<get substring 1234567890>,name<s>,


time<16:36:26>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<sub>,name<w>,time<16:36:26>,


date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<1>,name<x>,time<16:36:26>,date<24-


09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<substring >,name<y>,time<16:36:26>,


date<24-09-04>

strltrim[1] Remove spaces on the left.

Format: y=strltrim(w); where y—result string value, w—string

Example:

w=(" remove spaces on the left");//string

y=strltrim(w);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value< remove spaces on the left>,name<w>,


time<17:07:49>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<remove spaces on the left>,name<y>,


time<17:07:49>,date<24-09-04>

38
strrtrim[1] Remove spaces on the right.

Format: y=strrtrim(w); where y—result string value, w—string

Example:

w=("Remove spaces on the right ");//string

y=strrtrim(w);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value<Remove spaces on the right >,


name<w>,time<17:18:35>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<Remove spaces on the right>,name<y>,


time<17:18:35>,date<24-09-04>

stratrim[1] Remove spaces on both sides.

Format: y=stratrim(w); where y—result string value, w—string

Example:

w=(" remove spaces on both sides ");//string

y=stratrim(w);

Event received:

Event : CORE VAR_CHANGED int_obj_id<1>,value< remove spaces on both sides >,


name<w>,time<17:27:44>,date<24-09-04>

Event : CORE VAR_CHANGED int_obj_id<1>,value<remove spaces on both sides>,name<y>,


time<17:27:44>,date<24-09-04>

Note

The date<DD-MM-YY> and time<HH:MM:SS> functions return the current date and time. The pi<3,
1415926535897932384626433832795> function returns the value of π.

39
Examples of scripts in the embedded language

40
Examples with Cameras and Video surveillance
monitors
GRABBER Video capture device

MACRO Macro

CAM Camera

MONITOR Monitor

Formats and functions


Format of events procedure for the Video capture device:

OnEvent("GRABBER","_id_","_event_")

Operator format to describe actions with the Video capture device:

DoReact("GRABBER","_id_","_command_" [,"_parameters_"]);

Format of the event procedure for the Camera object:

OnEvent("CAM","_id_","_event_")

Operator format to describe actions with the Camera:

DoReact("CAM","_id_","_command_" [,"_parameters_"]);

Function to check the state of the Camera object:

CheckState("CAM","number","state")

Format of event procedure for the Monitor object:

OnEvent("MONITOR","_id_","_event_")

Operator format to describe actions with the Monitor:

DoReact("MONITOR","_id_","_command_"[,"_parameters_"]);

Examples
Examples of using events and reactions of the Video capture device object:

1. It is required to set the first channel for the first video capture device, maximum speed of digitizing, resolution is half-frame
and PAL format when starting the first macro.

OnEvent("MACRO","1","RUN") // start macro 1


{
DoReact("GRABBER","1", "SETUP", "chan<1>,mode<0>,resolution<1>,format<PAL>");
//set channel 1 for the first video capture device, speed of digitizing is maximum, resolution is
half-frame, format is PAL
}

2.
41
2. Set disks D:\ and F:\ for recording video archive when starting the third macro.

OnEvent("MACRO","3","RUN") //start macro 3


{
DoReact("GRABBER","1","SET_DRIVES","drives<D:\,F:\>"); //record the video archive on disks D:\ and F:
\
}

3. It is required to display the first camera on the first analog output and disable the first analog outputs of the first and second
cards when there is an error of connection to the second video capture device.

OnEvent("GRABBER","2"," UPS_FATAL_ERROR") //error of connection to the video capture device 2


{
DoReact("CAM","1","MUX1"); //display camera 1 on the 1-st analog output of card
Wait(5);
DoReact("GRABBER","1","MUX1_OFF"); //disable 1-st analog output of the first card
DoReact("GRABBER","2","MUX1_OFF"); //disable 1-st analog output of the second card
}

Note

If analog outputs of two or more cards are connected in parallel and, for example, camera 1 belongs to the first
grabber and camera 2 belongs to the second grabber, then when running the «DoReact("CAM","1","MUX1");»
command, it is required to run the «DoReact("GRABBER","2","MUX1_OFF");» command first. And correspondingly
when running the «DoReact("CAM","2","MUX1");» command, it is required to run the «DoReact("GRABBER","1","
MUX1_OFF");» command first. Otherwise signal overlaying will happen.

4. It is required to disable the second analog output of the video capture device when restoring the mains supply.

OnEvent("GRABBER","1","UPS_ONLINE") //restoring the mains supply


{
DoReact("GRABBER","1","MUX2_OFF"); //disable analog output 2
}

Examples of using events and reactions of the Camera object:

1. Switch camera to the color mode and start recording from it when arming the first camera.

OnEvent("CAM","1","ARM") //first camera is armed


{
DoReact("CAM","1","SETUP","color<1>"); // set color mode of camera
DoReact("CAM","1","REC"); //record from the first camera
}

2. Arm the first camera when disabling the fifth camera.

OnEvent("CAM","5","DETACH") // fifth camera is disabled


{
DoReact("CAM","1","ARM"); //first camera is armed
}

3. Use half of resources when recording from the first camera (it means, if four cameras are connected through the first video
capture device than the first camera will record with speed of 6 FPS, and other three cameras—with speed of 2-2.5 FPS) if it is
in the alarm state.

OnEvent("CAM","1","MD_START") //first camera is in alarm state


{
DoReact("CAM","1","SETUP","rec_priority<2>"); // use half of resources when recording
}

4.
42
4. Set maximum compression synchronously with the fourth microphone of audio card on the first camera when recording on disk
from the first camera.

OnEvent("CAM","1","REC") //first camera recording on disk


{
DoReact("CAM","1", "SETUP", "compression<5>, audio_type<OLXA_LINE>, audio_id<4>"); //first camera,
maximum compression, synchronously with the forth microphone of audio card.

5. Start recording from the first camera with minimum quality in black and white mode when it isn't alarmed.

OnEvent("CAM","1","MD_STOP") // first camera stopped to be in alarm state


{
value = 5;
DoReact("CAM", "1", "SETUP", "compression<" + value + ">,color<0>");
//start recording from the first camera with minimum quality in the black and white mode.
}

6. Start recording from the first camera in the “rollback” mode when it is disarmed.

OnEvent("CAM","1","DISARM") //first camera is disarmed


{
DoReact("CAM","1","REC","rollback<1>"); // Start recording from the first camera in the "rollback"
mode
}

7. Set new parameters of video signal when connecting the first camera.

OnEvent("CAM","1","ATTACH") //first camera is connected


{
VIDEO_CANAL_ID = GETOBJECTPARAM("CAM","1","PARENT_ID"); // define ID of video channel to which the
first camera belongs
DoReact("GRABBER",VIDEO_CANAL_ID,"SETUP","chan<0>,mode<0>,resolution<1>,format<pal>"); //set new
parameters of video channel
}

8. Start auto cruising on Camera 1 when Macro 2 is run.

OnEvent ("MACRO","2","RUN")
{
DoReact("CAM","1","CRUISE_START","cruise_id<1>,action<CRUISE_START>,cam_id<1>");
}

9. There is a certain number of cameras (num). It is necessary to check the operation of motion detection on all cameras (can be
used to check the performance of security sensors).
To solve the problem, you can use the emulation of a linear character array (string), it means, the array of characters is filled
in (in the example, it is the "N" character). Then, when the camera’s motion detection is triggered, the corresponding (to the
camera ID) element of the array is changed (changed to "Y"). Thus, the output is a character array of "N" (the camera didn’t
trigger) and "Y" (the camera triggered). The number of detections is counted and a message with the total number of cameras
and the number of cameras that triggered is displayed. Start the check on Macro 1. Stop on Macro 2.

43
OnInit()
{
run=0;
}

OnEvent("MACRO","1","RUN")
{
run=1; flag=""; num=8;
for(i=1;i<str(num+1);i=str(i+1))
{
DoReact("CAM",i,"DISARM");
DoReact("CAM",i,"REC_STOP");
DoReact("CAM",i,"ARM");
flag=flag+"N";
if(i<num) {flag=flag+"|";}
}
}

OnEvent("CAM",N,"MD_START")
{
if(run)
{
nn=str((N*2)-1);
flag=strleft(flag,str(nn-1))+"Y"+strright(flag,str(((num*2)-1)-nn));
}
}

OnEvent("MACRO","2","RUN")
{
run=0; fin=0;
for(i=1;i<str(num+1);i=str(i+1))
{
tmp=extract_substr(flag,"|",str(i-1));
if(strequal(tmp,"Y")) {fin=str(fin+1);}
DoReact("CAM",i,"DISARM");
}
tmp=":"+str(num)+" :"+str(fin);
rez=MessageBox("",tmp,0);
}

10. When an alarm occurs on camera 1, captions must be overlaid on the video image from this camera. When the alarm ends,
captions about the end of the alarm must be overlaid on the video image.

OnEvent("CAM","1","MD_START")
{
DoReact("CAM","1","CLEAR_SUBTITLES","title_id<1>"); //delete all captions from video image
DoReact("CAM","1","ADD_SUBTITLES","command<Camera 1 Alarm " + time + "\r>,page<BEGIN>,title_id<1>");
//the time parameter allows you to include the time of event registration in captions
}

OnEvent("CAM","1","MD_STOP")
{
DoReact("CAM","1","ADD_SUBTITLES","command<Camera 1 End of alarm " + time + "\r>,page<END>,
title_id<1>");
}

Note

When you use the page<BEGIN> and page<END> parameters, the corresponding fields in the captions database will
be filled in, which will make it possible to search for data using the Captions search interface object.

Examples of using events and reactions of the Monitor object:

1. Play record from camera 1 on the monitor 4 with the specified date and time when running the first macro.

44
1.

OnEvent("MACRO","1","RUN")
{
DoReact("MONITOR","4","ARCH_FRAME_TIME","cam<1>,date<"+date+">,time<11:00:00>");
DoReact("MONITOR","4","KEY_PRESSED","key<PLAY>");
}

2. Switch to the mode of video archive viewing on the first camera of monitor 4 when printing the frame from the first camera
and then go on 10 frames further starting from the specified date and time.

OnEvent("CAM", "1", "PRINT")


{
DoReact("MONITOR","4","ARCH_FRAME_TIME","cam<1>,date<"+date+">,time <11:00:00>");
for(i=0;i<10;i=i+1)
{
DoReact ("MONITOR","4","KEY_PRESSED","key<FF>");
}
}

3. Zoom in the video image on the monitor screen if camera is in the alarm state and reset it when alarm is finished.

OnEvent("CAM","1","MD_START")
{
DoReact("MONITOR","1","KEY_PRESSED","key<ZOOM_IN>");
}

OnEvent("CAM", "1", "MD_STOP");


{
DoReact("MONITOR","1","KEY_PRESSED","key<ZOOM_OUT>");
}

4. Display the layout number one on the monitor screen when running a macro.

OnEvent("MACRO","1","RUN")
{
DoReact("MONITOR","1","KEY_PRESSED","key<SELECT_LAYOUT>,number<1>");
}

5. Command of starting the video export from Camera 1 in the Monitor 1, starting from 24-10-14 17:10:38 and to 24-10-14 17:
10:80 to the c:\[Link] file.
Examples of export starting in three ways: using the IIDK (port 900 and 1030) and using script:
a. IIDK (port 900)
MONITOR|1|START_AVI_EXPORT|start<24-10-14 17:10:38>,finish<24-10-14 17:10:50>,avi_path<c:\[Link]>,
cam<1>
b. IIDK (port 1030)
CORE||DO_REACT|source_type<MONITOR>,source_id<1>,action<START_AVI_EXPORT>,params<4>,
param0_name<avi_path>,param0_val<c:\[Link]>,param1_name<cam>,param1_val<1>,param2_name<finish>,
param2_val<24-10-14 17:10:50>,param3_name<start>,param3_val<24-10-14 17:10:38>
c. Script (start on Macro 1)

OnEvent("MACRO","1","RUN")
{
DoReact("CORE","","DO_REACT","source_type<MONITOR>,source_id<1>,action<START_AVI_EXPORT>,
params<4>,param0_name<avi_path>,param0_val<c:\[Link]>,param1_name<cam>,param1_val<1>,
param2_name<finish>,param2_val<24-10-14
17:10:50>,param3_name<start>,param3_val<24-10-14 17:10:38");
}

6. When macro 1 is run, enable mouse PTZ control on Camera 4 at Monitor 10. Disable it on Macro 2.

45
6.

OnEvent("MACRO","1","RUN")
{
DoReact("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<1>");
}

OnEvent("MACRO","2","RUN")
{
DoReact("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<0>");
}

7. Display an active camera on an analog monitor.

OnEvent ("MONITOR","1","ACTIVATE_CAM")
{
DoReact ("CAM",cam,"MUX1");
}

8. Display an alarmed camera in the one-fold mode.

OnEvent ("CAM",N,"MD_START")
{
DoReact ("MONITOR","1","ACTIVATE_CAM","cam<"+N+">");
DoReact ("MONITOR","1","KEY_PRESSED","key<SCREEN.1>");
}

9. An alarm monitor that always displays a video from the last alarmed camera.

OnInit()
{
counter=0;
}

OnEvent("CAM",T,"MD_START")
{
if(strequal(counter,"0"))
{
DoReact("MONITOR","2","REMOVE_ALL");
DoReact("MONITOR","2","ADD_SHOW","cam<"+T+">");
}
counter=str(counter+1);
}

OnEvent("CAM",M,"MD_STOP")
{
counter=str(counter-1);
if(strequal(counter,"0"))
{
DoReact("MONITOR","2","ADD_SHOW","cam<"+M+">");
}
}

46
Examples with Computer and Display
SLAVE Computer

DISPLAY Display

Formats
Format of events procedure for the Computer object:

OnEvent("SLAVE","_id_","_event_")

Operator format to describe actions with the Computer object:

DoReact("SLAVE","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Display object:

OnEvent("DISPLAY","_id_","_event_")

Operator format to describe actions with the Display:

DoReact("DISPLAY","_id_","_command_" [,"_parameters_"]);

Examples
Examples of using events and reactions of the Computer object:

1. Stop recording from camera 2 if there is no disk for archive recording.

OnEvent("SLAVE","1"," NO_DISC")
{
DoReact("CAM","2"," REC_STOP");
}

2. Get the archive depth of Camera 1 on Macro 1.

OnEvent ("MACRO","1","RUN"){
DoReact ("SLAVE","WS3","GET_DEPTH","cam<1>");
}

As the result, the following string will be displayed in the debug window:

Event : SLAVE|WS3|ARCHIVE_DEPTH|cam<1>,core_global<1>,date<11-07-13>,depth<42>,destination_id<1>,
destination_source<PROGRAM>,fraction<970>,guid_pk<{003DFC83-0CEA-E211-A437-0017C401D5C2}>,owner<WS3>,
param0<01:18>,slave_id<WS3>,time<13:30:33>

Besides, the Archive depth event will be displayed in the Event Viewer and the archive depth in Days:Hours format will be
specified in the Additional information field. This information is also displayed in the debug window in the param0<> event
parameter.

Example of using events and reactions of the Display object:

1. Show first display on the CLIENT computer when activating the first time zone.

47
1.

OnEvent("TIME_ZONE","1","ACTIVATE")
{
DoReact("DISPLAY","1","ACTIVATE","macro_slave_id< CLIENT >");
}

2. There are two displays, the first one shows the virtual monitor with cameras, the second one shows the Map object with the FSA
sensors. When a camera alarm is triggered, Display 1 is shown, when a sensor alarm is triggered, Display 2 is shown, but only
on the CLIENT computer.

OnEvent("CAM",N,"MD_START")
{
DoReact("DISPLAY","2","DEACTIVATE","macro_slave_id<CLIENT>");
DoReact("DISPLAY","1","ACTIVATE","macro_slave_id<CLIENT>");
}

OnEvent("FSA_ZONE",M,"ALARM")
{
DoReact("DISPLAY","1","DEACTIVATE","macro_slave_id<CLIENT>");
DoReact("DISPLAY","2","ACTIVATE","macro_slave_id<CLIENT>");
}

48
Examples with Map
MAP Map

The format of the events procedure for the Map:

OnEvent("MAP", "_id_","_event_" [,"_parameters_"])

Operator format to describe actions with the Map:

DoReact("MAP","_id_","_command_" [,"_parameters_"]);

Example. Hide Camera 10 on Map 1 on Macro 10.

OnEvent("MACRO","10","RUN")
{
DoReact("MAP","1","HIDE_OBJECT","objtype<CAM>,objid<10>,hide<1>");
}

49
Examples with Archive and Edge storage
ARCH Backup archive

IPSTORAGE Edge storage

Formats
Format of events procedure for the Backup archive object:

OnEvent("ARCH","_id_","_event_")

The operator format for describing the actions with the Edge storage:

DoReact("IPSTORAGE","_id_","_command_" [,"_parameters_"]);

Examples
Example for the Backup archive object. Send corresponding message to all cores of the system if archiving via the Backup archive 1
isn't performed.

OnEvent("ARCH","1","INACTIVE")
{
NotifyEventGlobal ("ARCH","1","INACTIVE");
}

Example for the Edge storage object. Import archive from the edge storage of camera 45 Edge for the period from 11-01-19 16:00:
55 to 11-01-19 17:00:55 on Macro 10.

OnEvent("MACRO","10","RUN")
{
DoReact("IPSTORAGE", "1", "IMPORT", "cam<45>,datetime_from<11-01-19 16:00:55>,datetime_to<11-01-19 17:00:
55>");
}

50
Examples with Macros and Time zones
MACRO Macro

TIME_ZONE Time zone

Formats and functions


Format of events procedure for the Macro object:

OnEvent("MACRO","_id_","_event_")

Operator format to describe actions with the Macros:

DoReact("MACRO","_id_","_command_" [,"_parameters_"]);

Function to check the state of the Macro object:

CheckState ("MACRO","number","state")

Format of events procedure for the Time zone object:

OnEvent("TIME_ZONE","_id_","_event_")

Operator format to describe actions with the Time zone:

DoReact("MACRO","_id_","_command_" [,"_parameters_"]);

Function to check the state of the Time zone object:

CheckState ("TIME_ZONE","number","state")

Examples
Examples of using events and reaction of the Macro object:

1. Write the current position of camera to preset 1 when running macro 1.

OnEvent("MACRO","1","RUN")
{
DoReact("TELEMETRY","1","SET_PRESET","TEL_PRIOR<1>");
}

2. Run macro 2 if camera 1 is armed.

OnEvent("CAM","1","ARM")
{
DoReact("MACRO", "2", "RUN");
}

3. Start and stop patrolling of a PTZ device on macros.

51
OnEvent("MACRO","1","RUN")
{
DoReact("TELEMETRY","1.1","PATROL_PLAY","tel_prior<1>");
}

OnEvent("MACRO","2","RUN")
{
DoReact("TELEMETRY","1.1","STOP","tel_prior<1>");
}

4. Example of an infinite loop and how to stop it. Start the cycle on macro 1, stop the cycle on macro 2.

OnEvent("MACRO","1","RUN") //when running macro 1


{
//square brackets are needed to separate the wait statement into a separate thread
[
flag=1;
for(a=1;flag<2;a=1) //loop statement
{
Sleep(500); //wait statement creates a pause of 500 milliseconds
ff="!!!!!!!!!!!!!!!!!!";
}
]
}

OnEvent("MACRO","2","RUN") //when running macro 2


{
flag=2;
}

Examples of using events and reactions of the Time zone object:

1. Display video image from the camera 1 on the monitor when activating the first time zone.

OnEvent("TIME_ZONE","1","ACTIVATE")
{
DoReact ("CAM", "1", "ACTIVATE", "MONITOR<1>");
}

52
Examples with PTZ devices and Control devices
TELEMETRY PTZ device

TELEMETRY_EXT Keyboard

JOYSTICK Control device

Formats
Format of events procedure for the PTZ device object:

OnEvent("TELEMETRY","_id_","_event_")

Operator format to describe actions with the PTZ devices:

DoReact("TELEMETRY","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Keyboard object:

OnEvent("TELEMETRY_EXT","_id_","_event_")

Operator format to describe actions with the Keyboard:

DoReact("TELEMETRY_EXT","_id_","_command_" [,"_parameters_"]);

The format of events procedure for the Control device object:

OnEvent("JOYSTICK","_id_","_event_")

Examples
Examples of using reactions of the PTZ device object:

1. Set autofocus when camera 1 is armed.

OnEvent("CAM","1","ARM")
{
DoReact("TELEMETRY","1", "AUTOFOCUS_ON");
}

2. Rotate camera to the position specified in the first preset with the relay enabled.

OnEvent("GRELE","1","ON")
{
telemetry_id= GetObjectParam("CAM","1","parent_id");
DoReact("TELEMETRY","telemetry_id","SETUP","GO_preset<1>");
}

3. Record the patrol route for Camera 1 corresponding to the PTZ device 1.1. The route consists of two points, such that to go
from point 1 to point 2, you need to rotate the camera to the left at speed of 6 for two seconds. Patrolling must be performed
at speed of 10. The time at each point of the route is 25 seconds. It is supposed that when the program is started, the camera
is set to the position corresponding to the first point of the route.

53
OnEvent("MACRO","1","RUN")
{
DoReact("TELEMETRY","1.1","PATROL_LEARN","cam<1>,preset<1>,tel_prior<1>,dwell<25>,speed<10>,
flush_tour<0>");
Wait(2);
DoReact("TELEMETRY","1.1","LEFT","speed<6>,tel_prior<1>");
Wait(2);
DoReact("TELEMETRY","1.1","STOP","speed<6>,tel_prior<1>");
Wait(2);
DoReact("TELEMETRY","1.1","PATROL_LEARN","cam<1>,preset<2>,tel_prior<1>,dwell<25>,speed<10>,
flush_tour<1>");
}

4. There are two cameras with PTZ devices. Every 15 minutes you need to rotate cameras to preset 1 and take a screenshot. File
name is current time.

54
OnTime(W,D,X,Y,H,M, "01")
{
if(strequal(M,"0"))
{
name=H+"_"+M+"_"+S+".jpg";
//Camera 1 PTZ device 1.1
name1="Camera1 "+name;
DoReact("TELEMETRY","1.1","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<1>,file<d:\"+name1);
//Camera 2 PTZ device 1.2
name="Camera2 "+name;
DoReact("TELEMETRY","1.2","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<2>,file<d:\"+name);
}

if(strequal(M,"15"))
{
name=H+"_"+M+"_"+S+".jpg";
//Camera 1 PTZ device 1.1
name1="Camera1 "+name;
DoReact("TELEMETRY","1.1","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<1>,file<d:\"+name1);
//Camera 2 PTZ device 1.2
name="Camera2 "+name;
DoReact("TELEMETRY","1.2","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<2>,file<d:\"+name);
}

if(strequal(M,"30"))
{
name=H+"_"+M+"_"+S+".jpg";
//Camera 1 PTZ device 1.1
name1="Camera1 "+name;
DoReact("TELEMETRY","1.1","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<1>,file<d:\"+name1);
//Camera 2 PTZ device 1.2
name="Camera2 "+name;
DoReact("TELEMETRY","1.2","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<2>,file<d:\"+name);
}

if(strequal(M,"45"))
{
name=H+"_"+M+"_"+S+".jpg";
//Camera 1 PTZ device 1.1
name1="Camera1 "+name;
DoReact("TELEMETRY","1.1","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<1>,file<d:\"+name1);
//Camera 2 PTZ device 1.2
name="Camera2 "+name;
DoReact("TELEMETRY","1.2","GO_PRESET","preset<1>,tel_prior<1>");
DoReact("MONITOR","1","EXPORT_FRAME","cam<2>,file<d:\"+name);
}
}

5. Patrol multiple FOVs using the PTZ camera presets, with the possibility of activating the motion detection on certain areas.
Camera 1: five detection areas, five presets. These two parameters are set by the n variable. Macro 1 starts the algorithm.
Macro 2 stops the algorithm. Flag is an internal variable.
When the algorithm starts, the camera sets into preset 1 and arms detection area 1. There is a delay of 200 milliseconds
between these commands, so that the camera has time to set into the preset. Then after five seconds, area 1 is disarmed, and
the cycle starts again, but with area 2 and preset 2. And so on until all n areas and presets are run through. After that, the
algorithm starts again from 1. The algorithm stops if the flag variable is reset (using macro 2).

55
OnEvent("MACRO","1","RUN")
{
flag=1;
n=5;
[
for(i=1;flag;i=str(i+1))
{
DoReact("TELEMETRY","1.1","GO_PRESET","preset<"+i+">,tel_prior<3>");
Sleep(200);
DoReact("CAM_ZONE","1"+i,"ARM");
Wait(5);
DoReact("CAM_ZONE","1"+i,"DISARM");
if(strequal(i,n)) {i=0;}
}
]
}

OnEvent("MACRO","2","RUN")
{
flag=0;
}

Example of using events and reactions of the Keyboard object:

Turn on the light and arm camera 2 after pressing the key 15 on the AXIS T8312 keyboard.

OnEvent ("TELEMETRY_EXT","1","KEY_PRESSED")
{
if (strequal(param0, "15")){
DoReact("TELEMETRY_EXT","1","RELE_ON","rele<15>");
DoReact("CAM","2","ARM");
}
}

56
Example with Core
CORE

Procedure is started when the corresponding event occurs. Format of events procedure for the Core object:

OnEvent("CORE","_id_","_event_")

Example. When a face appears in the frame, display the video image from the corresponding camera on Monitor 2. When the face
disappears, remove the video image from the corresponding camera from Monitor 2.

OnEvent("CORE",N,"DO_REACT")
{
if (strequal(action,"SET_MARKRECT"))
{
DoReact("MONITOR","2","ADD_SHOW","cam<"+param5_val+">");
}
if (strequal(action,"DEL_MARKRECT"))
{
[
Wait(2);
DoReact("MONITOR","2","REMOVE","cam<"+param0_val+">");
]
}
}

57
Examples with Incident server and Incident
manager
INC_MANAGER Incident manager

INC_SERVER Incident server

Format of event procedure for the Incident manager object:

OnEvent("INC_MANAGER","_id_","_event_")

The format of event procedure for the Incident server object:

OnEvent("INC_SERVER","_id_","_event_")

The operator format for describing the actions with the Incident server object:

DoReact("INC_SERVER","_id_","_command_" [,"_parameters_"]);

58
Examples with Operator protocol and Event
Viewer
OPERATORPROTOCOL Operator protocol

EVENT_VIEWER Event Viewer

Formats
Format of events procedure for the Operator protocol object:

OnEvent("OPERATORPROTOCOL","_id_","_event_")

Operator format for describing the actions with the Operator protocol:

DoReact("OPERATORPROTOCOL","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Event Viewer object:

OnEvent("EVENT_VIEWER","_id_","_event_")

Operator format for describing the actions with the Event Viewer:

DoReact("EVENT_VIEWER","_id_","_command_" [,"_parameters_"]);

Examples
Examples of using events and reactions of the Operator protocol object:

1. Delete the first alarm on Camera 3 from the Operator protocol 1 window on Macro 2.

OnEvent ("MACRO","2","RUN")
{
DoReact("OPERATORPROTOCOL","1","DEL_ALARM","objtype<CAM>,objid<3>,options<first>");
}

2. Hide the Alarm situation, Suspicious situation and False alarm buttons for the Disarm event from Camera 12 in the Operator
protocol 1 window on Macro 2.

OnEvent ("MACRO","2","RUN")
{
DoReact("OPERATORPROTOCOL","1","HIDE_BUTTON","button<alarm,suspicious,false>,hide<1>,objtype<CAM>,
objaction<DISARM>,objid<12>");
}

Example of using events and reactions of the Event Viewer object:

Set general background color to black and general text color to white for Event Viewer 1 on Macro 1.

OnEvent ("MACRO","1","RUN")
{
DoReactStr("EVENT_VIEWER","1","UPDATE_VIEW","bk_color<#000000>, defclr<#FFFFFF>");
}

59
Examples with Operator query panel and SIP-
terminal
DIALOG Operator query panel

SIP_TERMINAL SIP-terminal

Formats
Operator format to describe actions with the Operator query panel:

DoReact("DIALOG","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the SIP-terminal object:

OnEvent("SIP_TERMINAL","_id_","_event_")

Operator format to describe actions with the SIP-terminal:

DoReact("SIP_TERMINAL","_id_","_command_" [,"_parameters_"]);

Examples
Examples of using reactions of the Operator query panel object:

1. Using macro 1, set coordinates of the left top corner of the operator query panel (PANASONIC-850 PTZ camera) in the center
of the screen, prohibit its moving and display it on the screen.

OnEvent("MACRO","1","RUN")
{
DoReact("DIALOG","PANASONIC-850","SETUP","x<50>,y<50>,allow_move<0>");
DoReact("DIALOG","PANASONIC-850","RUN");
}

2. Close the operator query panel on macro 2.

OnEvent("MACRO","2","RUN")
{
DoReact("DIALOG","PANASONIC-850","CLOSE");
}

60
Examples with Audio
PLAYER Audio player

OLXA_LINE Microphone

Formats
Operator format to describe actions with the Audio player:

DoReact("PLAYER","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Microphone:

OnEvent("OLXA_LINE ", "_id_","_event_")

Operator format to describe actions with the Microphone:

DoReact("OLXA_LINE ","_id_","_command_" [,"_parameters_"]);

Function to check the state of the Microphone object:

CheckState("OLXA_LINE","number","state")

Examples
Examples of using events and reactions of the Audio player object:

1. Playback the audio file when the camera stops recording:

OnEvent("CAM",N,"REC_STOP")
{
DoReact("PLAYER","1","PLAY_WAV","file<C:\Program Files (x86)\Axxon PSIM\Wav\cam_alarm_"+N+".wav>,
from_macro<1>");
}

2. Stop playing back the audio file when the camera starts recording:

OnEvent("CAM",N,"REC")
{
DoReact("PLAYER","1","STOP_WAV");
}

3. Playback the audio file from the occurrence of an event to the occurrence of another event (in this example, it is the start of
macros).
Audio file must last no longer than the number of seconds specified in the Wait statement.

61
OnEvent("MACRO","1","RUN")

{
flag=1;
[
for(i=1;flag;i=1)
{
DoReact("PLAYER","1","PLAY_WAV","file<C:\Program Files\Axxon PSIM\Wav\cam_alarm_1.wav>");
Wait(3);
}
]
}

OnEvent("MACRO","8","RUN")
{
flag=0;
}

Examples of using events and reactions of the Microphone object:

1. Turn on the first microphone when the sound activated recording is enabled.

OnEvent("OLXA_LINE","1","accu_start") //enable sound activated recording


{
DoReact("OLXA_LINE","1","ARM"); //enable record from microphone
}

2. Set minimum compression on microphone when disabling record of audio signal.

OnEvent("OLXA_LINE","1","DISARM") // disable record from microphone


{
DoReact("OLXA_LINE","1","SETUP","compression<5>"); //minimum compression is set up
}

3. The audio from the microphone (OLXA_LINE) isn’t recorded synchronously with the camera. By default, the microphone isn’t
armed. It is necessary to record audio both on sound activation and on camera detection. When sound activated recording
(ACCU_START) and motion detection start, forced audio recording is enabled, and the flag variable is incremented by one. At
the end of sound activated recording and motion detection, the flag variable is decremented by one, and audio recording stops
only if it is equal to zero, it means, there is neither sound activation nor motion.

62
OnInit()
{
flag=0;
}

OnEvent("CAM","3","MD_START")
{
flag=str(flag+1);
DoReact("OLXA_LINE","1","RECORD_START");
}

OnEvent("OLXA_LINE","1","ACCU_START")
{
flag=str(flag+1);
DoReact("OLXA_LINE","1","RECORD_START");
}

OnEvent("OLXA_LINE","1","ACCU_STOP")
{
flag=str(flag-1);
if (!(flag))
{
DoReact("OLXA_LINE","1","RECORD_STOP");
}
}

OnEvent("CAM","3","MD_STOP")
{
flag=str(flag-1);
if (!(flag))
{
DoReact("OLXA_LINE","1","RECORD_STOP");
}
}

63
Example with Videogate
GATE Videogate

Format of events procedure for the Videogate object:

OnEvent("GATE ","id","event")

Operator format for actions with the Videogate:

DoReact("GATE","id","command"[,"parameters"]);

Example. Send corresponding messages to all system cores when the input speed on the gate 1 is reduced.

OnEvent("GATE ","1"," GATE_LOW_FPS ")


{
NotifyEventGlobal ("GATE ","1"," GATE_LOW_FPS ");
}

64
Examples with Detection
CAM_VMDA_DETECTOR VMDA detection

CAM_FACECAPTURE Face Detection

CAM_IP_DETECTOR Embedded detection

Formats
Format of events procedure for the VMDA Detection:

OnEvent("CAM_VMDA_DETECTOR ","_id_","_event_")

Operator format to describe actions with the VMDA Detection:

DoReact("CAM_VMDA_DETECTOR","_id_","_command_");

Format of events procedure for the Face Detection object:

OnEvent("CAM_FACECAPTURE","_id_","_event_")

Operator format to describe actions with the Face Detection:

DoReact("CAM_FACECAPTURE","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Embedded detection object:

OnEvent("CAM_IP_DETECTOR","_id_","_event_")

Example
Example of using events and reactions of the VMDA Detection object:

Arm the VMDA Detection 2 on Macro 1:

OnEvent ("MACRO","1","RUN")
{
DoReact("CAM_VMDA_DETECTOR","2","ARM");
}

65
Example with User
PERSON User

Format of the events procedure for the User object:

OnEvent("PERSON","_id_","_event_")

66
Examples with Captions
TITLEVIEWER Captions search

CAM_TITLE Captioner

Formats
Format of events procedure for the Captions search object:

OnEvent("TITLEVIEWER","_id_","_event_")

Operator format to describe actions with the Captioner:

DoReact("CAM_TITLE","_id_","_command_");

Examples
Example for the Captions search object:

When double-clicking the search result line in the Captions search window, display the video archive corresponding to this result on the
monitor 4.

OnEvent("TITLEVIEWER","1","GO_VIDEO")
{
DoReact("MONITOR","4","ARCH_FRAME_TIME","cam<"+cam+">,date<"+date+">,time<"+time+">");
DoReact("MONITOR","4","KEY_PRESSED","key<PLAY>");
}

Example for the Captioner.

Start the update of the captions database on Macro 1.

OnEvent("MACRO","1","RUN")
{
DoReact("CAM_TITLE", "2", "REINDEX");
}

67
Examples with System restart service and
Failover service
SSS_WATCHDOG System restart service

FAILOVER Failover service

Formats
Format of events procedure for the System restart service object:

OnEvent("SSS_WATCHDOG","_id_","_event_")

Operator format to describe actions with the System restart service:

DoReact("SSS_WATCHDOG","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Failover service object:

OnEvent("FAILOVER","_id_","_event_")

Operator format to describe actions with the Failover service:

DoReact("FAILOVER","_id_","_command_" [,"_parameters_"]);

Example
Examples of using events and reactions of the System restart service object:

Activate the third camera on monitor 5 when restarting the module.

OnEvent("SSS_WATCHDOG","1"," RESTART_PROCESS")
{
DoReact("MONITOR", "5", " ACTIVATE_CAM", "CAM<3>")
}

68
Example with BacNet
BACNET BacNet

Format of events procedure for the BacNet object:

OnEvent("BACNET","_id_","_event_")

Operator format to describe actions with the BacNet object :

DoReact("BACNET","_id_","_command_" [,"_parameters_"]);

69
Examples with Relay and Sensors
GRELE Relay

GRAY Sensor

Formats and functions


Format of events procedure for the Relay:

OnEvent("GRELE", "_id_","_event_")

Operator format to describe actions with the Relay:

DoReact("GRELE","_id_","_command_");

Function to check the state of the Relay object:

CheckState("GRELE","number","state")

Format of events procedure for the Sensor:

OnEvent("GRAY","_id_","_event_")

Operator format to describe actions with the Sensor:

DoReact("GRAY","_id_","_command_");

Function to check the state of the Sensor object:

CheckState ("GRAY","number","state")

Examples
Example of using events and reactions of the Relay object:

Enable relay 2 when connection with relay 1 is lost.

OnEvent("GRELE","1","SIGNAL_LOST")
{
DoReact("GRELE", "2", "ON");
}

Examples of using events and reactions of the Sensor object:

1. It is required to switch the second sensor over to the second input if connection with the first sensor is lost.

OnEvent("GRAY","1"," SIGNAL_LOST") //connection with first sensor is lost


{
DoReact("GRAY","2","SETUP","chan<2>"); //sensor is on the second input
}

2. Open the second sensor and enable the rollback record of the first camera when the first sensor is closed.

70
2.

OnEvent("GRAY","1"," ON") //first sensor is closed


{
DoReact("GRAY","2","SETUP","type<1>"); //open the second sensor
DoReact("CAM","1","REC","rollback<1>");//perform rollback record from the first camera
}

71
Examples with Message services and notification
services
MMS Mail Message Service

MAIL_MESSAGE Mail message

VMS Voice Message Service

VNS Voice notification service

SMS Short Message Service

TELEGRAM Telegram bot

Formats
Format of events procedure for the Mail Message Service:

OnEvent("MMS","_id_","_event_")

Operator format to describe actions with the Mail Message Service:

DoReact("MMS","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Mail message:

OnEvent("MAIL_MESSAGE","_id_","_event_")

Operator format to describe actions with the Mail message:

DoReact("MAIL_MESSAGE","_id_","_command_" [,"_parameters_"]);

Operator format to describe actions with the Voice Message Service:

DoReact("VMS","_id_","_command_" [,"_parameters_"]);

Operator format to describe actions with the Voice Notification Service:

DoReact("VNS","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Short Message Service object:

OnEvent("SMS","_id_","_event_")

Operator format to describe actions with the Short Message Service:

DoReact("SMS","_id_","_command_" [,"_parameters_"]);

Format of events procedure for the Telegram bot:

OnEvent("TELEGRAM","_id_","_event_")

Operator format to describe actions with the Telegram bot:

72
DoReact("TELEGRAM","_id_","_command_" [,"_parameters_"]);

Examples
Example of using reactions of the Mail Message Service object.

Set port number of the mail message service to 25 on Macro 1.

OnEvent("MACRO","1","RUN")
{
DoReact("MMS", "1", "SETUP", "port<25>");
}

Example of using reactions of the Mail message object.

Send message with image from camera when it switches to an alarm state when motion detection triggers.

OnInit(){
i=0; //counter is used to avoid overwriting of images from one camera
}

OnEvent("CAM",N,"REC") //camera is in alarm state

{
filename = "c:\" + N + "_msg_"+str(i)+".jpg";
i=i+1;
DoReact("MONITOR","1","EXPORT_FRAME","cam<"+ N + ">,file<" + filename+ ">");
DoReact("MAIL_MESSAGE", "1", "SETUP", "body<camera is triggered"+ N + ">, subject<alarm on camera>,
from<[Link]@[Link]>, to<[Link]@[Link]>,attachments<" + filename + ">");
DoReact("MAIL_MESSAGE","1","SEND");
}

Example of using reactions of the Voice Message Service object:

It is required to send message on macro 1 if modem is connected to COM2 port, type of dialing is pulse, don't wait for tonal signal.

OnEvent("MACRO","1","RUN")
{
DoReact("VMS","1","SEND","modem<2>,pulse<1>,waitfordialtone<0>");
}

Examples of using events and reactions of the Voice Notification Service object:

1. Play the audio file when camera stops recording:

OnEvent("CAM",N,"REC_STOP")
{
DoReact("VNS","1","PLAY","file<C:\Program Files (x86)\Axxon PSIM\Wav\cam_alarm_"+N+".wav>");
}

2. Stop playing the audio file when camera starts recording:

OnEvent("CAM",N,"REC")
{
DoReact("VNS","1","STOP");
}

3. When a predetermined time zone starts, change the volume control value to a lower one, and then after the time zone ends,
set the average volume control value:

73
3.

OnEvent("TIME_ZONE","1","ACTIVATE")
{
DoReact("VNS","1","SETUP","level<2>");
}
OnEvent("TIME_ZONE","1","DEACTIVATE")
{
DoReact("VNS","1","SETUP","level<8>");
}

Examples of using events and reactions of the Short Message service object:

1. It is required to send a short message to the “89179190909” number when the first camera is alarmed.

OnEvent("CAM","1","MD_START")
{
DoReact("SMS","1","SETUP","phone<+79179190909>,message<camera 1, alarm>");
}

2. Install a short message device and send a message to the “89179190909” number when the first sensor is alarmed.

OnEvent("GRAY","1","CONFIRM") //confirm alarm from sensor 1


{
DoReact("SMS","1","SETUP","device<>",); //install a device for short message delivery
DoReact("SMS","1","SETUP","phone<+79179190909>,message<sensor 1, alarm>"); //send message about an
alarm on sensor 1 to telephone number
}

3. Play the c:\Windows\Media\[Link] audio file when receiving an sms using the Mail Message Service 2.

OnEvent("SMS","2","RECEIVE")
{
DoReact("PLAYER","3","PLAY_WAV","file<c:\Windows\Media\[Link]>");
}

Examples of calling the command for sending a message to Telegram using a macro:

OnEvent("MACRO","3","RUN") //run macro 3


{
//Sending using chat_id & bot_id from object settings:
DoReact("TELEGRAM",1,"SEND","text<Hello world>");

//Explicit specifying of chat_id & bot_id in the command:


DoReact("TELEGRAM",1,"SEND","text<Hello world>,chat_id<828752651>,bot_id<809045046:
AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>");

//Sending a file with a chat ID and bot ID:


DoReact("TELEGRAM",1,"SENDPHOTO","caption<Hello world>,chat_id<828752651>,bot_id<809045046:
AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>,photo<G:\\[Link]>");

//Sending geolocation with a chat ID and bot ID:


DoReact("TELEGRAM",1,"SEND","text<Hello world>,chat_id<828752651>,bot_id<809045046:
AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>",longtitude<37.3428359>,latitude<55.6841654>,address<Office>);
}

74
Appendix 1. Priorities of the start and stop
recording commands
Start and stop recording commands can have different priorities in Axxon PSIM. The priority of start/stop recording commands is set
by the priority<> parameter of the REC and REC_STOP reactions, respectively. If you try to stop recording using the command with
the priority that is lower than one of the command that initiated recording, then this command will be ignored.

When recording is started/stopped manually or by macro or by the detection tool triggering, the priority is not set. The table shows the
behavior of Axxon PSIM when various ways to start/stop recording are in use.

Start/stop recording 1 Start/stop recording 2 Behavior

Start/stop recording is initiated Start recording at The start/stop recording commands 1 and 2 are equal*
by the operator using the CAM|1|REC| reaction, stop
camera context menu (start recording at
/stop recording) or by macro CAM|1|REC_STOP| reaction

Start/stop recording is initiated Start recording at The stop recording command 1 stops recording started using
by the operator using the CAM|1|REC|priority<0> command 2
camera context menu (start reaction, stop recording at
/stop recording) or by macro CAM|1|REC_STOP|priority<0
> reaction

Start/stop recording is initiated Start recording at The stop recording command 1 stops recording started using
by the operator using the CAM|1|REC|priority<1> command 2
camera context menu (start reaction, stop recording at
/stop recording) or by macro CAM|1|REC_STOP|priority<1
> reaction

Start/stop recording is initiated Start recording at The start/stop recording commands 1 and 2 are equal*
by the operator using the CAM|1|REC|priority<2>
camera context menu (start reaction, stop recording at
/stop recording) or by macro CAM|1|REC_STOP|priority<2
> reaction

Start/stop recording is initiated Start/stop recording is The stop recording command 1 stops recording started using
by the operator using the initiated by the detection tool command 2
camera context menu (start (for example, the main
/stop recording) or by macro motion detection tool)

Start recording at Start/stop recording is The stop recording command 2 stops recording started using
CAM|1|REC|priority<0> initiated by the detection tool command 1
reaction, stop recording at (for example, the main
CAM|1|REC_STOP|priority<0> motion detection tool)
reaction

Start recording at Start/stop recording is The following variants are possible:


CAM|1|REC|priority<1> initiated by the detection tool
reaction, stop recording at (for example, the main 1. If a camera is armed, the CAM|1|REC|priority<1> command
CAM|1|REC_STOP|priority<1> motion detection tool) starts recording and the alarm on the camera begins, then
reaction recording continues after the alarm has ended. The
CAM|1|REC_STOP|priority<1> command stops recording.
2. If a camera is armed, an alarm is initiated on the camera and
the CAM|1|REC|priority<1> command is sent, then recording
continues after the alarm has ended.
The CAM|1|REC_STOP|priority<1> command stops recording.
3. If a camera is armed, an alarm is initiated on the camera and
the CAM|1|REC_STOP|priority<1> command is sent, then
recording continues and it stops when the alarm has ended
4. If a camera is armed and the CAM|1|REC|priority<1>
command is sent, the recording is started. If an alarm is
initiated and the CAM|1|REC_STOP|priority<1> command is
sent, then recording continues

75
Start recording at Start/stop recording is The stop recording command 1 stops recording started using
CAM|1|REC|priority<2> initiated by the detection tool command 2
reaction, stop recording at (for example, the main
CAM|1|REC_STOP|priority<2> motion detection tool)
reaction

* Equivalence of ways means that recording can be stopped using way 1 if it was started using way 2 and vice versa if the
recording is started using way 1, then it is possible to stop recording using way 2.

76
Appendix 2. Defining the param_id and
param_value values for the SET_IPINT_PARAM
reaction
The values of the param_id and param_value parameters, required for the SET_IPINT_PARAM reaction, can be individual both for
each of integrated IP cameras and for their firmwares.

The values of the param_id and param_value are defined as follows:

1. Open the directory with installed DriverPack, by default, C:\Program Files\Common Files\AxxonSoft\Ipint.
DriverPack\3.0.0\.
2. Using any word processor, open a file in this directory with the Ipint.<Name of camera driver>.rep name, for example,
[Link].

Note

In most cases, the name of the driver is the same as the name of the manufacturer of the IP device. Contact
AxxonSoft support to check the name of the driver for the required manufacturer.

3. In the file, find the name of the required model, for example, SNC-DH120T.

77
4. There is the <videoSourceRef> tag within the <device> tag that contains the description of the required model like in the
<model> tag. You must find one more occurrence of the id value of this parameter in the file (in this example this is
video_source_dh160 value) in the videoSource tag.

5. The parameters of IP device and their possible values are described in the <property> tags. The description of possible values
depends on their type.

In this example the param_id="daynight" parameter can be used to switch the Day/Night mode on the camera. In this case the
possible values of the param_value parameter are: auto, on, off, timer or sensor.

Example

Example of using the SET_IPINT_PARAM reaction:

1. For the Camera object:


DoReact("CAM", "1","SET_IPINT_PARAM","param_id<daynight>,param_value<on>");
2. For the Video capture device object:
DoReact("GRABBER", "1","SET_IPINT_PARAM","param_id<daynight>,param_value<on>,cam_id<1>");

As a result of reactions execution the value of the “daynight” parameter is “on” for Camera 1.

To enable the SET_IPINT_PARAM reaction, the multistream mode must be enabled in Axxon PSIM (see Configuration of multistream
video). Keep in mind that if only one stream is integrated for the camera, then there will be no video in the multistream mode.

You can find out the number of integrated streams in the list of IP devices integrated with Axxon PSIM (see Documentation Drivers
Pack).

If this way can’t be used for any reason, then find out the number of integrated streams as follows:

1.
78
1. Repeat steps 1–3 of the previous algorithm.

2. The required model is described within the <device> tag, integrated video streams are described in the <videoStreamingRef
> tags. There must be more than one stream.

79
The Script object. Programming using the JScript
language
Purpose and features of the JScript language
Programming in JScript
The Script system object
The Editor-Debugger utility
The Debug window
Enabling the Debug window
Working with Debug window
Copying information on event or reaction to the clipboard
Highlighting messages
Events and reactions filter
Searching for events and reactions
Clearing the Debug window
Getting the list of system names of objects, reactions and events in Axxon PSIM

Creating your first script


Working with script
Creating a script
Saving a script
Deleting a script
Searching text in script
Replacing text in script

Script debugging
Script debugging features
Creating and using test events
Working with the debugging windows of the Editor-Debugger utility
Viewing the script messages
Displaying messages about starting, verifying, changing and executing scripts in the debugging windows
Using third-party debugger programs

Examples of scripts in the JScript language


Examples of scripts with Video surveillance monitor and Cameras
Examples of scripts with Map
Examples of scripts with detection tools
Examples of scripts with Macros
Example of script with Users
Examples of scripts with Incident server and Incident manager
Example of script with Failover service
Examples of scripts with BacNet
Example with Telegram bot
Examples of scripts with Event Viewer

Appendix 1. Description of the Editor-Debugger utility


The purpose of the Editor-Debugger utility
The interface of the Editor-Debugger utility
The Editor-Debugger interface
The Debug-edit script tab
The Script messages tab
Main menu
Description of the main menu interface
Description of the File item of the main menu
Description of the View item of the main menu
Description of the Debug and edit item of the main menu
Description of the List of events item of the main menu
Description of the Filter dialog window
Description of the Highlight dialog window

80
Description of the toolbar of the Editor-Debugger utility

Appendix 2. Creating custom objects with ability to set events, reactions and states
Purpose of custom objects and their implementation in Axxon PSIM
How to create a custom object
DBI file preparation
DDI file preparation
XML file preparation
Creating and using a custom object in Axxon PSIM

Export to PDF

81
Purpose and features of the JScript language
The JScript programming language is used in Axxon PSIM to implement additional user functions not included in the basic Axxon PSIM f
unctionality.

The JScript programming language is a standard feature for developing user scripts. Axxon PSIM supports the version of the JScript
language implemented in the ActiveX technology by Microsoft. The general description of the JScript object model, used in Axxon PSIM,
is given in the Microsoft documentation (for example, MSDN).

The JScript scripts in Axxon PSIM are executed using the standard ActiveX software components included in the Windows OS. So,
when you develop scripts, you can use any components of the JScript object model implemented in the ActiveX technology.

Axxon PSIM additionally provides a specialized object model for script development in the JScript language that allows you to work
with system objects of Axxon PSIM, receive and send system events and reactions.

82
Programming in JScript

83
The Script system object
The Script system object is used to initialize a script developed in the JScript language in Axxon PSIM and to set the parameters for its
execution..

The settings panel of the Script system object is shown in the figure below:

Attention!

Creating of large number of the Script objects (more than 100) can cause system instability.

The settings panel of the Script system object allows choosing the time schedules and the computers (kernels) for executing the script.

Note

To set all checkboxes next to all computers, select a cell in the column with checkboxes and press Ctrl+A. To clear all
checkboxes, select a cell and press Shift+A.

The settings panel of the Script system object has the button for starting the Editor-Debugger utility and the text window for viewing
the script text created using this utility. You can edit the script in the Editor-Debugger utility or directly on the settings panel for the Sc
ript object.

Moreover, you can configure the events filter—the list of events that the Script system object will process. Including the event to the
filter equals to the if operator in the text of script, it means, when the event is in the table, the operator can be omitted.

Attention!

You must configure the events filter when you create a script in large distributed configurations. Otherwise, the module will
process all incoming events and it will lead to module malfunctioning.

84
Example.

If the Object’s type column has the Macro value, the Identifier column has the 1 value and the Event column has the Exe
cuted value, then instead of the script below

if ([Link] == "MACRO" && [Link]==1 && [Link] == "RUN")


{
DoReactStr("CAM", "2", "REC", "");
}

you can use the following script:

DoReactStr("CAM", "2", "REC", "");

The detailed information on the elements of the settings panel for the Script object is given in Administrator's guide.

85
Example.

Recording on Camera 1 must be started when controlling the PTZ camera in the Video surveillance monitor.

For this, configure the Script object as follows:

1. Select the required time schedule when the script must be executed.
2. Enter the script text:

if ([Link]("source_type") == "TELEMETRY") {
DoReactStr ("CAM","1","REC","");
}

3. Configure the filter as follows:


a. From the Object’s type drop-down list, select CORE.
b. In the Event field, enter DO_REACT.

The filter can be set by the UPDATE_OBJECT event of the CORE object. Example of the command to add the Camera object with
identifier 1 to the filter of the Script object with identifier 2:

NotifyEventStr("CORE","","UPDATE_OBJECT","objtype<SCRIPT>,objid<2>,[Link].0<1>,[Link].1<10>,EVENT.
[Link]<2>,flags<>,[Link].0<>,[Link].1<>,[Link].0<CAM>,[Link]<2>,EVENT.
objtype.1<CAM>,[Link]<2>");

86
The Editor-Debugger utility
The Editor-Debugger utility is used to create, debug and edit scripts in Axxon PSIM.

The Editor-Debugger dialog window is shown in the figure below.

The Editor-Debugger utility contains the embedded text editor and the debugging window.

To help with writing correct scripts, the text editor automatically highlights objects, methods and properties that are a part of the
object model of the JScript language. In addition, the code blocks can be collapsed or expanded with - or + buttons to the left of the Sc
ript text field.

Note

When switching between scripts, script messages or other objects in the Editor-Debugger utility tree, the collapsing settings
are reset, it means, all blocks in the script become expanded.

The position of the cursor in each script is stored within one Axxon PSIM session (the cursor position is reset at restart). For example,
if you place the cursor at the end of //Line 2 in Script 1, then switch to Script 2 and perform any action in it, the cursor will be still
at the end of //Line 2 when you return to Script 1.

87
The debugging window of the Editor-Debugger utility allows viewing the information about all events registered by the system. You can
filter the events that are displayed in the debugging window. A separate debugging window is created for each Script system object,
which allows you to debug each script individually using the filters.

To debug the script, it is possible to test run using a user-defined test event generated by the utility and not registered in the system.
To display or edit this event, select Debug and edit Summary Information, and then go to the Trial event tab on the panel that
opens at the bottom of the window. For details, see Creating and using test events.

You can save the created script in the Script system object or in a text file on the hard drive.

88
The Debug window
Axxon PSIM allows viewing all events and reactions happening in the system in real time. Events and reactions with object properties
are displayed in the Debug window. You can copy them to the Windows clipboard and then use in programs.

89
Enabling the Debug window
Starting with weekly build [Link], the Debug 4 mode is enabled by default. In previous versions, the Debug window is disabled
by default. To enable the Debug window, do the following:

1. Shut down Axxon PSIM.


2. Run the Advanced [Link] utility.

Note

You can enable the Debug window without using the [Link] utility. For this, set values 1, 2, 3, or 4 for the Debug
string parameter in the HKEY_LOCAL_MACHINE\SOFTWARE\AxxonSoft\PSIM section of the Windows registry
(HKEY_LOCAL_MACHINE \Software\Wow6432Node\AxxonSoft\PSIM for 64-bit system).

3. Select Axxon PSIM section in the tree on the left side of the utility dialog box.
4. Change the value of the Debug mode parameter from Disabled to Debug 1, Debug 2, Debug 3, or Debug 4. Any of these
modes will enable the Debug window, the difference between them is in the amount of information written to the log files
(see The Settings panel of the Axxon PSIM section).
5. Click the OK button.
6. Start Axxon PSIM.
7. A new Debug window item will appear on the Main control panel of Axxon PSIM.

Note

This menu is also available in the Windows notification area (system tray)—left click the button or short click the
F8 hot key.

8. Select the Debug window item on the Main control panel in order to display the Debug window on the screen. The selected De
bug window item is marked with a flag.

90
To hide the Debug window, re-select the Debug window item on the Main control panel.

Note

To disable the Debug window, select the Disable value for the Debug mode in the [Link] utility or set value 0 for the
Debug string parameter in the HKEY_LOCAL_MACHINE\SOFTWARE\AxxonSoft\PSIM section of the Windows registry
(HKEY_LOCAL_MACHINE \Software\Wow6432Node\AxxonSoft\PSIM for 64-bit system). These actions are performed when
you exited Axxon PSIM.

91
Working with Debug window
The appearance of the Debug window is shown in the figure. The Debug window displays the sequence of events and reactions in the
system.

The Debug window has the following features:

1. always on top of other windows;


2. you can change the size of the Debug window using the mouse;
3. you can copy information on event or reaction to the Windows clipboard and then use it in programs;
4. you can filter events and reactions in the Debug window;
5. you can highlight events and reactions in the Debug window;
6. you can search for events or reactions in the Debug window.

You can use regular expressions to highlight and filter messages in the Debug window.

92
Copying information on event or reaction to the
clipboard
To read and/or copy information on an event or a reaction to the Windows clipboard, do the following:

1. Select the required line in the Debug window.


2. Right-click the selected line. The Information window with the information on the required event or reaction will open.
3. Select the information that you want to copy to the Windows clipboard and press Ctrl+C.

Note

Use the context menu for operations with text in the Information window (right-click the selected text).

4. To close the Information window, click the button.

Information on event or reaction is now copied to the Windows clipboard.

93
Highlighting messages
To configure message highlighting in the Debug window, do the following:

1. Click the Colors button.

2. In the Highlight window, specify the line that must be highlighted every time it appears in the message (1).

3. Click the Color button (2).


4. Select the color in the Color dialog window (3).
5. Click the OK button (4).
6. Repeat steps 2-5 for all required lines.

Note

To add a line to the table, press the key on the keyboard.

7. Click the OK button (5).

As a result, messages with the enterd line will be highlighted in the specified color in the Debug window.

94
The messages are now highlighted.

95
Events and reactions filter
Events and reactions filter allows displaying only required messages in the Debug window.

To configure the events and reactions filter, do the following:

1. Click the Filter button.

2. In the Filter window, specify the lines that must be in the message for it to be displayed in the Debug window (1). You can
use regular expressions. In this case, set the Use regex checkbox at step 5.

3. Specify the lines that must be in the message for it not to be displayed in the Debug window (2). You can use regular
expressions. In this case, set the Use regex checkbox at step 5.

Note

To add a line to the table, press the key on the keyboard.

4. Click the OK button (3).


5. If you used regular expressions in filter lines, set the Use regex checkbox (1).

6. To apply the filter, set the Apply filter checkbox (2).

96
As a result, only messages that meet the filter conditions will be displayed in the Debug window.

97
Searching for events and reactions
To search for events and reactions, do the following:

1. Click the Search button (1). The Find window will open.

2. Specify the search criteria in the Find what field (2).


3. If you want to search for the entered string as an independent word, not present in other words as a part, but separated from
them by at least one space, then set the Match whole word only checkbox (3).
4. If you want the search to be case sensitive, then set the Match case checkbox (4).
5. Set the Direction switch into the position corresponding to the search direction (5).
6. To view the next search result, click the Find Next button (6).

Note

To close the Find what window, click the Cancel button.

The search for events and reactions is now complete.

98
Clearing the Debug window
To delete all messages from the Debug window, click the Clear button.

99
Getting the list of system names of objects,
reactions and events in Axxon PSIM
You can get the list of system names of objects, reactions and events used when programming with the help of the [Link]
configuration setting utility. See the description of the main system objects reactions in Description of events and reactions of system
objects.

The [Link] utility is started in one of the following ways:

1. From the Start menu Axxon PSIM System configuration.

Note

The [Link] utility is available in the Start menu with the following types of Axxon PSIM installation: Server,
Administrator’s workstation and Workstation for monitoring.

2. In the Tools folder of Axxon PSIM installation folder.

To view the list of system names of objects, events and reactions, do the following:

1. In the utility, open the [Link] file.


2. Select the DDI tab on the left (1). The list of system objects is displayed here.

3. In the DDI tab, select the object which events and reactions you want to view (2).
4. To view the name of the selected object, go to the Names tab (3).
5. To view the list of events for the selected object, go to the Events tab.

100
6.
7. To view the list of reactions for the selected object, go to the Reactions tab.

101
See the detailed information on working with the [Link] utility in Editing [Link] and [Link] database templates using the ddi.
exe utility.

Note

If the Sensor is armed, then when the Sensor is closed/opened, the Alarm event occurs depending on the alarm mode
setting (see the Creating and configuring the Sensor system object section of the Installing and configuring security system
components guide). If the Sensor is disarmed, the Closed/Opened events occur correspondingly.

102
Creating your first script
As an example of using JScript in Axxon PSIM, try to create a script containing an error and then correct it. The script performs the
following actions: when Macro 1 starts, set the value 10 to the "Hot record" time parameter for cameras 1–4 and output the "Hello
world" message to the debugging window of the Editor-Debugger utility.

To create and run this script, do the following:

1. In the Hardware tab of the System Settings dialog window, create four Camera objects with identification numbers 1, 2, 3
and 4, if they have not been created before.
2. In the Programming tab, create a Macro object with identification number 1. Don't fill in the Events table for the correct
execution of the following actions and successful run of the script.
3. In the Programming tab, create a Script system object. Give the object the identification number 1 and the name "Script 1".
4. On the settings panel of the Script 1 object, select Always from the Time schedule drop-down list.
5. Click the Editor-Debugger button at the bottom of the settings panel of the Script 1 system object. The Editor-Debugger
utility window will open.
6. In the Editor-Debugger utility window, open the Debug-edit script list and select the Script 2 object.

7. In the Script field, enter the following:

if ([Link] == "MACRO" && [Link] == "1" &&


[Link] == "RUN")
{
var ;
for(i=1; i<=4; i=i+1)
{
SetObjectParam("CAM",i,"hot_rec_time","10");
}
DebugLogString ("Hello world");
}

Attention!

The script contains an error. See below the recommendations on how to fix it.

8. In the File menu, select Save to database to save the script.

103
9. Create a test event to run the script in debug mode—MACRO|1|RUN|. To achieve this, in the Debug and edit menu, select Edi
t test event. The Test message window will open. Fill in the fields in the Test message window as shown in figure.

10. To run the script with the test event, select Test run in the Debug and edit menu.
11. Open the Script Messages list and select Script 1. The debugging window will open on the right side.
12. In the debugging window, find the “Process Event:MACRO|1|RUN|” line and the following error message: “Src identifier
missing: Microsoft JScript compilation error Line:2 Char:6 Error:0 Scode:800a03f2”.

The error message says that there is no identifier in the second line of variable declaration operator (var). This means that no
variable has been declared. This is a critical error in JScript, thus the script has not been executed.
13. Correct the text of the script (see the “var i;” line).

if ([Link] == "MACRO" && [Link] &&


[Link] == "RUN")
{
var i;
for(i=1; i<=4; i=i+1)
{
SetObjectParam("CAM",i,"hot_rec_time","10");

104
}
DebugLogString ("Hello world");
}

14. In the File menu, select Save to database to save the script.
15. Repeat steps 10 and 11.
16. In the debugging window, find the “Process Event:MACRO|1|RUN|” line and the “DebugLogString:Hello world” and “Script first
run OK” messages. The “Script first run OK” means that the script runs correctly in the debug mode.

17. Close the Editor-Debugger utility.


18. The text of the created script will be displayed in the field of the Script 1 system object. Click the Apply button on the settings
panel of the Script 1 system object to activate the script.
19. Select Macro 1 in the Run menu of the main control panel.
20. In the debugging window of Axxon PSIM, check that the macro and the script have run successfully.

21.
105
21. Check the accuracy of the script result. The "Hot record" time field in the Camera 1 to Camera 4 objects settings panels
must have the 10 value.

Note

The "Hot record" time field in the Camera settings panel is blank by default.

Script creation and debugging is now complete.

106
Working with script

107
Creating a script
On the page:

Creating the Script object


Creating and editing a script
Features when working with a script
Debugging a script

To create and run scripts in JScript, create the Script system object. Then, in the Editor-Debugger utility, enter the script, check it and
debug it.

You can create JScript scripts in Axxon PSIM using the built-in Editor-Debugger utility.

To start the Editor-Debugger utility, click the Editor-Debugger button on the settings panel of the Script system object.

Creating the Script object


To create the Script object in Axxon PSIM, do the following:

1. In the Programming tab (1) of the System settings dialog window, create the Script object (2).
2. Enter the identification number and the name for the Script object (3).
3. Click the Apply button (4).

The settings panel of the Script object will open.

To configure the Script object, set the values of the following parameters:

1. In the Time schedule field (1), specify the time schedule of the script execution: Always, Never or one of the schedules
created earlier (1, see Creating and configuring Time schedules). The default value is Never.
2. In the Computers field (2), select the computers (kernels) on which the script must run.

108
2.

Note

By default, the script will run on all computers (kernels). The list displays only the computers registered in the Hardw
are tab of the System settings dialog window.

3. Click the Apply button.

Creating and editing a script


To create a script in JScript in Axxon PSIM, do the following:

1. Click the Editor-Debugger button (3) at the bottom of the Script system object panel to open the Editor-Debugger utility.

Note

Use the Editor-Debugger utility to create, edit and save scripts in JScript. The settings panel of the Script system
object displays the text of the saved script that can also be edited.

2. In the Editor-Debugger utility window, open the Debug-edit script list and select the Script object you want to edit (for
example, the Script 1 object, as in the figure below).

3. In the Script field, enter the text of the script in JScript programming language (see Examples of scripts in the JScript language)
.

109
4. Run the script using a test event. To create a test event, select Debug and edit Edit test event.
The Test message window will open containing the fields for setting the event parameters.

To run the script using the test event, select Debug and Edit Test run.

Note

You can also run the script using the test event using the Ctrl+T key combination.

Features when working with a script


When working with a script in the Editor-Debugger utility, you can undo the last action or return the last action. To undo the last
action, press the Ctrl+Z key combination. To return the last action, press the Ctrl+Y key combination.

Note

For your convenience, when editing the script, the cursor position is saved when saving the script or when switching between
the scripts in the Editor-Debugger utility window during a session, it means, until Axxon PSIM is restarted.

Note

When you go to the Script messages list when editing a script, and then go back to the corresponding script in the Debug-
edit script list, you cannot undo or return the last action.

Debugging a script
You can check if the script syntax is correct using the interpreter which is built-in into the Editor-Debugger utility. The result of the
check with the information about the content and location of the error is displayed in the Debugger window corresponding to the
script in the Script messages list. If there are errors, you need to edit the script syntax and check it again.

Note

See the detailed information about using test events for script debugging in Script debugging.

After debugging the script using the Editor-Debugger utility, run it with a real system event. Check the result of the script execution. If
the result is incorrect, make the necessary changes and run the script again.

Script creation is considered complete if it runs correctly.

110
Saving a script
The Editor-Debugger utility provides two options for saving scripts: in the Script system object, or in a text file on the hard drive.

To save the script in the Script system object, in the File menu, select Save in the database. When you select this menu item, the
script will be updated on every Server that you selected on settings panel of the Script object (see The Script system object).

Note

You can also save the script in the database using the Ctrl+S key combination.

Note

The script is automatically saved in the corresponding Script system object upon closing the Editor-Debugger utility.

To save the script in the file, in the File menu, select Save on disk. To open a script saved in a file in the Editor-Debugger utility, in
the File menu, select Open from disk.

111
Deleting a script
To delete a script created in Axxon PSIM, delete the corresponding Script system object in the Programming tab.

112
Searching text in script
The Editor-Debugger utility allows searching text in script using a dialog box.

Press Ctrl+F to open the search dialog box. The Find dialog box will open.

1. In the Find what field (1), enter the text that you want to find.
2. Set the Match whole word only checkbox (2) if you want to search for the whole entered text.
3. Set the Match case checkbox (3) if you want the search to be case-sensitive.
4. Select the direction of the search through the script relative to the current cursor position: Up (4) or Down (5).
5. Click the Find Next button (6) to start the search and go to the next match.
6. Click the Cancel button (7) to cancel the search.

The found match is highlighted in the Editor-Debugger utility window.

113
Replacing text in script
The Editor-Debugger utility allows replacing text in script using a dialog box.

Press Ctrl+H to open the Replace dialog box.

1. In the Find what field (1), enter the text that you want to find in the script.
2. In the Replace with field (2), enter the text with which you want to replace the found text in the script.
3. Set the Match whole word only checkbox (3) if you want to search for the whole entered text.
4. Set the Match case checkbox (4) if you want the search to be case-sensitive.
5. Click the Find Next button (5) to start the search and go to the next match.

Note

The search runs down from the current cursor position.

6. Click the Replace button (6) to replace the current found match.
7. Click the Replace All button (7) to replace all matches automatically.
8. Click the Cancel button (8) to close the replace dialog box.

Example of replacing the i variable with s:

1. Before replacement:

114
2. After replacement:

115
Script debugging

116
Script debugging features
The Editor-Debugger utility allows debugging scripts using the built-in tools for checking script syntax, script interpreting and script
execution with test events generated by the utility. The messages about the debugging results are displayed in the corresponding
debugging windows.

The Editor-Debugger utility provides the following debugging functionality:

1. A separate debugging window is assigned to each Script object, in which the test and system events, error messages, success
messages and user information messages are displayed. The messages in the debugging windows can be filtered.
2. Special Information window debugging windows are available that display the messages related to the script being
debugged.
3. Test events generated by the Editor-Debugger utility, which are not registered in the system, are used to check script accuracy.
4. Third-party debugging programs can be used for step-by-step script execution, viewing script variables during execution, and
so on.

117
Creating and using test events
On the page:

Creating test events


Running a script with a test event

Creating test events


The Editor-Debugger utility can use test events specified by the user and generated by the utility to debug scripts. Test events are not
registered by the video surveillance system, it means they aren't displayed in the Event Viewer and aren't saved to the database.

No more than one test event can be created for each script.

To create a test event, do the following:

1. In the Debug and edit menu, select Edit test event, or click the button in the toolbar.
2. The Test message window will open. This window is used for entering the parameters of a test event.

3. Enter the following information in the fields of the Test message window:
a. SourceType—system object type;
b. SourceId—system object identification number;
c. SourceAction—event generated by the specified system object;
d. param—additional event parameters;
e. value—values of the additional parameters.

118
Note

The main system objects, their events and parameters are described in Description of events and reactions of
system objects. You can also get them using the [Link] utility (see Getting the list of system names of
objects, reactions and events in Axxon PSIM).

4. When you filled in the fields of the Test message window, click the OK button.

The test event is now created.

The created test event will be displayed in the Event field in a special string format.

The figure below shows the test event Arm Camera 111.

Running a script with a test event


To run the script with a test event, do one of the following:

1. Click the Test run button in the toolbar.


2. In the Debug and edit menu, select Test run.
3. In the Debug and edit menu, select Test run in third-party debugger.

When you select the Test run in third-party debugger option, the third-party debugger starts to run the test (see Using third-party
debugger programs).

The results of the verification and execution of the script are displayed in the corresponding debugging window of the Editor-Debugger
utility.

119
Working with the debugging windows of the
Editor-Debugger utility

120
Viewing the script messages
Debugging windows display messages about logging system and test events, errors and successful script execution, as well as user
information messages.

A separate debugging window is assigned to each script in the Editor-Debugger utility.

There are two types of debugging windows: All script messages and Last run script messages.

The debugging windows of the All script messages type are displayed in the Script messages list. The names of the debugging
windows match the names of the corresponding Script objects. These windows display all system messages related to the
corresponding script. The example of the debugging window of the All script messages type:

In addition, the information on the last script run is displayed on the Script messages tab at the bottom of the Editor-Debugger utility

window. If this panel is not displayed, select Debug and edit Summary Information, or click the button on the toolbar.

121
Both types of debugging windows are used in the same way.

122
Displaying messages about starting, verifying,
changing and executing scripts in the debugging
windows
The messages in the debugging window track the stages of starting, verification and execution of scripts.

When the event that triggers the script occurs, the following message is displayed in the debugging window: “Process Event: <script
triggering event>”. For example, if the script starts on Macro 1, the line reads “Process Event:MACRO|1|RUN|”. At the moment of
changing the script in the Editor-Debugger utility or in Axxon PSIM, the debugging window displays the message «Process Event:
SCRIPT|script’s number|SETUP|» (for example, when changing the script with number 1, the debugging window displays «Process
Event: SCRIPT|1|SETUP|»).

Script syntax is checked before execution. If there are syntax errors, related error messages will be displayed in the debugging
window. The figure below shows an example of a syntax error message.

Right-click the message to view its complete text. The Information window will open containing the full text of the error message.

The message contains the following information:

1.
123
1. error description;
2. error type (for example, Src: Microsoft Jscript compilation error);
3. error location in the script text (line number and character number in the "Char" line);
4. error code (Scode).

If there are no syntax errors in a script, the following message will be displayed in the debugging window: Script first run OK. Then,
the script will run.

Script runtime errors are also displayed in the debugging window.

In case of successful execution of the script, the following message will be displayed: “End ProcessScript, begin-end delay: <script
execution time>; for example, “End ProcessScript, begin-end delay: 13 [msec]”.

124
Using third-party debugger programs
Axxon PSIM officially supports Microsoft Visual Studio 2005 debugger.

Axxon PSIM allows using third-party debuggers for processing JScript scripts. These programs may have the functionality that is not
included in the Editor-Debugger utility, for example, step-by-step script execution, watching script variables during script execution,
and so on.

Note

You must use third-party debuggers with caution, as they don't provide full compatibility with Axxon PSIM. The use of third-
party debuggers may lead to failure of Axxon PSIM.

We strongly recommend introducing the breakpoint in the script when using third-party debuggers. To insert the breakpoint, add the
debugger; command to the script. The script execution will pause at the place specified by the debugger; command, and the debugger
will start automatically.

Note

In programming, a breakpoint is a deliberate interruption of program execution at which a debugger call is made.

When you use a third-party debugger, scripts can be started with test events only.

To start the script using a third-party debugger, do the following:

1. Create a script and add the debugger; command to it.


2. Create a test event to run the script.
3. In the Debug and edit menu, select Test run in third-party debugger.
4. The Just-In-Time Debugging window will open. Select one of the debuggers installed on the computer.

5. Click Yes to confirm the selection.


6. In case of a successful syntax check (no errors found before the “debugger;” line), the third-party debugger will start. The
script will pause at the breakpoint.

Example. A script with the breakpoint after Macro 1 starts.

if ([Link]== "MACRO" && [Link]=="1" && [Link] == "RUN"); //start Macro 1


{
debugger; // breakpoint
DebugLogString ("Hello world");
}

125
Examples of scripts in the JScript language
To illustrate the available fields of application of scripts in JScript, see the following examples, which can be used to create additional
functions in the system on the basis of the Script object.

126
Examples of scripts with Video surveillance
monitor and Cameras
MONITOR Monitor

CAM Camera

Example 1. Visualisation of operating the Queue length detection in the Video surveillance monitor
For the script to work correctly, you must first create and configure the Queue length detection object (part of the Detector Pack
package), Camera and Captioner objects (below, instead of the N, M, L characters, set the corresponding numbers of the Queue
length detection, Camera and Captioner objects) in Axxon PSIM.

//Event reading by the queue length


if ([Link] == "OCCUPANCY_COUNTER" && [Link] == "N" && [Link] == "OCCUPANCY") //N -
Number of Queue length detection
{
var n=[Link]("occupancy");
//Displaying the queue length by the Captioner in the Monitor
DoReactStr("CAM","M","CLEAR_SUBTITLES","title_id<L>"); //M - Number of Camera L - Number of Captioner
DoReactStr("CAM","M","ADD_SUBTITLES","command<Queue length: "+n+" person(s).\r>,page<BEGIN>,title_id<L>");
//M, L - the same
}

As a result, when the corresponding camera is displayed in the Monitor, a text message about the current queue length will be
superimposed on the video image.

You can configure the font, color and position of text on the settings panel of the Captioner object.

Note

When you use the page<BEGIN> and page<END> parameters, the corresponding fields of the captions database are filled in.
This enables data search using the Captions search interface object.

Example 2. Visualisation of operating the People counter detection in the Video surveillance monitor
For the script to work correctly, you must first create and configure the People counter detection object (part of the Detector Pack
package), Camera, Captioner and Macro objects (below, instead of the N, M, L, P characters, set the corresponding numbers of the
People counter detection, Camera, Captioner and Macro objects) in Axxon PSIM.

127
//Event reading and counting of entered people
if ([Link] == "PEOPLE_COUNTER" && [Link] == "N" && [Link] == "IN") //N - Number of
People counter detection
{
i = Itv_var("counter_i");
k = Itv_var("counter_k");
i++;
Itv_var("counter_i")=i;
//Displaying the number of people by the Captioner in the Monitor

DoReactStr("CAM","M","CLEAR_SUBTITLES","title_id<L>"); //M - Number of Camera L - Number of Captioner


DoReactStr("CAM","M","ADD_SUBTITLES","command<Number of people (entering/exiting): "+i+" / "+k+"\r>,
page<BEGIN>,title_id<L>"); //M, L - the same

}
//Event reading and counting of exitng people
if ([Link] == "PEOPLE_COUNTER" && [Link] == "N" && [Link] == "OUT") //N - Number of
People Counter detection
{
i = Itv_var("counter_i");
k = Itv_var("counter_k");
k++;
Itv_var("counter_k")=k;
//Displaying the number of people by the Captioner in the Monitor

DoReactStr("CAM","M","CLEAR_SUBTITLES","title_id<L>"); //M - Number of Camera L - Number of Captioner


DoReactStr("CAM","M","ADD_SUBTITLES","command<Number of people (entering/exiting): "+i+" / "+k+"\r>,
page<BEGIN>,title_id<L>"); //M, L - the same
}
//Null the counter on Macro (the Macro must be created in Axxon PSIM beforehand)
if ([Link] == "MACRO" && [Link] == "P" && [Link] == "RUN") //P - Number of Macro
{
Itv_var("counter_i")=0;
Itv_var("counter_k")=0;
i=0;
k=0;
//Displaying number of people by the Captioner in the Monitor

DoReactStr("CAM","M","CLEAR_SUBTITLES","title_id<L>"); //M - Number of Camera L - Number of Captioner


DoReactStr("CAM","M","ADD_SUBTITLES","command<Number of people (entering/exiting): "+i+" / "+k+"\r>,
page<BEGIN>,title_id<L>"); //M, L - the same
}

As a result, when the corresponding camera is displayed in the Monitor, a text message about the number of entered and exited
people will be superimposed on the video image.

Note

When you use the page<BEGIN> and page<END> parameters, the corresponding fields of the captions database are filled in.
This enables data search using the Captions search interface object.

You can configure the font, color and position of text on the settings panel of the Captioner object (see Configuring captions display
on a video image).

To null people counter, you must first create the Macro object on the Programming tab. You can change the name of the Macro
object, for example "Null people counter".

You can run the macro to null people counter either manually from the main menu of Axxon PSIM or automatically at any specified
time (for this, use the Events table on the settings panel of the Macro object on which you must specify the previously configured Tim
e schedule object). For more information about the use of the Macro and Time schedule objects, see Administrator's Guide.

Example 3. Displaying camera on the monitor by clicking the button on the control panel
The following example is valid only for cameras in configuration of which there is a PTZ control panel. When configuring Video
surveillance monitor, select the Go to preset action with 1,2,3...,0 parameters for ten joystick buttons (see Assigning commands to
joystick buttons using the Monitor section of Installing and configuring security system components guide).

128
Example. When the button is clicked on the control panel, display the corresponding camera in the active Monitor. The script must be
triggered by a timer with ID=1.

Note

You must create and configure the Timer object beforehand and set the current year. For detailed information on configuring
the Timer object, see Creating and configuring the Timer object.

After each button click on the control panel wait for two seconds until clicking another button. If there is no button click, then the
camera with dialed number must be displayed.

if ([Link]=="TIMER" && [Link]=="1" && [Link]=="TRIGGER")


{
mon="1";
DebugLogString("on monitor "+ Itv_var("cam"));
DoReactStr("MONITOR",mon,"ACTIVATE_CAM","cam<"+Itv_var("cam")+">");
Itv_var("cam")="";
}

if ([Link]("source_type")=="TELEMETRY" && [Link]("action")=="GO_PRESET")


{
DoReactStr("TIMER","1","START","bound<2>");
var key=[Link]("param4_val");
DebugLogString("Key:"+key);
Itv_var("cam")=Itv_var("cam")+key;
DebugLogString(Itv_var("cam"));
}

Example 4. Superimposing captions


On Macro 1, display the text

"NNN

129
Titles"

(with line break) over the video image of camera 1 using captioner 1. On Macro 2, disable the display of this text.

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
DoReactStr("MONITOR","1","SET_TITLES","titles<NNN \r Titles>,cam<1>,title_id<1>");
}

if ([Link] == "MACRO" && [Link] == "2" && [Link] == "RUN")


{
DoReactStr("MONITOR","1","CLEAR_TITLES","cam<1>,title_id<1>");
}

130
Examples of scripts with Map
MAP Map

Specifying the text to display on the map


When you add an object to the Map, you can select the type of the Text display (see Attaching objects to the layers of interactive map)
. You can use the script in the JScript language to change the displayed text.

Example. The Text type of display on the map is selected for the Camera 1. It's required to display the value of the MyVar variable,
read from the C:\[Link] file, on the map and debug window on Macro 1.

if([Link] == "MACRO" && [Link] == "RUN")


{
var result = parseInt(ReadIni("MyVar","C:\\[Link]"));
result += 2;
NotifyEventStr("CAM","1","ANALOG_PARAMS","text<Variable value = \n" + result + ">, blink_state<1>");
DebugLogString(result);
}

131
Examples of scripts with detection tools
CAM_VMDA_DETECTOR VMDA detection

CAM_IP_DETECTOR Embedded detection

Example 1. Script to select abandoned objects with a frame in live video

If you use the object tracking on a video image (see Creating and configuring the Tracker object), then when you view archive, the
detected abandoned objects will be selected with a framed in video. To select the abandoned objects with a frame in a live video, use
the script to select an abandoned object with a frame when receiving an alarm from VMDA detection tool:

if ([Link]=="CAM_VMDA_DETECTOR")
{
cam=GetObjectParentId("CAM_VMDA_DETECTOR",[Link],"CAM");
if ([Link]=="ALARM")
{
var x1,x2,y1,y2;
x1=[Link]("x");
x2=[Link]("w");
y1=[Link]("y");
y2=[Link]("h");
x2=parseInt(x1)+parseInt(x2);
y2=parseInt(y1)+parseInt(y2);
DoReactStr("MONITOR","","SET_MARKRECT","cam<"+cam+">,color<255>,id<"+cam+">,x1<"+x1+">,x2<"+x2+">,y1<"+y1+">,
y2<"+y2+">");
DebugLogString("x1:"+x1+" x2:"+x2+" y1:"+y1+" y2:"+y2);
}
else
{
DoReactStr("MONITOR","","DEL_MARKRECT","cam<"+cam+">,id<"+cam+">");
}
}

Example 2. Using the embedded People counter detection on Bosch FLEXIDOME IP dynamic 7000 VR
IP camera
When the number of people reaches 20 on the embedded people counter detection of the Bosch FLEXIDOME IP dynamic 7000 VR IP
camera (with ID 1), call macro 1.

n=20;
if([Link] == "CAM_IP_DETECTOR" && [Link]=="1" && [Link] == "DETECTED")
{
v=[Link]("param0").split(";")[1];
if (parseInt([Link](":")[1])==n)
{
DoReactStr("MACRO","1","RUN","");
}
}

132
Examples of scripts with Macros
MACRO Macro

Example 1. Sending a command to a camera using the camera HTTP API


Camera IP address is [Link].

The following command turns on the screen wiper on a camera:

[Link]/httpapi/SendPTZ?action=sendptz&PTZ_PRESETSET=85

The following command turns off the screen wiper on a camera:

[Link]/httpapi/SendPTZ?action=sendptz&PTZ_PRESETSET=86

These commands must be sent to a camera using the JScript script.

function DoPreset(preset)
{
xmlhttp=new ActiveXObject("[Link]");
if(xmlhttp == null)
{
return;
}
[Link]("GET", "[Link] false,"
admin","1234");

[Link]();
DebugLogString([Link]);
}
if ([Link] == "MACRO" && [Link] == "6" && [Link] == "RUN")
{
DoPreset("85");
}

if ([Link] == "MACRO" && [Link] == "7" && [Link] == "RUN")


{
DoPreset("86");
}

Example 2. Sending e-mail with HTML markup


On macro 1, send a message with the attached [Link] and [Link] files from the C:\\Pictures\\ folder to example@[Link].
The message must be formatted as follows:

Face detected

Detected face Face in DB

[Link] file [Link] file

133
if([Link] == "MACRO" && [Link]=="1" &&[Link]=="RUN")
{
var file1 = "[Link]";
var file2 = "[Link]";
var file_folder = "C:\\Pictures\\";

var test_event = CreateMsg();


test_event.StringToMsg("MAIL_MESSAGE|1|SEND_RAW|cc<>,to<daniel@[Link]>,objname<Mail message 1>,subject<>,
parent_id<1>,flags<>,pack<>,name<Mail message 1>,from<example@[Link]>,_marker<>");

test_event.SetParam("body","<html><body>\r\n<h3>Face found</h3>\r\n<table><tr>\r\n<td>Detected</td><td>Found in
DB</td>\r\n</tr><tr>\r\n<td><img width='200' alt='image1' src='cid:"
+
file1
+
"'/></td>\r\n<td><img width='200' alt='image2' src='cid:"
+
file2
+
"'/></td>\r\n</tr><tr>\r\n<td>E-mail sent from Axxon PSIM</td>\r\n</tr></table>\r\n</body></html>");
test_event.SetParam("attachments",file_folder+file1+";" + file_folder+file2);
test_event.SetParam("is_body_html", 1);
DoReact(test_event);
}

134
Example of script with Users
PERSON User

CORE

MACRO Macro

Creating test users


On macro 101, create 50 users in Axxon PSIM with IDs from 100 to 150, assigning them an access level with ID 1 (provided that the
access level is assigned to the department to which the users are added and users inherit the department access level) and linking an
access card with a number, equal to the user ID. The card number must be in HEX format. The department must have no more than
30 users (to speed up the adding process).

Note

For more information on access levels and access cards, see the ACFA PSIM documentation in the AxxonSoft documentation
repository.

If an ACS integration is configured in Axxon PSIM, which supports dynamic user recording, then the created user will be
automatically written to the ACS controller when the CORE||UPDATE_OBJECT|objtype<PERSON> event is sent. If dynamics is
not supported, then recording users to the controller will need to be initiated manually.

135
dep=10; // department ID
start=100;// first user ID
last=150; // last user ID
acc_lev=1; // access level ID
dep_count=30; // max number of users in the department

if( [Link] == "MACRO" && [Link] == "RUN" && [Link]=="101")


{
kol=0;
card_count=0;
NotifyEventStr("CORE","","UPDATE_OBJECT","objtype<DEPARTMENT>,objid<"+dep+">");
for (i=start;i<=last;i++)
{
kol++;
card_count++;
card=decToHex(card_count);
if (card[[Link]-1]==0)
{
card_count++;
card=decToHex(card_count);
}

if (kol==dep_count)
{
NotifyEventStr("CORE","","UPDATE_OBJECT", "objtype<PERSON>,objid<"+i+">,name<user"+i+">,
parent_id<"+dep+">, level_id<"+acc_lev+">, facility_code<0>, card<"+card+">");
kol=0;
dep++;
NotifyEventStr("CORE","","UPDATE_OBJECT","objtype<DEPARTMENT>,objid<"+dep+">");
}
else
{
NotifyEventStr("CORE","","UPDATE_OBJECT", "objtype<PERSON>,objid<"+i+">,name<user"+i+">,
parent_id<"+dep+">,level_id<"+acc_lev+">, facility_code<0>,card<"+card+">");
}
Sleep(10);
}
}

function decToHex(n)
{
return Number(n).toString(16);
}

136
Examples of scripts with Incident server and
Incident manager
INC_SERVER Incident server

INC_MANAGER Incident manager

Example 1. On macro 1, change the status of the Alarm event on camera 1 to Completed.

OnEvent("MACRO","1","RUN")
{
DoReactStr("INC_SERVER","1","UPDATE_STATUS","status<3>,objtypes<CAM>,objids<1>,actions<MD_START>");
}

Example 2. On macro 2, on Incident server 1, change the status of the event escalation of camera 1 to Waiting for processing (not
escalated).

if ([Link] == "MACRO" && [Link] == 2 && [Link] == "RUN")


{
DoReactStr("INC_SERVER","1","UPDATE_ESCALATE_STATUS","escalated<0>,objtypes<CAM>,objids<1>");
}

Example 2. Changing the status of an event in Incident manager


When working with objects in the Incident manager, it is possible to change the event status of an object (see Processing events).
To change the event status of an object, you can use a JScript script.

Example. On macro 3, change the status of the Alarm event on camera 1 or 2 to Completed.

if ([Link] == "MACRO" && [Link] == 3 && [Link] == "RUN")


{
DoReactStr("INC_SERVER","1","UPDATE_STATUS","status<3>,objtypes<CAM>,objids<1|2>,
actions<MD_START|MD_START>");
};

137
Example of script with Failover service
FAILOVER Failover service

Example 1. Using the START and STOP events for the Failover service
Objects from more than one main Server must not be moved to the Backup Server. For this, when moving objects from some main
Server to the Backup Server, all other Failover service objects must be disabled on this Backup Server.

if ([Link] == "FAILOVER" )
{
if ([Link] == "START") {action="DISABLE";}
if ([Link] == "STOP") {action="ENABLE";}
id=[Link];
msg=CreateMsg();
[Link](GetObjectIds("FAILOVER"));
var
objCount=[Link]("[Link]");
for (i=0;i<objCount;i++)
{
pid=[Link]("id."+i);

if (!(id==pid)) {
DoReactStr("FAILOVER",pid,action,"");
}
}
}

138
Examples of scripts with BacNet
BACNET BacNet

Example 1. Writing to an object using a script

var msg = CreateMsg();

//bacnet_application_tag
var BACNET_APPLICATION_TAG_NULL = 0;
var BACNET_APPLICATION_TAG_BOOLEAN = 1;
var BACNET_APPLICATION_TAG_UNSIGNED_INT = 2;
var BACNET_APPLICATION_TAG_SIGNED_INT = 3;
var BACNET_APPLICATION_TAG_REAL = 4;
var BACNET_APPLICATION_TAG_DOUBLE = 5;
var BACNET_APPLICATION_TAG_OCTET_STRING = 6;
var BACNET_APPLICATION_TAG_CHARACTER_STRING = 7;
var BACNET_APPLICATION_TAG_BIT_STRING = 8;

//bacnet_objtype
var OBJECT_ANALOG_INPUT = 0;
var OBJECT_ANALOG_OUTPUT = 1;
var OBJECT_ANALOG_VALUE = 2;
var OBJECT_BINARY_INPUT = 3;
var OBJECT_BINARY_OUTPUT = 4;
var OBJECT_BINARY_VALUE = 5;

//bacnet_property_id
var PROP_PRESENT_VALUE = 85;

[Link]("BACNETINT|1|WRITE");
[Link]("bacnet_application_tag", BACNET_APPLICATION_TAG_UNSIGNED_INT);
[Link]("bacnet_value",30);

[Link]("bacnet_objtype",OBJECT_ANALOG_VALUE);
[Link]("bacnet_instance",0);

[Link]("bacnet_property_id",PROP_PRESENT_VALUE);
[Link]("bacnet_device_id",12345);

DoReact(msg);

If the script is successfully executed, an event will appear in the Debug window:

Event:
BACNETINT|1|WRITE_OCCURES|sender<Udp:47808>,slave_id<ASUS>,fraction<186>,invoke_id<43>,owner<ASUS>,
module<[Link]>,date<27-11-18>,
value<PROP_PRESENT_VALUE>,guid_pk<{E23BD6CB-19F2-E811-8B83-C860008A29F9}>,object_id<OBJECT_ANALOG_VALUE:0>,
core_global<1>,adr<[Link]:56747>,time<10:55:33>,source_guid<557367ce-19f2-e811-8b83-c860008a29f9>

Example 2. Event generation

DebugLogString("Script2");
var msg = CreateMsg();

[Link]("BACNETINT|1|EVENT");

[Link]("event_type", "0");
[Link]("from_state", "1");
[Link]("to_state", "0");

[Link]("message_text", "test_text1!");

DoReact(msg);

139
If the module receives an event, the following event will appear in the Debug window:

Event:
BACNETINT|1|EVENT_OCCURES|sender<Udp:47808>,slave_id<ASUS>,fraction<683>,owner<ASUS>,
event_type<EVENT_CHANGE_OF_BITSTRING>,module<[Link]>,
message_text<test_text1!>,date<27-11-18>,guid_pk<{6D34BA08-1CF2-E811-8B83-C860008A29F9}>,
from_state<EVENT_STATE_FAULT>,
core_global<1>,adr<[Link]:57878>,to_state<EVENT_STATE_NORMAL>,time<11:11:34>,source_guid<bd51a40d-1cf2-
e811-8b83-c860008a29f9>

Example 3. Reading data from an object

var msg = CreateMsg();

//bacnet_application_tag
var BACNET_APPLICATION_TAG_NULL = 0;
var BACNET_APPLICATION_TAG_BOOLEAN = 1;
var BACNET_APPLICATION_TAG_UNSIGNED_INT = 2;
var BACNET_APPLICATION_TAG_SIGNED_INT = 3;
var BACNET_APPLICATION_TAG_REAL = 4;
var BACNET_APPLICATION_TAG_DOUBLE = 5;
var BACNET_APPLICATION_TAG_OCTET_STRING = 6;
var BACNET_APPLICATION_TAG_CHARACTER_STRING = 7;
var BACNET_APPLICATION_TAG_BIT_STRING = 8;

//bacnet_objtype
var OBJECT_ANALOG_INPUT = 0;
var OBJECT_ANALOG_OUTPUT = 1;
var OBJECT_ANALOG_VALUE = 2;
var OBJECT_BINARY_INPUT = 3;
var OBJECT_BINARY_OUTPUT = 4;
var OBJECT_BINARY_VALUE = 5;
var OBJECT_CHARACTERSTRING_VALUE = 40;

//bacnet_property_id
var PROP_PRESENT_VALUE = 85;

[Link]("BACNETINT|1|READ");

[Link]("bacnet_objtype",OBJECT_ANALOG_INPUT);
[Link]("bacnet_instance",0);
[Link]("bacnet_property_id",PROP_PRESENT_VALUE);
[Link]("bacnet_device_id",123456);
DoReact(msg);

If the reading is successful, an event will appear in the Debug window:

Event:
BACNETINT|1|READ_RESULT|slave_id<example>,fraction<387>,owner<example>,module<[Link]>,date<10-11-21>,
guid_pk<{622928D6-3349-EC11-96F2-309C23D50163}>,core_global<1>,bacnet_value<20,8>,
time<15:26:03>,param0<ok>,source_guid<e8f7ded1-3349-ec11-96f2-309c23d50163>

140
Example with Telegram bot
TELEGRAM Telegram bot

Sending a message to Telegram


On macro 1, send text, image or geolocation with Telegram bot.

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")

//Sending with chat_id & bot_id from object settings:

DoReactStr("TELEGRAM","1","SEND","text<Axxon PSIM works great>");

//Explicit setting chat_id & bot_id in the command:

DoReactStr("TELEGRAM","1","SEND","text<Axxon PSIM works great>,chat_id<828752651>,bot_id<809045046:


AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>");

//Sending file with chat ID and bot ID:

DoReactStr("TELEGRAM",1,"SENDPHOTO","caption<Axxon PSIM works great>,chat_id<828752651>,bot_id<809045046:


AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>,photo<G:\\[Link]>");

//Sending geolocation with chat ID and bot ID:

DoReactStr("TELEGRAM",1,"SEND","text<Hello world>,chat_id<828752651>,bot_id<809045046:
AAGtKxtDWu5teRGKW_Li8wFBQuJ-l4A9h38>",longtitude<37.3428359>,latitude<55.6841654>,address<Office>);

141
Examples of scripts with Event Viewer
EVENT_VIEWER Event Viewer

Activating one filter


Example. In the Event Viewer, activate Filter 1 for Event viewer 1 using Macro 1.

if([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
DoReactStr("EVENT_VIEWER","1","SET_FILTERS","filter0<Filter 1>");
}

Activating multiple filters


Example. In the Event Viewer, activate Filter 1, Filter 3, and Filter 5 for Event viewer 1 using Macro 4.

if([Link] == "MACRO" && [Link] == "4" && [Link] == "RUN")


{
DoReactStr("EVENT_VIEWER","1","SET_FILTERS","filter0<Filter 1>,filter1<Filter 3>,filter2<Filter 5>");
}

142
Appendix 1. Description of the Editor-Debugger
utility

143
The purpose of the Editor-Debugger utility
The Editor-Debugger utility is used to create, debug and edit scripts in Axxon PSIM.

The Editor-Debugger utility provides the following functionality:

1. Creating and editing scripts using the built-in text editor.


2. Debugging scripts using the built-in debugging window.
3. Filtering the information to be displayed in the debugging window.
4. Creating and using test events for debugging.
5. Saving scripts to the hard drive;
6. Opening scripts from the hard drive.

144
The interface of the Editor-Debugger utility

145
The Editor-Debugger interface
The user interface of the Editor-Debugger utility contains the main menu and the toolbar (1), the objects list (2) and the viewing
/editing panel (3).

146
The Debug-edit script tab
On the page:

Description of the interface of the Debug-edit script tab


Description of the Script interface object (the Debug-
edit scrip tab)

Description of the interface of the Debug-edit script tab


The Debug-edit scrip tab is used to edit scripts and create test events.

The figure below shows the interface of the Debug-edit scrip tab:

Description of the interface of the Debug-edit scrip tab:

Number in the Parameter name Method of setting the parameter Parameter description
image value

1 Settings message Automatically Information about initialization of the Script objects in the
system

2 Additional Automatically Additional information about scripts


information

Description of the Script interface object (the Debug-edit scrip tab)

147
The Script object in the Debug-edit scrip tab is used to creat and edit scripts and test events.

The figure below shows the interface of the Script object:

Description of the interface of the Script object:

Number in Parameter Method of setting the Parameter Characters used Default Value range
the image name parameter value description value

1 Script Enter the value into the field Contains the text of Latin, Cyrillic and Blank line Unlimited number of
the script service characters characters

2 Event Enter the value into the field Contains the text of Latin, Cyrillic and Blank line Unlimited number of
the test event service characters characters

148
The Script messages tab
On the page:

Description of the interface of the Script messages tab


Description of the Script interface object (the Script
messages tab)

Description of the interface of the Script messages tab


The Script messages tab is used to display the debugging windows of scripts.

The figure below shows the interface of the Script messages tab:

Description of the interface of the Script messages tab:

Number in the Parameter name Method of setting the parameter Parameter description
image value

1 Settings message Automatically Information about initialization of the Script objects in the
system

2 Additional Automatically Additional information about scripts


information

Description of the Script interface object (the Script messages tab)


The Script object in the Script messages tab is used to to display system, test and user events related to the scripts created in
Axxon PSIM.

149
The figure below shows the interface of the Script object:

Description of the interface of the Script object:

Numbe Para Method of Parameter Characters Defa Value range


r in the meter setting the description used ult v
image name parameter alue
value

1 Descri Automatically Displays information Latin, Cyrillic Unde By default 200 lines are displayed in the list. You can
ption about events occurring and service fined change the value using the DebugMaxLines registry key (see
in the system characters Registry keys reference guide)

150
151
Main menu

152
Description of the main menu interface
The main menu of the Editor-Debugger utility is used to call the commands executed by the utility. The commands are divided into
groups by functional attributes and are located in the following menu items: File, View, Debug and edit, List of events and Help.

Description of the items of the main menu:

№ Parameter Method of setting the Parameter description


name parameter value

1 File Select the command from the Contains a list of commands for saving and opening scripts, closing the utility
drop-down list
2 View Contains a list of commands for displaying the toolbar and status bar in the utility window

3 Debug and Contains a list of commands for script debugging


edit

4 List of events Contains a list of commands changing the parameters of message display in the debugging
windows

5 Help Contains the About command. This command displays the window with general information
about the Editor-Debugger utility

153
Description of the File item of the main menu
The File item of the main menu is used to open and save scripts and to close the utility.

Description of the elements of the File item of the main menu:

№ Parameter name Parameter description

1 Save to database Saves the script to its corresponding system object

2 Save to disk Saves the script to a text file on the hard disk

3 Open from disk Opens the script from the selected text file into the utility editor

4 Exit The command shuts down the utility and closes its dialog window

154
Description of the View item of the main menu
The View item of the main menu is used to call the commands that enable and disable the display of the toolbar and status bar in the
utility window.

Description of the elements of the View item of the main menu.

№ Parameter na Method of setting the parameter Parameter description Default val


me value ue

1 Toolbar Set the checkbox Enables or disables the display of the toolbar in the utility window Checkbox is
set

2 Status bar Set the checkbox Enables or disables the display of the status bar at the bottom of the Checkbox is
utility window set

155
Description of the Debug and edit item of the
main menu
The Debug and edit item of the main menu is used to call the commands for debugging scripts.

Description of the elements of the Debug and edit item of the main menu:

№ Parameter name Parameter description

1 Test run Runs the script on a test event

2 Test run in third-party d Runs the script on a test event using the third-party debugger
ebugger

3 Edit test event Opens the dialog window for editing a test event

4 Summary information Opens the Thread Information window, which displays the system, test and user messages related
to the script being debugged

5 Go to line Opens the dialog window for specifying the number of the character and line in the script text to
which you want to go

156
Description of the List of events item of the main
menu
The List of events item of the main menu is used to change the parameters of the message display in the debugging window.

Descriptions of the elements of the List of events item of the main menu:

№ Paramete Parameter description


r name

1 Clear Clears the Description field of the debugging window

2 Highlight Opens the window used to specify words (or other character sequences) in strings containing them, which you
want to highlight in the Description field of the debugging window

3 Search Searches for a word (or other character sequences) in the Description field of the debugging window

4 Set filter Opens the window used to enable and configure a filter. The strings that contain (don't contain) the specified
words must be included in the debugging window (or excluded from it)

5 Apply filter Applies the created filter

157
Description of the Filter dialog window
The Filter dialog window is used to enable and configure message filters displayed in the Description field of the debugging window.

You can open the Filter interface window in two ways:

1. Click the Filter button in the toolbar of the Editor-Debugger utility.


2. In the List of events, select Filter.

Interface of the Filter window:

Description of the interface of the Filter window:

Number Param Method of Parameter description Characters Defa Value range


in the eter na setting the used ult v
image me parameter value alue

1 Include Enter the value The strings containing the words (or other character Latin, Cyrillic Blank Unlimited
into the text field sequences) specified in this field will be displayed in the and service string number of
debugging window characters characters

2 Exclude Enter the value The strings containing the words (or other character Latin, Cyrillic Blank Unlimited
into the text field sequences) specified in this field will be excluded from the and service string number of
debugging window characters characters

158
Description of the Highlight dialog window
The Highlight dialog window is used to set the color highlighting of the lines containing specified words in the debugging window.

You can open the Highlight dialog window in two ways:

1. Click the Highlight button in the toolbar of the Editor-Debugger utility.


2. In the List of events menu, select Highlight.

Interface of the Highlight window:

Description of the elements of the Highlight window:

159
Number Parame Method of setting Parameter description Units Defau Value range
in the ter na the parameter lt val
image me value ue

1 String Enter the value into Sets the words (or other character sequences) to Latin, Blank Unlimited
the text field highlight the strings containing them in the debugging Cyrillic and string number of
window service characters
characters

2 Color Select the value Sets the color to highlight strings in the debugging RGB format Gray RGB colors
from the drop- window
down list

160
Description of the toolbar of the Editor-Debugger
utility
The toolbar of the Editor-Debugger utility is used to call the frequently used functions of the utility.

The toolbar operates in two modes: when the script control buttons are active, or when the debugging window control buttons are
active. The mode depends on the currently active tab of the Editor-Debugger utility: either the Debug-edit script tab for editing
scripts, or the Script messages tab for viewing messages in the debugging window.

Interface of the toolbar of the Editor-Debugger utility in the script editing mode:

Description of the interface of the toolbar of the Editor-Debugger utility in the script editing mode:

Number in Parameter name Parameter description


the image

1 Test run Runs the script on a test event

2 Test run in third- Runs the script on a test event using the third-party debugger
party debugger

3 Save Saves the script to the Script system object

4 Edit test event Opens the dialog window for editing test events

5 Summary information Opens the Thread Information window, which displays the system, test and
user messages related to the script being debugged

Interface of the toolbar of the Editor-Debugger utility when working with the debugging window:

Description of the interface of the toolbar of the Editor-Debugger utility when working with the debugging window:

Number in Paramet Parameter description


the image er name

1 Clear Clears the Description field of the debugging window

2 Highlight Opens the window used to specify words (or other character sequences) in strings containing them,
which you want to highlight in the Description field of the debugging window

3 Search Searches for a word (or other character sequences) in the Description field of the debugging window

4 Set filter Opens the window used to enable and configure a filter. The strings that contain (don't contain) the
specified words must be included in the debugging window (or excluded from it)

5 Apply Applies the created filter


filter

161
Appendix 2. Creating custom objects with ability
to set events, reactions and states

162
Purpose of custom objects and their
implementation in Axxon PSIM
Custom objects represent software emulation of new Axxon PSIM objects and allow for configuring their states, reactions, and events.
You can work with custom objects using scripts, macros and macroevents.

You can create custom objects using the [Link] and [Link] utilities in the <Axxon PSIM installation folder>\Tools.

In the How to create a custom object section, you can find an example of creating two types of custom objects that can be used to
show the state of the abandoned objects detection tool on the map or to show any other user states. The states of objects are changed
using macros, scripts, or via IIDK.

The procedure for creating and configuring a custom object:

1. Prepare the DBI file with the required types of objects.


2. Prepare the DDI file—it specifies the events, reactions, states and state transition rules for the newly created objects.
3. Prepare the XML file with the parameters of the newly created objects.
4. Update the main database using The [Link] utility for converting databases, selecting database templates and making backup
copies of databases.
5. Create a custom object in Axxon PSIM.

163
How to create a custom object
Here you can find out how to create the following custom objects:

1. CUSTOM type with SLAVE (Computer) parent type.


2. CUSTOM_CHILD type with CUSTOM parent type (see item 1).

An object of the CUSTOM type has the property set:

1. Custom_param1 and custom_param2 parameters


2. Events: ALARM, INFO, ON, OFF
3. Reactions: ON, OFF
4. States: ON, OFF
5. State machine:
a. Set ON state for ON event
b. Set OFF state for OFF event

The CUSTOM_CHILD type of the object is created to demonstrate tree structure and has no user parameters, events, reactions or
states.

164
DBI file preparation
A DBI file is prepared using the [Link] utility. Details on how to handle it can be found in The [Link] utility for editing database
templates and external settings files.

A DBI file for the objects of the CUSTOM and CUSTOM_CHILD type is created as follows:

1. Run the [Link] utility (see The [Link] utility for editing database templates and external settings files).
2. Go to the DBI tab.
3. Create two objects—OBJ_CUSTOM and OBJ_CUSTOM_CHILD as shown in the figure below.

Attention!

Object (table) names must look like OBJ_<object type>.

4. Set the parameters for each object. The id, name, parent_id, flags, guid parameters are mandatory for all objects. Custom
_param1, custom_param2 in the example in the figure are custom parameters. You can also set other parameters used in Ax
xon PSIM. For example, adding the region_id parameter will allow you to set areas and regions for an object (see Subdivision
of the protected facility into areas and regions).
5. Save the changes using the Save command in the File menu. The saved file must have the dbi extension and must be located
in Axxon PSIM installation directory, for example, C:\Program Files (x86)\Axxon PSIM\[Link].

DBI file preparation is complete.

165
DDI file preparation
A DDI file is prepared using the [Link] utility. Details on how to handle it can be found in The [Link] utility for editing database
templates and external settings files.

A DDI file for CUSTOM and CUSTOM_CHILD object types is created as follows:

1. Run the [Link] utility (see The [Link] utility for editing database templates and external settings files).
2. Create CUSTOM and CUSTOM_CHILD objects in the DDI tab, as shown below.

3. Go to the Events tab and configure events that must be supported by the object (see the figure).

4. Go to the Reactions tab and configure reactions that must be supported by the object (see the figure).

Note

Reactions of custom objects are automatically converted into events. In other words, a custom object automatically
generates an event when there is a reaction.

166
5. Go to the States tab and describe the states that the object can take. Here there are two states—ON and OFF.

Note

The postfix of file name is specified in the Image column—the image that is stored in <Axxon PSIM installation
directory>\Bmp. For instance, these will be custom_off.bmp and custom_on.bmp files (corresponding to ON and OFF
states) for CUSTOM object. These files will be used by the map module.

167
6. Go to the Transition rules tab and set the object state change logic.

Transition rules is a simple state machine—an event is an input action and a state is a result.
An unconditional transition is used in this case: if CUSTOM||ON event is received, then there is transition to the ON state, if
CUSTOM||OFF event is received, then there is transition to the OFF state.
7. To save changes use the Save command in the File menu. The saved file must have the ddi extension and be stored in the
folder corresponding to the required language, for example, C:\Program Files (x86)\Axxon PSIM\Languages\en\[Link].
ddi.

The DDI file preparation is completed.

168
XML file preparation
An XML file is prepared using the [Link] utility that can be found in <Axxon PSIM installation directory>\Tools. The
general view of the utility window is shown in the figure below.

An XML file for a custom object is created as follows:

1. In the object_type field (1), enter the name of the object type.

2. In the parent_type field (2), enter the name of the parent type.
3. If the object type has child types, then set the has_child checkbox (3).
4. Repeat steps 1-3 for all object types.
5. Save the file with any name and .xml extension in the Axxon PSIM installation directory using the File Save command. For
example, the "[Link]" file name is recommended for the object shown on the picture above.

The XML file is now created. The file contents look like this:

<?xml version="1.0" standalone="yes"?>

<objects>

<object>

<object_type>CUSTOM</object_type>

<parent_type>SLAVE</parent_type>

<has_child>1</has_child>

</object>

<object>

<object_type>CUSTOM_CHILD</object_type>

<parent_type>CUSTOM</parent_type>

</object>

</objects>

You can edit it manually if required.

In particular, the <include_parent_id>1</include_parent_id> parameter can be added to an XML file. When setting this parameter to
1, the IDs of the child custom objects will include the ID of the parent object. For example, if a CUSTOM object has a child
CUSTOM_CHILD, and the CUSTOM has ID = 3, then CUSTOM_CHILD objects will be created with identifiers 3.1, 3.2, and so on.

169
Creating and using a custom object in Axxon PSIM
On the page:

Displaying on the map


Using in macros
Sample program in JScript to change the state of a
custom object

Attention!

After preparing the required files and before creating custom objects in Axxon PSIM, it is necessary to update the main
database using The [Link] utility for converting databases, selecting database templates and making backup copies of
databases.

When the DBI, DDI and XML files are ready, the objects of a new type along with the standard objects can be created in Axxon PSIM
hardware tree.

Custom parameters are displayed on the settings panel of the created custom object—custom_param1 and custom_param2 in this
example. Their values can be set in the table.

170
Displaying on the map
When an object is created in the hardware tree it can be placed on the map and set reactions can be executed in the object context
menu (see Configuring the interactive map for object state indication and controlling the objects).

Using in macros
When a custom object is created in the hardware tree it can be used in macros.

171
Note

Reactions of custom objects are automatically converted into events. Thus, in the example, when the ON reaction is
executed, the object state changes due to set state transition rules (see DDI file preparation) and the icon corresponding to
the state will be displayed on the map.

Sample program in JScript to change the state of a custom object


Problem. Using macro 1 change the state of a custom object 1 to ON and display the icon corresponding to this state on the map.

Solution. As state transition rules are set, when the ON event is sent from the custom object, the state will be automatically changed
to ON and the icon specified in ddi file (see DDI file preparation) to this state will be displayed on the map. A script for sending the ON
event looks like this:

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")

var msgevent = CreateMsg();

[Link] = "CUSTOM";

[Link] = "1";

[Link] = "ON";

NotifyEvent(msgevent);

172
Description of events and reactions of system
objects
All reactions for the main objects of the system are specified in this section.

Note

You can view events for system objects in one of the following ways:

1. Viewing the Axxon [Link] file using the [Link] utility (see Getting the list of system names of objects, reactions
and events in Axxon PSIM).
2. Viewing events for the selected system object using the settings panel of the Macro system object (see Creating and
configuring Macro events).

173
GRABBER Video capture device
The Grabber object corresponds to the Video capture device system object.

The Grabber object sends events presented in the table. Procedure is started when the corresponding event occurs.

Description of events of the Grabber object.

Events Description

+12V Voltage error +12V

+3.3V Voltage error +3.3V

+5V Voltage error +5V

-12V Voltage error -12V

-5V Voltage error -5V

CPU_FAN Number of fan rotations

CPU_TEMP Temperature of processor

SYS_TEMP Temperature of MB chipset

UPS_COMMLOST Connection lost

UPS_FATAL_ERROR Error of connection

UPS_LOWBATT Battery low

UPS_ONBATT Switch to battery supply

UPS_ONLINE Restoring the main supply

UPS_REPLACEBATT Battery changing is required

UPS_SHUTTING Shutdown

VCORE Voltage of processor core

AUDIO_SIG_LOST Sound lost

CONNECT_FAIL Connection error

CONNECT_OK Connected

NETWORK_FAILURE Connection lost

STATE_CONNECTED Connection restored

List of commands and parameters for the Grabber object is presented in the following table:

Command—command description Par Description of parameters


am
ete
rs

"SETUP"—sets parameters of video capture device cha Number of PCI slot (0,1,2,…,32).
n<>

mo Speed of grabber/digitising (0—maximal, 1—average, 2—


de minimal)
<>

res Resolution (0—standard, frame quarter (384x288); 1—


olut high, half-frame (768x288); 2—maximum, frame
ion (768x576))
<>

174
for Format of video signal (PAL, NTSC)
mat
<>

driv Disks for video archive record (DRIVE1:\, DRIVE2:\ …


es<> DRIVEN:\)

ca Number of connected video cameras


ms
<>

aut Authorization data


h<>

ip<> IP address of network video input card

na Name of object
me
<>

flag Flags
s
<>

ip_ IP port
por
t<>

pas Password
swo
rd<>

typ Type of digitising


e<>

use Login
rna
me
<>

wat WatchDog shutdown (0—disabled, 1—enabled)


chd
og
<>

"SET_DRIVES"—sets disks for video archive record driv Disks for video archive record
es<>

"MUX1_OFF"—disables video output through the analog output 1 - -

"MUX2_OFF"—disables video output through the analog output 2 - -

"MUX3_OFF"—disables video output through the analog output 3 - -

"SET_IPINT_PARAM"—sets (changes) parameters of an IP device. par Name of parameter. Set of parameters for each
Reaction allows changing of IP device settings wothout doing into its am camera is individual—see Appendix 2. Defining the
web interface. _id param_id and param_value values for the
<> SET_IPINT_PARAM reaction
Note. For the reaction to operate you must enable the multistream
video—Configuration of multistream video, and Appendix 2. Defining par Value of parameter. Set of parameters for each
the param_id and param_value values for the SET_IPINT_PARAM am camera is individual—see Appendix 2. Defining the
reaction _va param_id and param_value values for the
lue SET_IPINT_PARAM reaction
<>

ca Camera ID in Axxon PSIM


m_i
d<>

vstr Number of video stream (optional parameter). It looks


ea like “Number of camera”.”Number of stream”, for
m_i example, 1.1, 1.2
d<>

175
"START"—start playing video file in a virtual video capture device - -

"STOP"—stop playing video file in a virtual video capture device - -

"ENABLE"—enable object (clear the Disable checkbox in the object rec Possible parameter values:
settings panel) ursi
ve<> 0—enable only Video capture device

1—enable the Video capture device and all Camera


objects created on the basis of it

"DISABLE"—disable object (clear the Disable checkbox in the object rec Possible parameter values:
settings panel) ursi
ve<> 0—disable only Video capture device

1—disable the Video capture device and all Camera


objects created on the basis of it

Properties of the GRABBER object are shown in the table.

Properties of the GRABBER object Description of properties

ID<> Object ID

PARENT_ID<> Number of video capture device

176
CAM Camera
The CAM object corresponds to the Camera system object.

The CAM object sends the events given in the table. Procedure is started when the corresponding event occurs.

Description of the events from the CAM object.

Ev Description Comment
ents

ARM Camera is If arming was performed by the Operator from the Map or Video surveillance monitor, the user_id<>
armed parameter contains the identifier of the user who performed this action

ATT Connecting
ACH

BLI Camera is
NDI sealed
NG

DE Break Event is generated when the input signal from the camera on the video capture device is lost
TA
CH

DIS Camera is If disarming was performed by the Operator from the Map or Video surveillance monitor, the user_id<>
ARM disarmed parameter contains the identifier of the user who performed this action

FIL Error of Event is generated when an error occurs when writing the video archive to disk
E_R recording on
EC_ disk
ER
ROR

MD Alarm
_ST
ART

MD End of alarm
_ST
OP

PRI Print frame


NT

REC Recording on If recording was initiated by the Operator from the Map or Video surveillance monitor, the user_id<>
disk parameter contains the identifier of the user who performed this action

RE Stop If recording was stopped by the Operator from the Map or Video surveillance monitor, the user_id<>
C_ recording on parameter contains the identifier of the user who performed this action
ST disk
OP

UN Camera is
BLI opened
NDI
NG

RE Record is
CO enabled
RD
ER_
ON

RE Record is
CO disabled
RD
ER_
OFF

177
DIS Disk is
C_ mounted
MO
UNT

DIS Disk is
C_ unmounted
UN
MO
UNT

FIN Video export If the video export fails, the event has the non-null error_result parameter.
ISH is completed
ED In the param<0> parameter there is additional information displayed in the corresponding column of the Eve
_A nt Viewer, in the following format: "ComputerName;ExportPeriod;UserName;UserID", for example,
VI_ param0<LOCALHOST;04-06-18 16:50:55_04-06-18 16:55:55;Smith;1>
EXP
ORT

MD Object count The event is generated when the number of objects detected by the tracker in the frame is exceeded (see Cre
_LI in a frame ating and configuring the Tracker object section of the Administrator's Guide for details on how to set this
MIT exceeded parameter). An event is generated whenever the number of objects is changed (up or down), until it is less
than the threshold.

The object_count<> parameter is the number of objects in the frame that the tracker detected, exceeds the
specified limit, and differs from the previous value.

See also the description of the NEW_OBJECT event below

NE New object on Among others, it contains the following parameters:


W_ a frame
OBJ detected by total<> is the total number of objects in the frame at the time the event occurred
ECT tracker new_id<> is the identifier of the detected object

AR Record Deletion of the record from the camera archive from the Video surveillance monitor
CH deletion
_D
ELE
TE

OP File opening Opening a file for playback by a virtual video capture device. Indicates that playback of the next file from the
EN selected folder starts.
_FI
LE Among others, the event contains the following parameters:

name<> is the name of the file being played back


tss<> is the time in UTC format in milliseconds from 1/1/1970

CL File closing Finishing a file playback in a virtual video capture device. Indicates that playback of a file is ended.
OS
E_F Among others, the event contains the following parameters:
ILE
name<> is the name of the file that finished being played back
tss<> is the time in UTC format in milliseconds from 1/1/1970

AR File protected The event is displayed when a user protects the file from being overwritten.
CH from rewriting
_PR The param<0> parameter contains additional information about the computer name, fragment, user name
OT and user id, which is displayed in the Add. Info column in the Event Viewer in the following format:
ECT
ED "ComputerName;ProtectionPeriod;UserName;UserID", for example, param0<LOCALHOST;04-06-18 16:50:
55.612_04-06-18 16:55:55.612;Smith;1>

AR Rewrite The event is displayed when a user removes protection of the file from being overwritten.
CH protection
_U removed from The param<0> parameter contains additional information about the computer name, fragment, user name
NP file and user id, which is displayed in the Add. Info column in the Event Viewer in the following format:
RO
TEC "ComputerName;ProtectionPeriod;UserName;UserID", for example, param0<LOCALHOST;04-06-18 16:50:
TED 55.612_04-06-18 16:55:55.612;Smith;1>

178
FRA Frames The FRAME_SKIPPED event occurs in Axxon PSIM if there are frames skipped when recording to the archive.
ME skipped By default, the event is generated if there were more than 50 frame skips during the testing period. When
_S frame skipping stops, the FRAME_SKIPPED_STOP event is generated. The description of this event contains
KIP information about the number of skipped frames and the time period in which there were skips. By default,
PED both events are generated no more than once every 30 seconds.

FRA End of frames The events are controlled by the following registry keys (see Registry keys reference guide):
ME skipping
_S the FRAME_SKIPPED event can be disabled using the [Link] registry key;
KIP the delay time between the state changes in seconds is specified in the FileSystem.
PE RecordingStateChangeDelay key.
D_ The minimum value is 30 seconds. If you specify a smaller value, the minimum value of 30 seconds will
ST still be used (the key in the registry will be overwritten);
OP the number of skipped frames for the period, during which the FRAME_SKIPPED event will be generated,
is specified in the [Link] key

AR Bookmark The event is displayed when a user adds a bookmark.


CH created
_B The param<0> (i.e. the Add. Info column in the Event Viewer) parameter contains the comment to the
OO bookmark
KM
AR
KED

AR Bookmark The event is displayed when a user deletes a bookmark


CH deleted
_U
NB
OO
KM
AR
KED

TE Temperature The param0<> parameter contains the temperature value received from the thermal camera
MP threshold
ER
AT
UR
E_A
LARM

IGN Ignoring The event is generated when a video fragment is deleted from the archive before expiration of the time
OR "Keep no less period set by the Keep no less than parameter. See also Configuring video camera archive depth
E_K than"
EEP
_N
O_L
ESS

AV Availability of The event occurs in response to the GET_AVAILABILITY command and contains information about the
AIL the key number of objects added to the license key for the given position. Parameters:
ABI position in the
LITY license file qty_localpriority<> is the number of allowed objects of the specified type on this computer (local key)
and the qty<> is the total number of allowed objects of the specified type in the license (generic key)
number of pos<> is the position number in the license key
objects
If there is no position in the key, the event will have a zero value

WR Writing error
ITI
NG
_FA
ILED

FIL File system Contains mandatory parameter error_msg<>—error text; can also contain parameters cam<>—camera ID
ESY error and error_code<>—error code. Example:
STE
M_ CAM|-1|FILESYSTEM_FAILED|error_msg<Failed to delete index file: D:\\VIDEO\\INDEX\\[Link], error
FAI code: 5.>,error_code<5>
LED

179
The list of commands and parameters for the CAM object is given in the following table:

Command—command description Para Description of parameters


mete
rs

SETUP—sets (changes) the parameters of a camera rec_p Record priority (from 0 to 3, 0—standard, 3—all resources)
riority
<>

compr Compression ration (0—no compression, 1—maximum quality, …,


ession 5—minimum quality)
<>

sat_u Value of color (0—min, 10—max)


<>

proc_ Append period (0–30 sec)


time<>

manu Control brightness and contrast settings (0—manual; 1—auto; 2—


al<> auto, but close to values specified manually)

contra Contrast (0—min, 10—max)


st<>

md_si Size of motion detection objects (1–16)


ze<>

md_ Mode of pause record (1—enabled, 0—disabled)


mode
<>

audio Type of sound accompaniment


_type
<>

pre_r Time of pre-record (0–20 sec)


ec_ti
me<>

bright Brightness (0—min, 10—max)


<>

audio Number of a microphone (empty parameter if there is no


_id<> microphone)

rec_ti Record speed (1–30 FPS, 0—not used)


me<>

alarm Record of alarms (1—enabled, 0—disabled)


_rec<>

hot_r Time of hot record (0–30 sec)


ec_ti
me<>

hot_r Period of hot record (0–20 sec)


ec_pe
riod<>

mux<> Number of channel (0–1 channel, 15–16 channel)

color Color (0—black and white, 1—multicolor)


<>

activit -
y<>

arch_ Number of archive days


days<>

180
blindi Camera is sealed
ng<>

config -
_id<>

decod -
er<>

flags<> Flags

fps<> Speed of record (0—not used, 1–30 FPS)

ifreq<> Frequency of key frames in sequence (1—each frame is key, 2—10


0th frame)

mask Detection tool mask


0,
mask
1,
mask
2,
mask
3,
mask4

md_c Sensitivity of motion detection tool (0–15)


ontras
t<>

motio Estimation of compressor motion (5–255)


n<>

name Object name


<>

passw Video archive password


ord_c
rc<>

priorit Priority of record resource (0—auto, 1—manual)


y<>

resolu Resolution (0—standard CIF, 1—high 2CIF, 2—maximum 4CIF)


tion<>

type<> Type of object

yuv<> Color schema of video signal coding (0—YUV4:2:0, 1—YUV4:2:2)

DELETE—disables camera - -

START_VIDEO—enables video stream for the current slave Name of the computer to which the camera is connected
camera _id<>

comre Level of compression


ss<>

regist -
er_onl
y<>

STOP_VIDEO—disables video stream for the current slave Name of computer to which camera is connected
camera _id<>

REQUEST_MASK mask Mask


<>

MUX1, MUX2, MUX3—display the image of a camera on - -


1, 2, 3 analog outputs

ACTIVATE—display camera on monitor monit Number of a monitor


or<>

181
ARM—arm camera - -

DISARM—disarm camera - -

REC—start recording from a camera time<> Time of record in seconds, if null than only one frame is recorded

rollba If 1, the record is performed with a rollback


ck<>

priorit Sets priority of command to start recording. See Appendix 1.


y<> Priorities of the start and stop recording commands

strea Sets an identification number of a stream for recording. The


m_id stream ID is set as "n.m" where n is the camera ID, m is the
<> number of the stream.

Note. If the specified stream isn't used for any purpose other than
record by command (and custom on clients), make sure that the L
ock disabling streams not in use checkbox is set for it—see Th
e Settings panel of the Camera object

REC_STOP—stop recording from a camera priorit Sets priority of a command to stop recording. See Appendix 1.
y<> Priorities of the start and stop recording commands

user_i If recording was stopped by a user from the Video surveillance


d<> monitor, the parameter contains the user ID. Otherwise the
parameter is absent

from_ If recording was stopped by a macro, the parameter contains the


macro macro ID. Otherwise the parameter is absent
<>

SET_MASK—set mask mask Mask


<>

ADD_SUBTITLES—add titles comm Test of imposed titles


and<>

title_i The ID of the Captioner object which is used to impose


d<>

page Required parameter to allow recording titles to the titles database


<> to provide search by titles. Available values: BEGIN (start of
recording in the database), END (end of recording in the database)

SIP_CONNECT—Sip connected - -

SIP_DISCONNECT—Sip disconnected - -

SET_IPINT_PARAM—set (change) the parameters of an para Name of a parameter. Set of parameters for each camera is
IP device. Reaction allows changing the IP device m_id individual—see Appendix 2. Defining the param_id and
settings without going into its web-interface. <> param_value values for the SET_IPINT_PARAM reaction

Note. For reaction operation it is required to enable the para Value of a parameter. Set of parameters for each camera is
mode of multi-flow video signal—see Configuration of m_val individual—see Appendix 2. Defining the param_id and
multistream video and Appendix 2. Defining the ue<> param_value values for the SET_IPINT_PARAM reaction
param_id and param_value values for the
SET_IPINT_PARAM reaction vstrea Number of a video stream (optional parameter). It is given by
m_id “Number of camera”.”Number of a stream”, for example 1.1, 1.2
<>

GET_FRAME—get frame from a camera even if it is not path<> Path to save a frame. If there is no parameter, the FRAME_SENT
displayed in the Video surveillance monitor event with the data parameter will be formed in the system.
Processing of this event is described in The SaveToFile method of
the The Script object. Programming using the JScript language

182
strea Optional parameter. Sets Axxon PSIM stream to get a frame
m<> from. The stream can be specified by a number or purpose.
Possible purposes:

stream_archive—stream for archive recording


stream_alarm—stream for archive recording by alarms
stream_client—stream for displaying
stream_analytic—stream for video analytics

Stream number consists of a camera ID and a stream ID divided


by dot, for example, 4.3 is for stream 3 from camera 4

time<> Optional parameter. It is set to request video frame from the


archive. Format: DD-MM-YYYY hh:mm:ss. Example: time<19-09-
2017 11:35:34>

gate<> Optional parameter. Specifies the network name of the Videogate


from the archive of which to get the frame

arch<> Optional parameter. Specifies the network name of the Backup


archive to get the frame from

slave Optional parameter. Specifies the network name of the Server to


_id<> get the frame from

passw Optional parameter. Specifies the CRC sequence to be recorded to


ord_c the file together with the frame
rc<>

ARCH_DEL_RECORD—delete archive recordings over fromT Mandatory parameter. Time in the YYYY-MM-DDTHH: MM: SS.
the specified period. ime<> NNN format, where NNN—milliseconds. The recordings will be
deleted (starting with the first one containing the specified time
and ending with the last one containing the toTime time). If no
time is specified in the toTime parameter, then only one recording
will be deleted

toTim Optional parameter. Time in the YYYY-MM-DDTHH: MM: [Link]


e<> format, where NNN—milliseconds. See description above

REC_RESTART—restart recording - -

ARCH_BOOKMARK_RECORD—create a bookmark time1 The date of the archive period beginning included in the
<> bookmark in the DD-MM-YY HH: MM: [Link] format, where NNN
- milliseconds

time2 The date of the archive period ending included in the bookmark in
<> the DD-MM-YY HH: MM: [Link] format, where NNN—
milliseconds

comm Comment to a bookmark


ent<>

slave Computer and Video surveillance monitor IDs using which the
_id<> bookmark will be created. Parameter format: <computer id>.
<monitor id>.

For example, slave_id<WS2.1>—WS2 is a computer ID and 1 is


Video surveillance monitor ID

CRUISE_START—auto cruise cruise Route name on a camera


_id<>

action Executed action:


<>
CRUISE_START—start cruising along the specified route
PATROL_PLAY—start patrolling along the specified route

cam_i Camera ID
d<>

183
GET_DEPTH—get the archive depth. The ARCHIVE_DEP drive Disk or network path to request the archive depth.
TH event from the SLAVE object (see SLAVE Computer) <>
is created in the system as the response to this The disk name is set in the "<disk letter>:\\" format, for example
reaction. If one or both parameters are absent it drive<D:\\>
means that there is the archive depth request for all
possible parameters Note. The "\" character is an escape character.

The network path is set in the UNC format

arch Get the backup archive depth.

Example.

DoReactStr("CAM","2","GET_DEPTH","drive<D:\\>,cam<2>,
arch");

gate Get the videogate archive depth.

Example.

DoReactStr("CAM","1","GET_DEPTH","drive<V:\\>,gate");

CLEAR_SUBTITLES—remove all titles from the video title_i The ID of the Captioner object
image d<>

GET_AVAILABILITY—check the availability of the key pos<> The position number in the license key
position

Properties of the CAM object are shown in the table.

Properties of the CAM object Description of the object properties

ID<> Object ID

PARENT_ID<> Parent object ID

TELEMETRY_ID<> Telemetry module ID (PTZ ID)

REGION_ID<> Region ID

The CAM object can be in the following states.

State of CAM object Description

ALARMED Camera is in alarm mode.

DISARM_DETACHED No signal from camera

DETACHED No signal from camera

ARMED Camera is armed

DISARMED Camera is disarmed

184
MONITOR Monitor
The MONITOR object corresponds to the Monitor system object.

The MONITOR object sends events presented in the table. Procedure is started when the corresponding event occurs.

List of commands and parameters for the MONITOR object is presented in the following table:

Event Description Comment

STARTE Video export started Among others, the event has the following parameters:
D_AVI_E
XPORT slave_id<>—operator who started the export
param1<>—number of camera on which the export is performed, date and time of export
period beginning. The parameter value is like "<RecNo.> Camera <id> (dd-mm-yy hh:mm:
ss)", for example param1<01 Camera 1 (05-10-17 10:23:21)>
time<>—time when export started

FINISHE Video export finished Among others, the event has the following parameters:
D_AVI_E
XPORT slave_id<>—operator who started the export
param1<>—number of camera on which the export is performed, date and time of export
period ending. The parameter value is like "<RecNo.> Camera <id> (dd-mm-yy hh:mm:
ss)", for example param1<01 Camera 1 (05-10-17 10:23:21)>
time<>—time when export ended
param<0>—additional information displayed in the corresponding column of the Event
Viewer, in the following format: "ComputerName;ExportPeriod;UserName;UserID", for
example, param0<LOCALHOST;04-06-18 16:50:55_04-06-18 16:55:55;Smith;1>

AVI_EXP Video export result The event has the same parameters as START_AVI_EXPORT with additional error_result<>
ORT_RE having one of the following values:
SULT
0—export successful
1—unknown
2—busy
3—not ready
4—invalid interval
5—file error

PLAY_ST Start the archive -


ART fragment playback

PLAY_ST Stop the archive -


OP fragment playback

INTERFA Visualization change param<0>—additional information displayed in the corresponding column of the Event Viewer, co
CE_MANI ntains the identifier of the camera that was moved around the layout
PULATION

LAYOUT_ Deleting layout param<0>—additional information displayed in the corresponding column of the Event Viewer, co
DEL ntains the name of the deleted layout

LAYOUT_ Adding layout param<0>—additional information displayed in the corresponding column of the Event Viewer, co
ADD ntains the name of the added layout

LAYOUT_ Changing active param<0>—additional information displayed in the corresponding column of the Event Viewer, co
ACTIVATE layout ntains the name of the activated layout

REPLACE Changing the camera param<0>—additional information displayed in the corresponding column of the Event Viewer,
_CAM position in the following format:

<Camera 1 name> <Camera 2 name>

ACTIVAT Camera activated auto_switch<>—indicates whether slide show (auto paging, auto scrolling) was enabled at the
E_CAM time of camera activation. This parameter can be used to turn off slide show when activating a
Video surveillance window

185
CAM_EX The Video The event is generated if the following registry keys are set (see Registry keys reference guide):
PAND Surveillance Window
expanded to the MaximizeCameraOnDblClk=1
entire Monitor MinimizeCameraOnDblClk=1

Event parameters:

param0<>—camera ID
user_id<>—the ID of the user who performed the action

CAM_CO The Video The event is generated if the following registry keys are set (see Registry keys reference guide):
LLAPSE Surveillance Window
collapsed back MaximizeCameraOnDblClk=1
MinimizeCameraOnDblClk=1

Event parameters:

param0<>—camera ID
user_id<>—the ID of the user who performed the action

List of commands and parameters for the MONITOR object is presented in the table:

Command—command description Par Description


am
eters

"REMOVE"—removes camera from monitor cam ID of camera in the settings tree which must be removed from
<> monitor

sho Optional parameter. Possible values:


w<>
0—do not update the layout in the Monitor after removing the
camera. There may be empty space not occupied by Video
surveillance windows
1—update the layout in the Monitor after removing the camera to
minimize empty space

"REMOVE_ALL"—removes all cameras from monitor - -

"STOP_VIDEO"—stops video stream of camera cam ID of a camera in the settings tree, the video stream from which
<> must be stopped

"REPLACE"—removes all cameras from monitor and slav Name of a computer to which monitor belongs, it is possible to place
triggers the specified camera e_id owner in script
<>

cam ID of a camera in the settings tree which must be displayed in the


<> monitor

nam Name of a camera which will be displayed in the bottom-left corner


e<>

audi -
o_ty
pe<>

audi -
o_id
<>

arch -
_id
<>

cont 0—only archive viewing,


rol<>
1—it is also possible to control (arm/disarm, record)

"ADD_SHOW"—adds cameras on the monitor cam ID of a camera in the settings tree which must be displayed in the
<> monitor

186
Note. See also PLACE_CAM_IN_LAYOUT_CELL
nam Object name which will be displayed in the bottom-left corner
e<>

arch -
_id
<>

cont 0—only archive viewing,


rol<>
1—it is also possible to control (arm/disarm, record)

gate ID of the videogate through which you want to receive video. The
_id corresponding camera must be added and configured in this videogate—
<> see Selecting and configuring the cameras for the Videogate module

slav ID of a computer to which the command is applied


e_id
<>

"ACTIVATE_CAM"—activates camera cam ID of a camera in the settings tree which must be activated
<>

"ARCH_FRAME_TIME"—search for video archive by cam -


date and time <>

date -
<>

time -
<>

mod Can take the following values:


e<>
0—videogate, if it is set (if not set, then the archive of the video
server is searched)
1—sideo server
2—backup archive
10 + Object ID External storage in the Monitor object settings
panel (normally 11)—external storage

"SETUP"—sets parameters of monitor no_ -


upd
ate
<>

over Disable the mode of speed-up displaying


lay<>

x<> Coordinate of top-left corner (0–100)

y<> Coordinate of top-left corner (0–100)

w<> Size in horizontal direction (0–100)

h<> Size in vertical direction (0–100)

max Maximum allowable number of cameras on the monitor


_ca
ms<>

min Minimum allowable number of cameras on the monitor


_ca
ms<>

com -
pres
s<>

pan Show control panel (0—disabled, 1—enabled)


el<>

187
pan -
el_t
ype
<>

s<> -

layo -
ut<>

gate -
<>

map -
_id
<>

ena -
ble<>

top 1—show screen always on top


mos
t<>

type Type of Monitor object


<>

allo Allows moving of window


w_
mov
e<>

arch Archive ID
_id
<>

cycl Delay when auto scrolling (1–20 sec)


e<>

flag Flags
s<>

nam Name of object


e<>

over Enable the mode of speed-up displaying. (0—no speeding-up, 1—“over


lay<> lay mode” speeding-up, 2—“DirectDraw mode” speeding-up)

tel_ Telemetry priority


prio
r<>

gstr If the value is not set, the function for stream auto select is disabled
eam
_ver If the value is minBPS, then the stream for displaying is selected
sion automatically as described in Configuring an auto select of video
<> stream for displaying

"ACTIVATE"—activates control panel of monitor user User ID


_id
<>

pan -
el_a
ctiv
e<>

"DEACTIVATE"—deactivates control panel of monitor - -

"EXPORT_FRAME"—exports frame in a JPG file cam -


<>

file -

188
"KEY_PRESSED"—controls buttons of video num -
surveillance monitor and video records archive ber
<>

cam The ID of the camera to the Video surveillance window of which the
_id command must be applied. If the identifier is not specified, the
<> command is applied to the active Video surveillance window (see Activ
e Surveillance window)

key Possible values:


<>
"ARCH_EDIT_DATE"—change date of search by archive;

"ARCH_EDIT_TIME"—change time of search by archive;

"ARCH_EDIT_ENTER"—enter changes of values in archive;

"ARCH_EDIT_ESCAPE"—cancel editing of archive;

"ARCH_EDIT_BACK";

"ARCH_EDIT_REPLACE";

"WINDOW_ZOOM_IN"—expand window of video surveillance;

"WINDOW_ZOOM_OUT"—hide window of video surveillance;

"ZOOM_IN"—image incoming;

"ZOOM_OUT"—image removal;

"CYCLE_REW"—scrolling video surveillance windows back;

"CYCLE_FF"—scrolling video surveillance windows forward;

"LEFT"—move the frame left in the Zoom mode;

"RIGHT"—move the frame right in the Zoom mode;

"UP"—move the frame up in the Zoom mode;

"DOWN"—move the frame down in the Zoom mode;

"MODE_VIDEO"—video surveillance mode;

"MODE_ARCH"—mode of archive video records playback;

"MODE_ARCH2"—mode of archive video records playback 2;

"MASK_SHOW"—show mask;

"MASK_HIDE"—remove mask;

"ARM"—arm camera;

"DISARM"—disarm camera;

"REW"—rewind;

"PLAY"—play;

"PLAY_NONSTOP"—non-stop playback;

"PLAY_FAST"—speed up video record playback;

"FF"—fast forward;

"RECORD"—record;

"RECORD_MIC"—record from microphone;

"STOP"—stop;

"REC_STOP"—stop record;

189
"PAUSE"—pause;

"MIC_ON"—microphone On;

"MIC_OFF"—microphone Off;

"PRINT"—print the frame;

"SELECT_LAYOUT"—control layout of video surveillance monitor;

"START_CYCLE_FF"—enable automatic forward scrolling of video


surveillance windows. Period of scrolling video images is specified
when configuring the Monitor interface object (see Configuring the
display mode of camera windows);

"STOP_CYCLE"—stop slide show of Video surveillance windows;

"EXPORT_DO"—open the AviExport tool for background export (see Th


e AviExport utility);

"PROTECT_DO"—open the dialog box to create a bookmark (see Creat


e a bookmark);

"PROTECT_VIEW"—show the bookmark list (see List of bookmarks)

190
"START_AVI_EXPORT"—starts video export start Start time
<>
Note. See the examples in Examples with Cameras
and Video surveillance monitors finis End time
h<>

avi_ Path to created file


path
<>

cam Camera ID
<>

"STOP_AVI_EXPORT"—stops video export mon Number of monitor


itor
<>

"START_AVI_SCHEDULE"—starts bookmarks export - -

"STOP_AVI_SCHEDULE"—stops bookmarks export - -

"CONTROL_TELEMETRY"—Telemetry control. cam ID of a camera on which you want to enable or disable the mouse
<> PTZ control
See Mouse PTZ control
on<> 0—disable mouse PTZ control

1—enable mouse PTZ control

"SET_REC_RESTART"—set recording restart when - -


entering the archive

"RESET_REC_RESTART"—reset recording restart - -


when entering the archive

"SET_ARCH_ENTER_PAUSE"—enable playback pause - -


when entering the archive

"RESET_ARCH_ENTER_PAUSE"—disable playback - -
pause when entering the archive.

"DISABLE_TELEMETRY"—disable telemetry control - -


from Video surveillance monitor

"ENABLE_TELEMETRY"—enable telemetry control - -


from Video surveillance monitor

"INCREASE_VIEW"—increase camera window size in cam Camera identifier


the Video surveillance monitor <>

"DECREASE_VIEW"—decrease camera window size in cam Camera identifier


the Video surveillance monitor <>

"SHOW_LAYOUT"—show layout with the specified ID layo Layout ID in database


ut_i
d<>

"GO_LIVE"—switch all cameras on the monitor to live - -


video mode

191
"GO_ARCH"—switch all cameras on the monitor to arch Optional parameter. Sets the time position in the archive in the DD-
archive mode _tim MM-YY HH:MM:SS format. By default, the archive is positioned on the
e<> last record

"SAVE_AS"—export selected archive fragment - -

PLACE_CAM_IN_LAYOUT_CELL—add camera to the cam ID of a camera in the objects tree which must be displayed in the
specific cell on the specific layout on the Monitor <> monitor. If the parameter value is incorrect, for example, 0 or -1,
then the corresponding cell will be hidden

layo ID or name of the layout to add camera on


ut_n
ame
<>

cell The number of the cell on the layout to which the camera must be
<> added. Cells are numbered from top to bottom left to right, starting
from the top-left corner of the layout.

Attention! Cells are numbered starting from 0.

If some other camera has already been added to the specified cell, it
will be replaced

SET_TITLES—shows captions over a video image in cam The ID of a camera to the Video surveillance window of which the
any display mode. Such captions are not archived <> command must be applied
and are displayed until CLEAR_TITLES command is
applied or Monitor is reset title The caption text that must be displayed. Use '\r' to break the line
s<>

title Captioner ID
_id
<>

CLEAR_TITLES—disable the captions created with the cam The ID of a camera to the Video surveillance window of which the
help of the SET_TITLES command <> command must be applied

title Captioner ID
_id
<>

Properties of the MONITOR object are displayed in the table.

Properties of the MONITOR object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

192
MACRO Macro
The MACRO object corresponds to the Macro system object.

The MACRO object sends events presented in the table. Procedure is started when the corresponding event occurs.

E Descri Para Parameter description


v ption met
e ers
nt

R Action src_ The name of the computer on which the macro was executed.
UN is send
perfor er<> Note. The value of this parameter is displayed in the Add. info column of the Event Viewer in real time. When Axxon PSIM is
med restarted and event log records are loaded from the database, this information is not displayed in the interface, but remains in
the database

user The identifier of the user who executed the macro.


_id<>
Note. The value of this parameter together with the username is displayed in the Add. info column of the Event Viewer in real
time. When Axxon PSIM is restarted and event log records are loaded from the database, this information is not displayed in
the interface, but remains in the database

List of commands and parameters for the MACRO object is presented in the following table:

Command—command description Parameters Description

"RUN"—performs an action - -

"SETUP"—sets parameters for a macro name<> Object name

flags<> Flags

state<> Object state

hidden<> «Hidden» flag

local<> «Local» flag

Properties of the MACRO object are shown in the table.

Properties of the MACRO object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

The MACRO object can be in the following states:

State of the MACRO object Description

"NORM" Normal

193
SLAVE Computer
The SLAVE object corresponds to the Computer system object.

The SLAVE object sends events presented in the table. Procedure is started when the corresponding event occurs.

Events Descriptio Comment


n

CONNE Connecting Event is generated when a Client is connected to the Server


CTED

DISCO Disconnecti Event is generated when a Client is disconnected from the Server
NNECT ng
ED

KEY_I Key Event is generated if codes of cards (or HID) in the key mismatch to current codes of computer
GNORE ignored
D_HW (mismatch
of card
codes)

KEY_I Key Event is generated if there software limitations. For example, if key is accepted but number of created
GNORE ignored objects in the objects tree is more than specified in the key
D_SW (limitation
exceeded)

KEY_U Key
PDATED updated

PROTO Protocol
COL_R received
CVD

REBUI Start of
LD_IN archive re-
_START indexing

REBUI End of
LD_IN archive re-
_STOP indexing

REGIS Attempt of
TER_A unauthorize
TTEMPT d access

REGIS Limit of Event is generated when user failed to enter the system a lot of times. Some timeout is started after the
TER_E access event when user can’t try to enter the system. Number of attempts and timeout can be changed using
RROR attempts is registry
exceeded

REGIS User This event is generated when user tries to enter the system (when entering login and password)
TER_U registration
SER

DISC_ Disk for


EXIST archive
record
exists

NO_DI There is no
SC disk for
archive
record

KEY_I Key ignored Event is generated in case of key file is not recorded on the disc
GNORE
D_FR

SHUTD Shutdown
OWN

194
DISC_ Disc
MOUNT connected
(mounted)

DISC_ Disc
UNMO disconnecte
UNT d
(unmounted)

ARCHI Archive Event is generated at midnight and contains information about archive depth on all disks in hours (the
VE_DE depth depth<> parameter). To call the event manually, use the GET_DEPTH reaction.
PTH
Archive depth in the Days:Hours format is specified in the Additional information field of the Event Viewer
when displaying an event. Also this information contains in parameter of the param0<> event.

Archive depth is counted as discrepancy between date of creation the oldest archive file and date of creation
the newest archive file (on disk or by camera)

FORCE Forced The event is generated before the forced unload of Axxon PSIM, for example, if the Guardant security key is
D_OFF offload removed. Unload is performed after the action caused it (for example, removing the Guardant key) after the
time specified by the UnloadDelay registry key—see Registry keys reference guide

DEACT Hide all The event is generated when Hide all command is executed on a computer set in slave<> parameter. If
IVATE displays except<> parameter is present, all displays except the one specified in this parameter are hidden
_ALL_
DISP

LIC_EX License Not generated by default. Set NotifyExpireLic = 1 to enable (see Registry keys reference guide).
PIRATI expires in
ON The days<> parameter shows the number of days left till license expiration (can be non-integer). The event
is generated at Axxon PSIM start-up and when the day changes

DATAB Database The event is generated when the connection to SQL Server is lost the first time it is accessed after the
ASE_E connection disconnection
RROR lost

SCRIP Script By default, the event is not generated, since it is not added to the [Link] external settings file. In order for
T_ERR execution the SCRIPT_ERROR event to be generated and added to the PROTOCOL table, it must be added to the psim.
OR failed ddi table (see Editing the external setting file (Axxon [Link]) using the [Link] utility)

List of commands and parameters for the SLAVE object is presented in the following table:

Command—command description Pa Description


ra
me
ters

"SETUP"—set parameters for a computer dis Display ID


pla
y_i
d<>

dri Disks for record of video archive


ves
<>

dri Disks for record of audio information


ves
_a
<>

fla Flags
gs
<>

arc Size of event archive


h_
day
s<>

195
con Connection
nec
tio
n<>

dis Disable protocol


abl
e_
pro
toc
ol<>

ip_ IP-address of device


ad
dre
ss
<>

is_ Backup
bac
ku
p<>

is_l Loaded
oad
<>

loc Local protocol


al_
pro
toc
ol<>

mo Modem connection
de
m<>

na Object name
me
<>

pas Password
sw
ord
<>

syn Time synchronization


c_ti
me
<>

use User name


rna
me
<>

"BACKUP"—backup database - -

"CONNECT_ONE"—connect to a computer. Connects the corresponding computer. It - -


is recommended to avoid using of this reaction manually

"CONNECT_OTHER"—connect to cores. Connects computer to other cores from - -


configuration. It is recommended to avoid using of this reaction manually

"DISCONNECT_ONE"—disconnect from computer. Disconnects the corresponding - -


computer. Core can be connected automatically in case of disconnection. It is
recommended to avoid using of this reaction manually

"SYNC_PROTOCOL"—run [Link] utility of protocol synchronization. - -


Protocol merging is happened if synchronization is configured

196
"SYNC_TIME"—synchronize time. To perform this reaction it is required to create - -
SyncTime parameter with value 1 on the system to which reaction was addressed in
the HKEY_LOCAL_MACHINE\SOFTWARE\AxxonSoft\PSIM
(HKEY_LOCAL_MACHINE\Software\Wow6432Node\AxxonSoft\PSIM registry section
for 64-bits system)

"CREATE_PROCESS"—run process co Command line. Commands of Windows


m command line written without hyphens
ma through |, & or && separating
nd characters
_lin
e<>

"SEND_MY_CONFIG"—send configuration. Send configuration to other computers. - -


The same as “SPREAD_CONFIG”

"MOVE_CONFIG"—move configuration. Moves configuration created in the objects fro Supplier


tree on the basis of the computer–supplier to the computer–recipient m<>

to<> Recipient

"SPREAD_CONFIG"—spread configuration. The same as “SEND_MY_CONFIG” - -

"GET_DEPTH"—get archive depth. The ARCHIVE_DEPTH event (see table below) is ca Camera ID for which archive depth is
formed in response to reaction in system. Absence of one or both parameters m<> required
concedes request of depth by records for all values of parameter
dri Disk or network path on which archive
ve depth is required.
<>
Name of disk is specified in the
following format: "<letter of disk>:\\",
for example drive<D:\\>

Note. The "\" symbol is an escape


character.

Network path is specified in the UNC


format

"ACTIVATE_DISPLAY"—change the display. The command allows showing the Display dis The identifier of the corresponding Dis
with the given identifier on the monitor (monitors) of the computer pla play object. If an empty value is
y_i passed to the parameter, then all
d<> displays are hidden when running this
command

Properties of the SLAVE object are shown in the table.

Properties of the SLAVE object Description

ID<> Object ID

PARENT_ID<> Parent object ID

USER_ID<> User ID

197
DISPLAY Display
The DISPLAY object corresponds to the Display system object.

The events presented in the table come from the DISPLAY object. Procedures are run when the corresponding event occurs.

Event Description

ACTIVATE Display is activated

DEACTIVATE Display is deactivated

ACTIVATED Display is activated on the remote computer. The computer name is transferred in the param0 <> parameter

List of commands and parameters for the DISAPLY object is presented in the following table:

Command—command Parameters Description


description

ACTIVATE—show display macro_slave_id<> Name of a computer on which display must be shown

DEACTIVATE—hide display macro_slave_id<> Name of a computer on which display must be hidden

Note

If the "macro_slave_id" parameter is not set, the command will be performed for all computers in the system.

Properties of the DISPLAY object are shown in the table.

Properties of the DISPLAY object Description

flags Flags

id Object ID

name Object name

parent_id Parent object ID

198
PLAYER Audio player
The PLAYER object corresponds to the Audio player system object.

List of commands and parameters for the PLAYER object is presented in the table.

Command—comma Parame Description


nd description ters

"PLAY_WAV"—plays file<> Full path to the audio file in the .wav format (with the name of the file being played back. For
back the audio file example: C:\Program Files (x86)\Axxon PSIM\Wav\cam_alarm_1.wav)

from_m Response flag of the audio file being played back. The response is sent from the macro
acro<ID> (specifying the ID of the existing macro, ID > 0).

Note. The parameter isn't mandatory if the voice notification channel is configured in the Audio
player object interface (see Setting up the voice notification using Audio player object)

"SETUP"—sets the board<> Sound unit of the archive player


audio player
parameters flags<> Flags

h<> Height of settings dialog (0–100)

name<> Object name

voice<> Sound notification

voice_b Sound unit of notification


oard<>

w<> Width of settings dialog (0–100)

x<> Left top corner of settings dialog (0–100)

y<> Left top corner of settings dialog (0–100)

"STOP_WAV"—stops - -
audio file playback

Properties of the PLAYER object are given in the following table.

Properties of the PLAYER object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

199
CORE
The CORE object is the core of the system, a global static object that implements methods used to control the state and manage
system objects of Axxon PSIM. The extended possibilities for working with the CORE object are given when using scripts in the JScript
programming language—see The Script object. Programming using the JScript language.

The CORE object sends events presented in the table.

Eve Description
nt

DO_ Event triggers the reaction of some object in the system. The action parameter of this event contains a description of the
REA action that must be performed. Examples of values of the action parameter:
CT
SET_MARKRECT—sent when a face is recognized on the video image;

DEL_MARKRECT—sent when a face disappears from the video image.

Other event parameters may also be present that can be monitored using the Debug window (see The Debug window). If the
value of the is SET_MARKRECT, then the param5_val parameter contains the number of the camera on which the face was
detected in the video image. This is indicated by the name of the parameter forwarded in the param5_name parameter.

For the DEL_MARKRECT value, the number of the camera is forwarding in the param0_val parameter

SLA Event is generated when Failover service becomes active. It consists of the following parameters:
VE_
CHA old_slave_id—ID of the Computer object from which cameras are transferred
NGED new_slave_id—ID of the Computer object to which cameras are are transferred
CAM<n1, n2, ... >—where n1, n2, and so on are IDs of cameras transferred to another Computer parent object. For
example, CAM<4,6,7>—transfer cameras with IDs 4, 6, 7

CRE Event triggers creation of an object. Parameters:


ATE
_OB objtype<>—object type, for example, objtype<PERSON> for user creation
JECT parent_id<>—identification number of the parent object
service_photo<>—when a user is created, the base64-encoded binary image of user photo can be put to this parameter.
This is necessary for adding user photo immediately whet creating user in Access Manager

200
MAP Map
The MAP object corresponds to the Map system object.

The MAP object sends the events presented in the table. The procedure is started when the corresponding event occurs.

Event Description

LAYER_ACTIVA Layer activation. This event is received when a layer is selected on the Map. The obj_id<> parameter has the ID
TED of the activated layer

ACTIVATE_OBJ Object activation. The event is received when an object is selected (activated by mouse click) on the Map.
ECT
Parameters:

1. obj_type <>—object type


2. user_id<>—user ID
3. module<>—module name, for the Map—[Link]
4. date<>—date when the event occurred
5. time<>—time when the event occurred
6. slave_id<>—computer network name
7. obj_id <>—object ID
8. layer<>—Map layer ID
9. fraction<>—millisecond when the event occurred
10. owner<>—user who activated the object
11. type_of_display <>—object display type, possible values:
a. IMAGE—image
b. IMAGE_AND_INDICATOR—image and indicator
c. TEXT—text
d. LINE—line
e. POLYGON—polygon
f. ELIPSIS—ellipse
g. TITLE—the name of the object

OBJDBLCLK The event is received when you double click an object on the Map. Contains the same parameters as ACTIVATE_OB
JECT

The list of commands and parameters for the MAP object is presented in the table.

Command Para Description


mete
rs

SET_TOPMOST—Se - -
t topmost

SET_NOTOPMOST - -
—Cancel topmost

HIDE_OBJECT—Hid objty Object type. Can be left blank. If the object type is not set, then objects of all types are hidden/shown
e/show object icon pe<>
on the map
objid Object ID. Can be left blank. If the object ID is not set, then all objects of the specified type are
<> hidden/shown

hide 0—objects are shown on the map


<>
1—objects are hidden on the map

SET_OBJECT_GEO objty Object type


METRY—Set object pe<>
location on the map
objid Object ID
<>

x<> New coordinate of the top left corner of the object icon on the map layer along the X axis in pixels

y<> New coordinate of the top left corner of the object icon on the map layer along the Y axis in pixels

201
exclu By default, when using the SET_OBJECT_GEOMETRY reaction, when moving the object icons, the
de_c names of these objects (child objects) also move. If you pass the exclude_children <1> parameter in
hildre the reaction, then the object is moved separately from the children, that is, without their names
n<>

INSCRIBE—Inscrib - -
e to window

SHOW_MINIMAP x<> The coordinate of the top left corner of the minimap along the X axis in pixels
—Show a minimap
y<> The coordinate of the top left corner of the minimap along the Y axis in pixels

w<> Width of the minimap in pixels

h<> Height of the minimap in pixels

moni Monitor ID
tor<>

slave Computer network name


_id<>

SET_ZOOM—Chang zoom Map scale ratio


e the Map scale <>

ACTIVATE_OBJECT obj_t Object type


—Activate object on ype<>
the Map
obj_i Object ID
d<>

layer Map layer ID. If the parameter is set, the script will work on the specified layer. If the parameter is
<> not set, the scrip will work on the current layer

DRAW_ARROW— first_ Type of the object from which a track will be made
Draw a track of obj_t
movement between ype<>
objects
first_ ID of the object from which a track will be made
obj_i
d<>

secon Type of the object to which a track will be made


d_obj
_type
<>

secon ID of the object to which a track will be made


d_obj
_id<>

obj_id ID of the created track


<>

title_ Text that will be displayed next to the track. \n is used for line break.
text<>
Additional optional parameters:

title_text_align—shift of the text. 0—text is displayed in the center, 1—at the beginning of the
track, 2—at the end of the track
title_text_size—size of the text
title_shift_by_y—shift down of the text (may be needed when using title_text_size). Default is 40
pixels
title_text_color—color of the text in Decimal format
title_text_font—font of the text

Example:

title_text<Object is moving\nto the exit>,title_text_align<1>,title_shift_by_y<60>,


title_text_color<16711935>,title_text_size<18>,title_text_font<Algerian>

202
ERASE_ARROW— obj_id ID of the track that must be erased. If you don't specify the parameter, all tracks will be erased
Erase a track of <>
movement between
objects

Features of the DRAW_ARROW command execution:

1. When executing the command, a track will be displayed on each layer of the Map as arrows between the objects.
2. If the objects are located on the same layer, the arrow is drawn directly between the specified objects. If the objects are
located on different layers, the arrow is drawn by the shortest path.
3. You can limit the depth of searching for connections between layers to make a track with the DrowArrowSearchDepth key, see
Registry keys reference guide.
4. If
a. it isn't possible to make a track,
b. one of the objects doesn't exist,
c. it is possible to make a track, but the arrows cannot be displayed,

then the icon will be displayed on the first object, and the icon will be displayed on the second object.

203
OLXA_LINE Microphone
The OLXA_LINE object corresponds to the Microphone system object.

The OLXA_LINE object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Description

ACCU_START Sound activated recording is on

ACCU_STOP Sound activated recording is off

ARM Recording is on

DISARM Recording is off

INCOMING_NUMBER Incoming telephone number

OUTGOING_NUMBER Outgoing telephone number

REC Start of recording

REC_STOP End of recording

RESET Microphone connecting

List of commands and parameters for the OLXA_LINE object is presented in the following table:

Command—command description Parameters Description

"ARM"—microphone is recording - -

"DISARM"—microphone isn't recording - -

"SETUP"—sets microphone parameters type<> Type of line

accu_start <> Sound detection threshold

accu_stop<> Holding time of detection triggering

amp<> Amplification

aru<> Automatic amplification control

aru_dyn<> Level of AGC

aru_time<> AGC attack time

chan<> Number of microphone sound channel

compression<> Type of compression

flags<> Flags

name<> Object name

rec<> Start of recording

Properties of the OLXA_LINE object are given in the table.

Properties of the OLXA_LINE object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

The OLXA_LINE object can be in the following states:

State of the OLXA_LINE object State description

"BLUE" Microphone disarmed

204
"GREEN" No signal from microphone

"YELLOW" Microphone armed

"RED" Start of recording

205
TELEMETRY PTZ device
The TELEMETRY object corresponds to the PTZ device system object.

The TELEMETRY object sends events presented in the table. The procedure is started when the corresponding event occurs.

Event Description Comment

LOCKED Locked Event is received after the LOCK command (see the table below)

UNLOCKED Unlocked Event is received after the UNLOCK command (see the table below)

List of commands and parameters for the TELEMETRY object is presented in the following table:

Command—command description Pa Description


ra
me
ters

AUTOFOCUS_ON—enable autofocus tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

AUTOPAN_END_P—specify the end point of tel Priority (1—low, 2—medium, 3—high)


autopan _pr
ior
<>

AUTOPAN_START—start autopan tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

AUTOPAN_START_P—specify the start point of tel Priority (1—low, 2—medium, 3—high)


autopan _pr
ior
<>

AUTOPAN_STOP—stop autopan tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

CLEAR_PRESET—clear the selected preset tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

pre Preset
set
<>

D2OFF—disable the additional dynamic settings tel Priority (1—low, 2—medium, 3—high)
for Panasonic PTZ video cameras used to _pr
increase the quality of analog video signal ior
<>

D2ON—enable the additional dynamic settings tel Priority (1—low, 2—medium, 3—high)
for Panasonic PTZ video cameras used to _pr
increase the quality of analog video signal ior
<>

DOWN—rotate video camera lens down tel Priority (1—low, 2—medium, 3—high)
_pr
ior
<>

206
FOCUS_IN—zoom in tel Priority (1—low, 2—medium, 3—high)
_pr
ior
<>

FOCUS_OUT—zoom out tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

FOCUS_STOP—stop zooming in/out of image tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

GO_PRESET—rotate video camera to the position tel Priority (1—low, 2—medium, 3—high)
specified on the preset _pr
ior
<>

pre Preset
set
<>

HOME—rotate video camera to the initial (home) tel Priority (1—low, 2—medium, 3—high)
position _pr
ior
<>

IRIS_CLOSE—close diaphragm tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

IRIS_OPEN—open diaphragm tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

IRIS_STOP—stop diaphragm tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

LEFT—rotate video camera lens to the left tel Priority (1—low, 2—medium, 3—high)
_pr
ior
<>

LEFT_DOWN—rotate video camera lens to the tel Priority (1—low, 2—medium, 3—high)
left and down _pr
ior
<>

LEFT_UP—rotate video camera lens to the left tel Priority (1—low, 2—medium, 3—high)
and up _pr
ior
<>

PATROL_LEARN—start procedure of patrol tel Priority (1—low, 2—medium, 3—high)


programming performed by recording the video _pr
camera actions ior
<>

PATROL_PLAY—start patrolling tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

207
PATROL_STOP—stop patrolling tel Priority (1—low, 2—medium, 3—high)
_pr
ior
<>

RIGHT—rotate video camera lens to the right tel Priority (1—low, 2—medium, 3—high)
_pr
ior
<>

RIGHT_DOWN—rotate video camera lens to the tel Priority (1—low, 2—medium, 3—high)
right and down _pr
ior
<>

RIGHT_UP—rotate video camera lens to the right tel Priority (1—low, 2—medium, 3—high)
and up _pr
ior
<>

SET_PRESET—record the current position of tel Priority (1—low, 2—medium, 3—high)


video camera to the selected preset _pr
ior
<>

pre Preset
set
<>

STOP—stop video camera lens rotation tel Priority (1—low, 2—medium, 3—high)
_pr
ior
<>

UP—rotate video camera lens up tel Priority (1—low, 2—medium, 3—high)


_pr
ior
<>

SETUP—set up PTZ device add Device address


res
s<>

ca Camera ID to control
m<>

flag Flag of object operating (0—ON, 1—OFF)


s<>

na Object name of PTZ device


me
<>

spe Speed
ed
<>

SEND_BUFFER—send command to COM port in buf Command in the hexadecimal format


the hexadecimal format fer
<>

par ID of Telemetry Controller parent object. The required parameter


ent
_id
<>

tel Priority (1—low, 2—medium, 3—high). The value of the parameter must
_pr be greater than 0
ior
<>

208
LOCK—lock. Switch the telemetry over to the tel Priority (1—low, 2—medium, 3—high). The value of the parameter must
LOCKED state for a specified time _pr be greater than 0. It is forbidden to perform control commands with a
ior lower priority than the specified during the lock time
<>

dur Lock duration. If the parameter is not specified, the lock is valid until the
atio UNLOCK command is executed
n<>

UNLOCK—unlock. Switch the telemetry over to - -


the UNLOCKED state for a specified time

AUTOFOCUS_OFF—disable autofocus tel Priority (1—low, 2—medium, 3—high).


_pr
ior
<>
To use this command, you must add it to the Reactions tab for
the TELEMETRY object in [Link] (see The Reactions tab)

Properties of the TELEMETRY object are shown in the table.

Properties of the TELEMETRY object Description of the object properties

ID<> Object ID of the PTZ device

PARENT_ID<> Parent object ID

The TELEMETRY object can be in the following states:

State of the Description of the object state


TELEMETRY object

LOCKED—locked Control of telemetry is locked with some priority. It is forbidden to control telemetry with a priority lower
than the specified when locking (see the table above)

UNLOCKED—unlocked It is allowed to control telemetry with any priority

209
TELEMETRY_EXT Keyboard
The TELEMETRY_EXT object corresponds to the Keyboard system object.

The TELEMETRY_EXT object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Description Para Description of Value range


of event meter parameter

KEY_PR Key is param Code of pressed key See Installing and configuring security system components guide
ESSED pressed 0<>

device Device on which key is 0—AXIS T8312 main keyboard


<> pressed
1—AXIS T8313 keyboard

KEY_REL Key is param Code of released key 0..21 for AXIS T8312.
EASED released 0<>
For BOSCH KBD-Digital, BOSCH KBD-Universal and Panasonic WV-CU950 see Installi
ng and configuring security system components guide

device Device on which key is 0—AXIS T8312 main keyboard


<> released
1—AXIS T8313 rotary switch

MOVED Position is param Bias value For wheel of JogDial rotary switch -1.. 1; for wheel of frame-by-frame scrolling
changed 0<> Shuttle -7..7

For keyboard Panasonic WV-CU950 JogDial -1.. 1; Shuttle -6..6

device Type of used control 0—wheel of rotary switch,


<> mechanism AXIS T8313
1—wheel of frame-by-frame scrolling

List of commands and parameters for the TELEMETRY_EXT object is presented in the following table:

Command—command description Para Description


mete
rs

"DRAW_FIGURE"—draw a figure on display of displa 0x00—main display, 0x01—status display


BOSCH KBD-Digital or BOSCH KBD-Universal t y<>
elemetry panel
x1<> Start coordinate on X axis (from 0 to 127 for main display, from 0 to 121
for status display)

y1<> Start coordinate on Y axis (from 0 to 239 for main display, from 0 to 31 for
status display)

x2<> End coordinate on X axis (from 0 to 127 for main display, from 0 to 121 for
status display)

y2<> End coordinate on Y axis (from 0 to 239 for main display, from 0 to 31 for
status display)

is_fill 0—do not fill the figure, 1—fill the figure


<>

is_set 0—remove figure from display, 1—draw figure


_pixel
s<>

figure 0—line, 1—rectangle


<>

"PRINT_TEXT"—print text on display of BOSCH displa 0x00—main display, 0x01—status display


KBD-Digital or BOSCH KBD-Universal telemetr y<>
y panel
x<> Coordinate on X axis (from 0 to 127 for main display, from 0 to 121 for
status display)

y<> Coordinate on Y axis (from 0 to 239 for main display, from 0 to 31 for
status display)

210
chars Coding:
et<>
0—Latin

1—Cyrillic

2—Central European

style Style:
<>
0—Normal

1—Semi-bold

text Test message


<>

"PRINT_TEXT"—print text on display of Panaso y<> 0—display text on the first line
nic WV-CU950 telemetry panel
1—display text on the second line

text<> Displayed text of a line, maximum 20 characters

flicke Line consists of 6 characters determining parameters of text flashing: d1 d2


ring<> d3 d4 d5 d6

d1 determines period of flashing :

0—flashing disabled

1—period 0.25 sec, character is replaced by white space

2—period 0.5 sec, character is replaced by white space

3—period 0.75 sec, character is replaced by white space

4—period 1 sec, character is replaced by white space

5—period 0.25 sec, character is replaced by dark space

6—period 0.5 sec, character is replaced by dark space

7—period 0.75 sec, character is replaced by dark space

8—period 1 sec, character is replaced by dark space

d2: 1—characters from 1 to 4 are flashing, 0—these character are not


flashing

d3: 1—characters from 5 to 8 are flashing, 0—these characters are not


flashing

d4: 1—characters from 9 to 12 are flashing, 0—thesecharacters are not


flashing

d5: 1—characters from 13 to 16 are flashing, 0—these characters are not


flashing

d6: 1—characters from 17 to 20 are flashing, 0—these characters are not


flashing

"CLEAR_DISPLAY"—clear display of BOSCH displa 0x00—main display, 0x01—status display


KBD-Digital or BOSCH KBD-Universal telemetr y<>
y panel.

Reaction without parameters for the Panasonic


WV-CU950 telemetry panel

"RELE_ON"—turn on the light on the AXIS rele<> Code of key with the light, 12..16 for AXIS T8312.
T8312 keyboard or Panasonic WV-CU950
panel For Panasonic WV-CU950 see Installing and configuring security system
components guide, section Features of Panasonic WV-CU950 control panel
configuration and operation

211
"RELE_OFF"—turn off the light on the AXIS rele<> Code of key with the light, 12..16
T8312 keyboard or Panasonic WV-CU950
panel

"RESET"—reset of Panasonic WV-CU950 panel type 0—instant reset


<>
1—reset after 100 ms

2—reset after 200 ms

3—reset after 500 ms

4—reset after 1 s

"SET_ALARM"—set type of alarm signal of the audio 0—sound is off


Panasonic WV-CU950 panel _alar
m<> 1—simple single alarm signal

2—simple double alarm signal

3—simple triple alarm signal

4—single alarm signal lasting 0.1 sec

5—single alarm signal lasting 0.2 sec

6—single alarm signal lasting 0.3 sec

7—single alarm signal lasting 1 sec

8—simple single tone

9—simple double tone

A—simple triple tone

B—single signal lasting 0.1 sec

C—single signal lasting 0.2 sec

D—single signal lasting 0.3 sec

E—single signal lasting 1 sec

F—alarm signal

212
JOYSTICK Control device
The JOYSTICK object corresponds to the Control device object.

The JOYSTICK object sends the events presented in the table. The procedure is started when the corresponding event occurs.

Events Parameter Parameter description

"KEY_PRESSED"—The key is pressed button<> Key code

cam<> Camera ID

param0<> Name of the Remote Client to which the device is connected

213
TIME_ZONE Time zone
The TIME_ZONE object corresponds to the Time zone system object.

The TIME_ZONE object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Descriptio
n

ACTIVATE Start

DEACTIVATE End

List of commands and parameters for the TIME_ZONE object is presented in the following table:

Command—command description Parameters Description

"SETUP"—set parameters for time zone name<> Object name

flags<> Flags

Properties of the TIME_ZONE object are shown in the table.

Properties of the TIME_ZONE object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

The TIME_ZONE object can be in the following states:

State of the TIME_ZONE object Description

"ACTIVATE" Active

"INACTIVE" Inactive

214
ARCH Backup archive
The ARCH object corresponds to the Backup archive system object.

The ARCH object sends events presented in the table. Procedure is started when the corresponding event occurs.

Events Description Comment

ACTIVE Backup archive is active Event is generated when a list of cameras, the video from which is archived, corresponds to
the list of Backup archive configuration

INACTIVE Backup archive is Event is generated when archiving via Backup archive is not performed.
inactive

ACTIVE_ Partial operation of Back Event is generated when archiving is enabled not for all cameras specified in the list of Backup
PART up archive archive.

215
FAILOVER Failover service
The FAILOVER object corresponds to the Failover service object.

Events from the FAILOVER object are given in the table. Procedure is started when the corresponding event occurs.

Event Description

START Objects are moved to a backup Server

STOP Objects are returned to the main Server

The list of commands and parameters for the FAILOVER object is presented in the table below:

Command—command description Comment

FORCED_START—forced transfer of the main The reverse configuration transfer is performed using the FORCED_STOP
Server configuration to the backup Server command or upon restarting/reconnecting the main Server

FORCED_STOP—forced transfer of the backup


Server configuration to the main Server

216
OPERATORPROTOCOL Operator protocol
The OPERATORPROTOCOL object corresponds to the Operator protocol system object.

Find events from the OPERATORPROTOCOL object in the table. Procedures are started when the corresponding event occurs.

Event Event description Event parameters

ACTIVAT Operator left-clicked the event cell in the Opera


E_LEFT tor protocol

ACTIVAT Operator right-clicked the event cell in the Ope


E_RIGHT rator protocol

POSTPO Operator clicked the Delay button


NE_PRE
SSED

CREATE Operator clicked the Create button on the Crea The user_id<> parameter contains the user ID. The initial_date<> and
_REPORT te report tab final_date<> parameters specify the initial and final dates selected in
the interface

RESPON Operator clicked the Alarm situation button objtype<>—Object type


SE_ALA objid<>—Object ID
RM action<>—Name of the event in the database
alarm_time<>—Time when the alarm occurred
RESPON Operator clicked the Suspicious situation butt
SE_SUS on
PECT

RESPON Operator clicked the False alarm button


SE_FALSE

ACTIVAT Focusing on the event: click the event in the


E_EVENT interface or jump to the required event using
the keyboard

The list of commands and parameters for the OPERATORPROTOCOL object is given in the table.

Command—command description Parameters Parameter description

DEL_ALARM—delete an alarm objtype<> Object type (for example, CAM, GRELE, and so
on)

objid<> Object ID

options<> Possible values:

first—delete first alarm


last—delete last alarm
all or blank—delete all alarms

HIDE_BUTTON – hide the buttons used to assign status to an button<> Names of the buttons separated by comma:
event
alarm—Alarm situation
suspicious—Suspicious situation
false—False alarm

Example of setting a parameter:

button<alarm,suspicious,false>

hide<> 1—hide the buttons listed in the button parameter

0—show the buttons listed in the button


parameter

objtype<> Object type

objaction<> Event type

217
objid<> Object ID

218
EVENT_VIEWER Event Viewer
The EVENT_VIEWER object corresponds to the Event Viewer system object.

The EVENT_VIEWER object sends events given in the table. Procedure is started when the corresponding event occurs.

Description of events of the EVENT_VIEWER object.

Events Description

SHOW_O The operator selected the "Display on the map" command


N_MAP

SHOW_VI The operator selected the "Display video" command


DEO

SHOW_R The operator selected the "Show report" command


EPORT

CREATE_ Generated if the GenerateEventInsteadOfReport registry key is set to 1 and the operator selected the "Show report"
REPORT command. The report does not open. See also Registry keys reference guide

List of commands and parameters for the Event Viewer object is presented in the following table:

Command—command Paramet Description of parameters


description ers

UPDATE_VIEW—set general bk_color General background color in x16 format


background and/or text color <>
in the Event Viewer interface
window defclr<> General text color in x16 format

"SET_FILTERS"—activate the filter0<>, The name of the filter created in the Event Viewer. If you need to specify several filters,
Event Viewer filter filter1<>, then the parameter numeration (0, 1, 2, etc.) must go in order starting with filter0<>.
filter2<>, Note that the numbers should not be skipped. See Examples of scripts with Event
etc. Viewer

219
GATE Videogate
The GATE object corresponds to the Videogate system object.

The GATE object sends events presented in the table. Procedure is started when the corresponding event occurs.

Events Description Comment

GATE_LOW_ Input speed on the gate is


FPS reduced

ACTIVE Gate is active Event is generated when the list of working cameras corresponds to the list of the
Videogate configuration

INACTIVE Gate is inactive Event is generated when there are no requests for video streams through the
Videogate

ACTIVE_PART Partial operation of gate Event is generated when the number of working cameras is less than in the Videogate
list

The list of commands and parameters for the GATE object is presented in the table.

Command—command Parameters Parameter description Features


description

START_VIDEO—enable camera cam<> Identifier of the camera by The commands work even if the Monitor doesn't display the
video stream and start writing to which it is necessary to start selected camera.
the archive or stop recording
The commands work if constant recording and active camera
STOP_VIDEO—stop camera recording is enabled in the Videogate—see Configuring the
video stream and stop writing to recording to the Videogate archive
the archive

220
CAM_VMDA_DETECTOR VMDA detection
The CAM_VMDA_DETECTOR object corresponds to the VMDA detection system object.

The CAM_VMDA_DETECTOR object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Description Parame Parameter description


ter

ALARM Alarm native_t To enable this parameter, set the following registry keys: [Link], VMDA.
ype<> determineGivenTaken, [Link] (see Registry keys reference guide).

Available values:

-1—unknown object type (initial state)

0—other

1—human or group of people (depending on the native_value<> parameter: if 1, human; if >1, group of
people)

2—car

3—noise

4—object carried into the area

5—object carried out of the area

native_v To enable this parameter, set the following registry keys: [Link], VMDA.
alue<> determineGivenTaken, [Link] (see Registry keys reference guide).

People counter for the "human" object type. Allows determining the quantity of people in the group. For
other object types it is equal to -1

param0<> String value containing the event parameters from the VMDA detection

ALARM End of alarm


_END

ARMED VMDA detection


is armed

DISAR VMDA detection


MED is disarmed

List of commands and parameters for the CAM_VMDA_DETECTOR object is presented in the following table:

Command—command description Parameters Description

ARM—arm detection - -

DISARM—disarm detection - -

Note

If cameras are connected using ONVIF Server, the events from the VMDA detection and other smart detection tools will be
transferred as events from embedded detection tools—see CAM_IP_DETECTOR Embedded detection.

221
TITLEVIEWER Captions search
The TITLEVIEWER object corresponds to the Captions search system object.

The events given in the table come from the TITLEVIEWER object. Procedures are started when the corresponding event occurs.

Event Event Paramete Parameters description Comment


description rs

GO_VID Video request <cam> The ID of the camera where the captions The event is generated when left double-clicking the
EO were found search result line

<date> Date

<time> Time

222
PERSON User
The PERSON object corresponds to the User system object.

The events presented in the table come from the PERSON object. Procedures are started when the corresponding event occurs.

Event Description

REGISTERED User logs in to the system

UNREGISTERED User logs out of the system

223
CAM_FACECAPTURE Face Detection
The CAM_FACECAPTURE object corresponds to the Face Detection system object.

The CAM_FACECAPTURE object sends the events presented in the table below. The procedure is started when the corresponding
event occurs.

Events Events description

FACE_DETECTED Face is captured

FACE_LEAVE Face is lost

The list of parameters for the CAM_FACECAPTURE object is presented in the table:

Parameters Parameters description

owner The name of the server where the face was captured/lost

fraction The millisecond when the face was captured/lost

module The module where the face is captured

date The date when the face was captured/lost

guid_pk The event ID (generated randomly for each event)

core_global Distribute to all cores (notify all)

guid The captured/lost face ID (generated randomly for each event)

time The time when the face was captured/lost

param0 Same as the guid parameter. Used to display the information in the "Add. info" column of the Event Viewer

224
IPSTORAGE Edge storage
The IPSTORAGE object corresponds to the Edge storage system object.

The list of parameters and commands for the IPSTORAGE object is presented in the table:

Command—description Para Parameter description Comment


met
er

IMPORT—import of the missing part of the cam Camera ID The command is used if automatic import for the Edge storage
archive for the specified period <> was not successful.

datet Date and time to start import Note. If import is performed at the time of sending the
ime_ from in the following format: reaction, the command will not be executed. To abort the
from <DD-MM-YY HH:MM:SS> current import task, first send the UPDATE_TIME command
<>

datet Date and time to end import


ime_ on in the following format:
to<> <DD-MM-YY HH:MM:SS>

UPDATE_TIME—stop synchronization and cam Camera ID The command is used to stop the current import task and
set the time of the last import from the <> execute the IMPORT command to synchronize the specified
edge storage in the [Link] file archive period
datet Date and time of the last
ime<> synchronization to be set in
the [Link] file

225
CAM_TITLE Captioner
The CAM_TITLE object corresponds to the Captioner system object.

The list of commands and parameters for the CAM_TITLE object is given in the table:

Command—command description Comment

"REINDEX"—run the captions database Captions database re-indexation is run at any value of the _id_ parameter in the DoReact(
update ) command

226
TELEGRAM Telegram bot
The TELEGRAM object corresponds to the Telegram bot system object.

The TELEGRAM object sends events presented in the table. The procedure is started when the corresponding event occurs.

Event Description Comment

ERROR Message sending error The error<> parameter contains a test description of the error

The list of commands and parameters for the TELEGRAM object is given in the table:

Command—command description Parameters Description

SEND—send text<> Message text

chat_id<> Chat identifier

bot_id<> Bot identifier

longtitude<> Geolocation longtitude

latitude<> Geolocation latitude

address<> Geolocation text address

SENDPHOTO—send photo photo<> Full path to the image file

caption<> File caption

chat_id<> Chat identifier

bot_id<> Bot identifier

longtitude<> Geolocation longtitude

latitude<> Geolocation latitude

address<> Geolocation text address

227
CAM_IP_DETECTOR Embedded detection
The CAM_IP_DETECTOR object corresponds to the Embedded detection system object.

The CAM_IP_DETECTOR object sends events given in the table. Procedure is started when the corresponding event occurs.

Ev Event Comment
en s
ts descr
iption

DE Event The event occurs when metadata is received from embedded detection tools. For example, this event occurs when
TE receiving the data on body temperature from a thermal camera, and so on.
CT
ED The event also occurs if the data from detection tools is transferred using Onvif.

The param0<> parameter has a string value containing the event parameters. The transferred parameters depend on
the embedded detection tool. If you use Onvif, you can configure the contents of the parameter on the Event settings
tab of the ONVIF-Server object (see Filtering the ONVIF-Server events)

Examples of events from embedded detection tools:

Example 1

// Event from a thermal camera


Event : CAM_IP_DETECTOR|1|DETECTED|slave_id<QA-T51>,
fraction<16>,owner<QA-T51>,module<[Link]>,date<23-04-20>,
guid_pk<{1345DC60-3485-EA11-8A95-B06EBF8119EF}>,core_global<1>,time<10:31:06>,
param0<TargetList:name=TargetList;type=6;TemperatureValue0:37.4;json0:{
"BeginTime" : "20200423T073058.000000",
"EndTime" : "20200423T073100.000000",
"EventClass" : "FaceEvent",
"Hypotheses" : [
{
"Age" : 0,
"BestTime" : "20200423T073059.000000",
"Gender" : "unknown",
"Rectangle" : [ 0.6380, 0.550, 0.0680, 0.1560 ],
"TemperatureValue" : 37.40
}
],
"Id" : 1
}
;>

Example 2

// Event from VMDA detection


Event:CAM_IP_DETECTOR|1|DETECTED|param0<Comment:ver_type<0>,objtype<SLAVE>,int_obj_id<1>,module<[Link]>,
core_global<1>,_TRANSPORT_ID<>,time<12:22:30>,objaction<PING>,onvif_event<>,
date<30-03-21>,slave_id<DESKTOP-JHRURJJ>,
objid<DESKTOP-JHRURJJ>;>,int_obj_id<1>,core_global<1>,
guid_pk<{9A989C70-3991-EB11-BDFF-00155DF96D00}>,slave_id<DESKTOP-339SH3U>,time<12:22:30>,_timestamp<7520749>,
fraction<465>,date<30-03-21>,owner<DESKTOP-339SH3U>,module<[Link]>

228
SIP_TERMINAL SIP-terminal
The SIP_TERMINAL object corresponds to the SIP-terminal system object.

The SIP_TERMINAL object sends events given in the table. Procedure is started when the corresponding event occurs.

Event Description Contents of the param0<> parameter displayed in the Add. info field in the Event Viewer

CALL_END Call end Number of the subscriber who called

CALL_END Operator call Numbers of the subscribers and call duration. For example, if the parameter takes the "903 to 906 (01:
_OPERAT end 04)" value, it means that the subscriber 903 called the subscriber 906, and the call lasted 1 minute and
OR 4 seconds

CALL_END Device call


_DEVICE end

CALL_END Special
_VIRTUAL number call
end

CALL_BEG Call start Numbers of the subscribers: the subscriber who is calling and the subscriber who is being called
IN

CALL_TRY Call attempt


ING

CALL_BEG Start of
IN_VIRTU special
AL number call

CALL_TRY Special
ING_VIRT number call
UAL attempt

List of commands and parameters for the SIP_TERMINAL object:

Command—command description Parameters Parameters


description

END_ALL_CALLS—end all calls on the specified terminal (regardless of whether the - -


connection is established)

229
INC_MANAGER Incident manager
The INC_MANAGER object corresponds to the Incident manager system object.

The INC_MANAGER object sends events given in the table. Procedures are started when the corresponding event occurs.

Events Events description Paremeters Parameters Comment


description

CLOSE_C Click the Close button in the The event is generated when an incident is closed
LICK interface without being processed by the operator in the Incident
manager interface

CLOSE_A Click the Close all button in The event is generated when all incidents are closed
LL_CLICK the interface without being processed by the operator in the Incident
manager interface

SELECT Click an incident in the The event is generated if the operator left-clicks or right-
interface clicks the incident in the Incident manager interface

ACTIVATE The operator selected the alarm_time<> Time when the event
_EVENT event (click the event with the occurred
mouse)
event_guid<> Event ID (generated
randomly for each event)

objtype<> Object type (for


example, CAM, GRELE,
and so on)

action<> Action type (for


example, MD_START,
DISARM, and so on)

230
INC_SERVER Incident server
The INC_SERVER object corresponds to the Incident server system object.

The INC_SERVER object sends events presented in the table. The procedure is started when the corresponding event occurs.

E Events description Comment


v
e
nts

E The event (incident) is taken into processing in The event is generated:


V the Incident manager or is being processed by
E 1. when the operator takes the event into processing;
the operator
NT
2. at each step of the event processing.

The serializeBase64 parameter of the event contains JSON with the


detailed information about the processed event, including the steps
performed by the operator

The list of commands and parameters for the INC_SERVER object is presented in the table.

Command—description of the command Parameters Parameters Comment


description

UPDATE_STATUS—change the status of the event pks<> Array of event identifiers Parameters are filters and the presence of at
(incident) in the Incident manager least one parameter is mandatory.
objtypes<> Objects types
Parameter values can be specified with a
objids<> Objects identifiers
delimiter. This means that one OR the other
actions<> Actions value will be selected.

status<> Event status: Example: objids<1|2>

0—Waiting to be
processed

1—Processing

2—Suspended

3—Completed

UPDATE_ESCALATE_STATUS—change the status of escalated<> Event escalation status:


the event (incident) escalation in the Incident
manager 0—Waiting to be
processed (not
escalated)

1—Escalated

pks<>, objtypes<>, objids<>, actions<>


are the same as for UPDATE_STATUS

231
DIALOG Operator query panel
The DIALOG object corresponds to the Operator query panel system object:

List of commands and parameters for the DIALOG object is presented in the table:

Command—command description Parameters Description

"SETUP"—set up the operator query panel x<> Coordinate of left top corner (0–100)

y<> Coordinate of left top corner (0–100)

allow_move<> 0—forbid moving, 1—allow moving

"RUN"—show the operator query panel - -

"RUN_MODAL"—run the operator query panel in modal mode - -

"CLOSE"—close last opened operator query panel - -

"CLOSE_ALL"—close all opened operator query panels - -

232
MMS Mail Message Service
The MMS object corresponds to the Mail Message Service system object.

The MMS object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Description

"SET_CONNECTIONS" List of available connections

List of commands and parameters for the MMS object is given in the table:

Command—command description Parameters Description

"SETUP"—settings for the mail message service smtp<> Address of the SMTP server

connection<> Type of connection

smtp_username<> Username

smtp_password<> Password

port<> Port number

flags<> Flags

name <> Object name

"GET_CONNECTIONS"—get the list of available connections - -

Properties of the MMS object are shown in the table:

Properties of the MMS object Description

ID<> Object ID

PARENT_ID<> Parent object ID

233
MAIL_MESSAGE Mail message
The MAIL_MESSAGE object corresponds to the Mail message system object.

The MAIL_MESSAGE object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Description

SEND_ERROR Message sending error

SENT Message is sent

List of commands and parameters for the MAIL_MESSAGE object is given in the table:

Command—command Parameters Description


description

"SETUP"—settings for from<> Sender's address


mail message
to<> Recipient's address

cc<> Copies

subject<> Message subject

body<> Message body

attachments<> Attachments. If several files are attached, their addresses are separated with a
semicolon

flags<> Flags

name<> Object name

pack<> Method of attachments packing

is_body_html<> Specifies if HTML markup must be applied when sending. Possible values: 1 or 0

inline<> Specifies if attachments are only shown in the message text (value of 1) or both in
the text and in the "Attachments" section (value of 0)

"SEND"—send mail - -
message

"SEND_RAW"—send same as for the see Examples of scripts in the JScript language
email with parameters SETUP command

Properties of the MAIL_MESSAGE object are shown in the table.

Properties of the MAIL_MESSAGE object Description

ID<> Object ID

PARENT_ID<> Parent object ID

234
VMS Voice Message Service
The VMS object corresponds to the Voice Message Service system object.

List of commands and parameters for the VMS object is presented in the table:

Command—command description Parameters Description of parameters

"SEND"—send message. modem<> Name of device

pulse<> Type of dialing (0—tonal, 1—pulse)

name<> Object name

redial_attempts<> Number of call attempts

redial_delay<> Pause between call attempts

waitfordialtone<> Waiting for line signal (0—no, 1—yes)

flags<> Flags

Properties of the VMS object are shown in the table:

Properties of the VMS object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

235
GRELE Relay
The GRELE object corresponds to the Relay system object.

The GRELE object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Description

OFF Relay is off

ON Relay is on

SIGNAL_LOST Connection lost

List of commands and parameters for the GRELE object is presented in the table:

Command—command description Parameters Description

"ON"—enable relay - -

"OFF"—disable relay - -

"SETUP"—settings for relay chan <> Output number (0–15)

flags<> Flags

name<> Object name

Properties of the GRELE object are shown in the table.

Properties of the GRELE object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

REGION_ID<> Region ID

The GRELE object can be in the following states:

State of the GRELE object State description

"ON" Relay is on

"OFF" Relay is off

"DETACHED_ON" Connection lost, relay was on

"DETACHED_OFF" Connection lost, relay was off

236
GRAY Sensor
The GRAY object corresponds to the Sensor system object.

The GRAY object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Event description

ALARM Alarm. This event is received when the sensor is opened or closed (it depends on object settings) if sensor is armed. If
sensor is disarmed, then Sensor opened and Sensor closed events are received respectively

ARM Sensor is armed

CONFIRM Alarm received

DISARM Sensor is disarmed

NOT_VALI Zone is not ready


D_STATE

OFF Sensor is opened. This event is received when the sensor is opened if the sensor is disarmed

ON Sensor is closed. This event is received when the sensor is closed if the sensor is disarmed

SIGNAL_L Connection with the sensor is lost


OST

List of commands and parameters for the GRAY object is presented in the table:

Command – command description Parameters Description

"ARM"—arm the sensor - -

"DISARM"—disarm the sensor - -

“CONFIRM”—confirm an alarm - -

“SETUP”—settings for the sensor chan<> Output number (0–15)

flags<> Flags

name<> Object name

type<> Type of sensor object (0—on closing, 1—on opening)

Properties of the GRAY object are shown in the table.

Properties of the GRAY object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

REGION_ID<> Region ID

The GRAY object can be in the following states:

State of the GRAY object State description

"ARMED" Sensor is armed

"DISARME"” Sensor is disarmed

"ALARMED" Alarm

"CONFIRMED" Alarm confirmed

"DISARMED_ALARM" Not ready

"DETACHED_ARMED" Connection lost when the sensor was armed

"DETACHED_DISARM" Connection lost when the sensor was disarmed

237
“OFF” Normal

238
VNS Voice notification service
The VNS object corresponds to the Voice notification service system object.

List of commands and parameters for the VNS object is presented in the table:

Command— P Description
command ar
description a
m
et
ers

"SETUP"—set ca Name of sound device.


tings of the rd
voice <> Note. Card name must correspond to the name specified in the settings of the sound card of the Voice
notification notification service
service
le Level of signal. The value of the parameter varies from 0 to 15. By default, it is 8
v
el
<>

ch Set of sound channels. Possible values of the parameter: 0—no sound channel; 1—left playback channel; 2—right
a playback channel; 3—left and right playback channels (both channels)
n
n
el
<>

fl Flags
a
gs
<>

ip IP-address of network device


<>

n Object name
a
m
e
<>

p Password
as
s
<>

us Username
er
<>

"PLAY"—play fil Full path to the audio file in .wav format (indicating the name of the file being played. For example: C:\Program
audio file e Files (x86)\Axxon PSIM\Wav\cam_alarm_1.wav).
<>
Note. If only file name is specified, the default path to the file will be taken from the InstallPath registry key in
the HKEY_LOCAL_MACHINE\SOFTWARE\AxxonSoft\PSIM section (HKEY_LOCAL_MACHINE
\Software\Wow6432Node\AxxonSoft\PSIM for 64-bits system), in value of the InstallPath parameter. In this
parameter, it is possible to play several audio files using the "+" operation

"STOP"—stop - -
playing
audio file

Properties of the VNS object are shown in the table.

Properties of the VNS object Description of properties

ID<> Object ID

239
PARENT_ID<> Parent object ID

240
SMS Short Message Service
The SMS object corresponds to the Short Message Service system object.

The SMS object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Event Comment


description

RECE Message is If the event doesn't occur when a message is received on the modem, you must use the ProcessFromSim
IVE received registry key (see Registry keys reference guide).

The message<> message parameter contains the text of the sent message.

The parameter phone<> contains the phone number from which the message was sent, in the
+7XXXXXXXXXX format

List of commands and parameters for the SMS object is presented in the table:

Command—command description Parameters Description of parameters

"SETUP"—settings of short message service device<> SMS device

flags<> Flags

message<> Message text

name<> Object name

phone<> Phone number

Properties of the SMS object are shown in the table.

Properties of the SMS object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

241
SSS_WATCHDOG System restart service
The SSS_WATCHDOG object corresponds to the System restart service system object.

The SSS_WATCHDOG object sends events presented in the table. Procedure is started when the corresponding event occurs.

Event Description

RESTART_EXCEEDED Number of module restarts is exceeded

RESTART_PROCESS Module restart

List of commands and parameters for the SSS_WATCHDOG object is presented in the table:

Command—command description Parameters Description

"SETUP"—set parameters for the system restart service name<> Object name

flags<> Flags

restart_period<> Restart period

restart_times<> Maximal number of restarts for the specified period

timeout<> Response time

usb_wd_control<> Connecting AxxonSoft USB Watchdog

Properties of the SSS_WATCHDOG object are shown in the table:

Properties of the SSS_WATCHDOG object Description of properties

ID<> Object ID

PARENT_ID<> Parent object ID

242
BACNET BacNet
The BACNET object corresponds to the BacNet system object.

The BACNET object sends events presented in the table. Procedures are started when the corresponding event occurs.

Event Event description

ERROR Error message received

EVENT_OCCURES Message confirmation

WRITE_OCCURES Recording confirmation

WRITE_RESULT Recording result

The list of commands and parameters for the BACNET object is presented in the table:

Command—description Parameters Parameters description

WRITE—send a value to the BACnet device bacnet_application_tag<> Data type. Possible values:

NULL = 0
BOOLEAN = 1
UNSIGNED INT = 2
SIGNED INT = 3
REAL = 4
DOUBLE = 5
OCTET STRING = 6
CHARACTER STRING = 7
BIT STRING = 8

bacnet_value<> Parameter value

bacnet_objtype<> Object type:

ANALOG INPUT = 0
ANALOG OUTPUT = 1
ANALOG VALUE = 2
BINARY INPUT = 3
BINARY OUTPUT = 4
BINARY VALUE = 5

bacnet_instance<> BACnet unique global device identifier

bacnet_property_id<> Property ID

bacnet_device_id<> BACnet device ID in the system

EVENT—send a message to the BACnet device event_type<> Event type

from_state<> Change state from

to_state<> Change state to

message_text<> Event text

243
Description of the object model in Axxon PSIM

244
The Core object and its built-in methods

245
The Core object
The Core object is a core of the system, a global static object that implements the methods used to control the state and monitor the
system objects of Axxon PSIM. The methods of the Core object allow you to receive information about the registered system objects,
generate reactions for them and change their states. The Core object implements additional methods used to pause script execution,
debug scripts, create and call global variables.

The Core object is not a prototype, thus you cannot create other objects on its basis (it cannot be used as a template). All methods of
the Core object are static. Thus, you can call the methods of the Core object directly from the script without referring to the Core obje
ct itself.

246
The SetObjectParam method
The SetObjectParam method is used to set the values to system object parameters.

Syntax for method invocation:

function SetObjectParam(objtype: String, id: String, param : String, value : String)

Method arguments:

1. objtype is a required argument. It corresponds to the type of system object which parameter values you want to set. Possible
values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, the range is limited by the identification numbers of objects of the specified type registered
in the system.
3. param is a required argument. It corresponds to the parameter of the system object. Possible values: String type, range is
limited by the parameters available for the given object.
4. value is a required argument. It corresponds to the value set to the param parameter of the system object. Possible values:
String type, range depends on the set parameter.

Example. On Macro 1, check if cameras 1 to 4 are set to transmit color video. If a camera is set for black-and-white video
transmission, switch it to the color mode (set the true ("1") value to the Color (“color”) parameter).

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
var i;
for(i=1; i<=4; i=i+1)
{
if (GetObjectParam("CAM", i , "color") == "0")
{
SetObjectParam("CAM", i, "color", "1");
}
}
}

Note

If the object is active when the script is started (that is the settings panel of this object is open), then object parameters can
not be changed by the SetObjectParam method. For example, if the settings panel for the Camera 1 object is open and the
script above is started, the operation mode of Camera 1 will not be changed for the color one.

247
The SetObjectState method
The SetObjectState method changes the state of objects.

Syntax for method invocation:

function SetObjectState(objtype : String, id : String, state : String)

Method arguments:

1. objtype is a required argument. It corresponds to the type of system object, the state of which you want to change. Possible
values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, the range is limited by the identification numbers of objects of the specified type registered
in the system.
3. state is a required argument. It corresponds to the state to which you want to switch the object. Possible values: String type,
range is limited by the states available for this object.

Example. Check if camera 1 is armed every hour. If camera 1 is disarmed, arm it.

Note

You must create the Timer object with identification number 1 beforehand. Set the Minutes parameter of the Timer object
to 30. The timer will go off every hour, for example, 09:30, 10:30, 11:30, and so on.

if ([Link] == "TIMER" && [Link] == "1" && [Link] == "TRIGGER")


{
if (GetObjectState("CAM", "1") == "DISARMED")
{
SetObjectState("CAM", "1", "ARMED");
}
}

248
The DebugLogString method
The DebugLogString method outputs the user messages into the debug windows of the Editor-Debugger utility.

Syntax for method invocation:

function DebugLogString(output : String)

Method arguments:

1. output is a required argument. It specifies the message string that you want to output in the debug window of the Editor-
Debugger utility. Possible values: String type.

Example. When any event from any of the microphones is registered in the system, output it in the debug window.

if ([Link] == "OLXA_LINE")
{
var msgstr = [Link]();
DebugLogString("Event from the microphone " + msgstr);
}

249
The Base64Decode method
The Base64Decode method is used to decode strings that are encoded by the Base64 scheme.

Syntax for method invocation:

function Base64Decode(data_in: String, WideChar: Boolean)

Method arguments:

1. data_in is a required argument. It specifies the Base64 string that you want to decode;
2. WideChar is a required argument. It specifies the encoding type. Possible values: 0 or 1. If the encoding type is Unicode, the
argument value is 1, otherwise 0.

Example. On macro 1, decode the string specified in Base64. Output the decoding result in the debug window of the Editor-Debugger
utility (the result is the "Axxon PSIM JScript" string).

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
var str = Base64Decode("SW50ZWxsZWN0IEpTY3JpcHQ= ", 0);
DebugLogString(str);
}

250
The Sleep method
The Sleep method pauses the execution of the script for a specified period of time.

Syntax for method invocation:

function Sleep(milliseconds : int)

Method arguments:

1. milliseconds is a required argument. It specifies the time for which you want to pause the execution of a scrip. It is set in
milliseconds. Possible values: int type.

Example 1. On macro 1, playback the following audio files one by one with audio player 1: cam_alarm_1.wav, cam_alarm_2.wav,
cam_alarm_3.wav from the …\Axxon PSIM\Wav\ folder. The delay between the playback of each audio file must be five seconds (5000
milliseconds).

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
var i;
for(i=1; i<=3; i=i+1)
{
DoReactStr("PLAYER", "1", "PLAY_WAV", " file<\cam_alarm_" + i + ".wav>");
Sleep(5000);
}
}

Example 2. On macro 2, start the timer 1 that triggers every 10 seconds for a minute from the start of macro 2.

Note

To start this script, you must create the Timer object with ID 1 beforehand. Leave the default object parameters (Any). The
Timer 1 object can be disabled.

if ([Link] == "MACRO" && [Link] == "2" && [Link] == "RUN")


{
for(i=0; i<=5; i=i+1)
{
DoReactStr("TIMER","1", "DISABLE", "");
Sleep(10000);
DoReactStr("TIMER","1", "ENABLE", "");
NotifyEventStr("TIMER","1", "TRIGGER", "");
}
DoReactStr("TIMER","1", "DISABLE", "");
}

251
The Itv_var method
The Itv_var method sets and returns the values of global variables.

Syntax for method invocation:

function Itv_var (globalvar : String) : String

1. Globalvar is a required argument. It specifies the name of the global variable. Possible values: String type that meets the
requirements for valid names of String parameters of the Windows registry.

Note

Global variables are stored in the Windows registry to maintain their values after Windows restart. All global variables are
stored in the registry branch HKEY_USERS\S-1-5-21-…\Software\VMSScript\VMSSCRIPT and
HKEY_CURRENT_USER\Software\VMSScript\VMSSCRIPT. To access a global variable directly from the registry, search the
registry for it by its name.

Example. On macro 1, save the value of the bright parameter of camera 10 to the cam10bright global variable. On macro 2, set the
bright parameter of the cameras 1 to 4 to the value of the cam10bright global variable.

if ([Link] == "MACRO" && [Link] == "RUN")


{
if([Link] == "1")
{
Itv_var("cam10bright") = GetObjectParam("CAM", "10", "bright");
}
if ([Link] == "2")
{
var cam10bright = Itv_var("cam10bright");
for(i=1; i<=4; i=i+1)
{
SetObjectParam("CAM", i, "bright", cam10bright);
}
}
}

252
The Int_var method
The Int_var method sets and returns values of global variables of integer type.

Attention!

The Int_var method uses the same storage as the Itv_var method, but modifies the type of variable to the integer type.

Syntax for method invocation:

function Int_var (globalvar : String) : int

1. Globalvar is a required argument. It specifies the name of the global variable. Possible values: String type that meets the
requirements for valid names of String parameters of the Windows registry.

Note.

Global variables are stored in the system registry to maintain their values after Windows restart. All global variables are
stored in the registry branch HKEY_USERS\S-1-5-21-…\Software\VMSScript\VMSSCRIPT and
HKEY_CURRENT_USER\Software\VMSScript\VMSSCRIPT. To access a global variable directly from the registry, search the
registry for it by its name.

Example. In the test example below, to check the method operation, the global variable named 2 is assigned a value of 1 that is then
increases by 1 and is displayed in the debug window of the script.

if([Link] =="RUN")
{
Int_var(2) = 1;
Int_var("2")++;
DebugLogString(Int_var("2").toString());
}

253
The GetObjectParentType method
The GetObjectParentType method returns the type of the parent object for the specified object according to the system object
hierarchy.

Syntax for method invocation:

function GetObjectParentType (objtype : String) : String

Method arguments:

1. objtype is a required argument. It corresponds to the type of system object for which you want to return the type of the
parent object. Possible values: String type, range is limited by object types allowed in the system.

Note

In the hierarchy of system objects, the Main object is the highest level object. This object is the parent object for all objects
of the Computer type, Screen type and others.

Example. On macro 1, display in the debug window the names of four objects, starting from the detection zone, in the order of the
hierarchy provided by Axxon PSIM.

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
var objtype = "CAM_ZONE";
DebugLogString(objtype);
for(var i = 1; i<=4; i=i+1)
{
objtype = GetObjectParentType(objtype);
DebugLogString(objtype);
}
}

254
The GetIPAddress method
The GetIPAddress method returns the IP address of the Axxon PSIM kernel according to the existing architecture of the distributed
video surveillance system.

Syntax for method invocation:

function GetIPAddress (dst : String, src : String) : String

Method arguments:

1. dst is a required argument. It specifies the name of the remote computer on which the Axxon PSIM kernel is installed. The
value of the dst argument must match one of the computer names registered when configuring the architecture of the
distributed video surveillance system. Possible values: String type that meets the requirements for network computer names;
the range is limited to the computer names registered in the system.
2. src is a required argument. It specifies the name of the local computer (the computer from which you run the script). The
value of the src argument must match the name of the local computer as it is registered in Axxon PSIM. Possible values:
String type that meets the requirements for network computer names.

Note

The information about all connections of the local computer (kernel) to other remote computers (kernels) registered during
the configuration of the distributed architecture is displayed in the Architecture tab of the System settings window.

Example. On a camera alarm, determine the name of the computer to which this camera is connected, and output in the debug
window the IP address of the connection between this computer and the local computer on which the script is executed.

if ([Link] == "CAM" && [Link] == "MD_START")


{
var camid = [Link];
var compname = GetObjectParentId("CAM", camid, "COMPUTER");
var ip = GetIPAddress("WS1","WS1"); \\if the script is run on the computer where kernel of Axxon PSIM software
has been installed
DebugLogString("IP-address of the alarmed camera computer" + ip);
}

Note

Instead of "WS1" in the example, you must enter the name of the computer on which the script is run and Axxon PSIM kernel
is installed.

255
The GetObjectName method
The GetObjectName method returns the name of the object that it was given during registration in the program.

Syntax for method invocation:

function GetObjectName(objtype : String, id : String) : String

Method arguments:

1. objtype is a required argument. It specifies the system type of the object which name you want to get. Possible values: String
type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, the range is limited by the identification numbers of objects of the specified type registered
in the system.

Example. On alarm in any sensor, open the information window with the following text: "Alarm in the <alarmed sensor name>.
Sensor connected to the Server <name of the section to which the sensor is connected>”.

Note

You must create the information dialog window beforehand using the [Link] utility and save it in the [Link] file in the <
Axxon PSIM installation directory>\Program folder.

if ([Link] == "GRAY" && [Link] == "ALARM")


{
var grayid = [Link];
var grayname = GetObjectName("GRAY", grayid);
var compname = GetObjectParentId("GRAY", grayid, "COMPUTER");
DoReactStr("DIALOG", "test", "CLOSE_ALL","");
DoReactStr("DIALOG", "test", "RUN","Alarm in the '" + grayname + "' sensor connected to the '" + compname + "'
server.");
}

256
The GetObjectState method
The GetObjectState method returns the state of the object at the moment of method invocation.

Syntax for method invocation:

function GetObjectState(objtype : String, id : String) : String

Method arguments:

1. objtype is a required argument. It specifies the type of the system object which state you want to get. Possible values: String
type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, the range is limited by the identification numbers of objects of the specified type registered
in the system.

Example. When relay 1 is enabled (for example, on pressing the button connected to the relay 1), arm sensor 1. The next time the
relay 1 is enabled, disarm sensor 1.

if ([Link] == "GRELE" && [Link] == "1" && [Link] == "ON")


{
if(GetObjectState("GRAY", "1")=="DISARM")
{
SetObjectState("GRAY", "1", "ARM");
}
else
{
SetObjectState("GRAY", "1", "DISARM");
}
}

Note

Some object types can have several states at the same time. For example: ATTACHED|DISARMED or
ATTACHED|DISARMED|RECORDER_ON|RECORDING.

257
The GetObjectParam method
The GetObjectParam method returns the value of the specified parameter of the system object at the moment of method invocation.

Syntax for method invocation:

function GetObjectParam(objtype : String, id : String, param : String) : String

Method arguments:

1. objtype is a required argument. It specifies the type of system object for which you want to return the value of the specified
parameter. Possible values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, the range is limited by the identification numbers of objects of the specified type registered
in the system.
3. param is a required argument. It corresponds to the name of the parameter the value of which you want to return. Possible
values: String type, range is limited by the parameters available for the given object.

Example. See the example in The SetObjectParam method.

258
The GetObjectParentId method
The GetObjectParentId method returns the identification (registration) number of the parent object of the specified object.

Syntax for method invocation:

function GetObjectParentId(objtype : String, id : String, parent : String) : String

Method arguments:

1. objtype is a required argument. It specifies the type of the system object, for which you want to return the type of parent
object. Possible values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in
the system.
3. parent is a required argument. It specifies the type of the system object that is the parent object (main object in the system
hierarchy of objects) of the object specified by the objtype argument. Possible values: String type, range is limited by object
types registered in the system.

Example. If a camera turns off or stops transmitting a video signal, send an email message registered in Axxon PSIM under number 1.
The message must include the subject: "Warning! Camera turned off" and, in the message body, the number of the camera and of the
server it is connected to.

Note

The Short Messages Service must be installed and work properly.

if ([Link] == "CAM" && [Link] == "DETACH")


{
var cam_id = [Link];
var parent_comp_id = GetObjectParentId("CAM", cam_id, "SLAVE");
DoReactStr("MAIL_MESSAGE","1","SETUP","from<***@[Link]>,to<***@[Link]>,body<Camera disabling "+cam_id+" on
the Server"+parent_comp_id+">,parent_id<1>,subject<Attention! Camera disabling>,name<Message 1>,objname<Message
1>");
DoReactStr("MAIL_MESSAGE", "1", "SEND", "");
}

259
The DoReactStr method
The DoReactStr method generates the reactions of the system objects. The method sends the reaction to the specified object. The
reaction is transferred directly to the kernel on which the object is registered, and not to the entire system. In the DoReactStr method,
the reaction is specified by a group of String arguments.

Syntax for method invocation:

function DoReactStr(objtype : String, id : String, action : String, param<value> [, param<value>] : String)

Method arguments:

1. objtype is a required argument. It corresponds to the type of system object for which you want to generate a reaction.
Possible values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in
the system.
3. action is a required argument. It specifies the reaction that you want to generate. Possible values: String type, range is
limited by the reactions available for the object of the specified type.
4. param<value> is a required argument. You can specify several arguments of this type. It corresponds to the parameter(s) of
the system object reaction.

Syntax for setting a value to a parameter corresponds to a string:

"param<value>", where

param is a name of the parameter;

value is a value of the parameter.

Syntax for setting a value to several parameters corresponds to a string:

"param1<value1>,param2<value2>…"

Elements of the list are separated by commas without spaces. If no parameter needs to be specified, an empty string is used:

DoReactStr("CAM","1","REC","");

Possible values of the param argument: String type, range is limited by the available parameters of the specified reaction. Possible
values of the value argument: String type, range depends on the parameter that you want to set.

For all reactions you can specify delay of reaction execution using the delay<> parameter. Delay is specified in seconds.

Note

Two types of system messages are available in Axxon PSIM: events and reactions. The events usually contain some
information and are used as notifications sent to all Axxon PSIM kernels connected to each other during the architecture
configuration. The reactions are commands sent to specific objects. A reaction is transmitted only to the kernel on which the
required object is registered, and not to the entire system. The DoReactStr and DoReact methods are used to generate
reactions. The NotifyEventStr and NotifyEvent methods are used to generate events.

Example 1. When an alarm is received from a camera, switch Monitor 1 to single Surveillance window mode (one-fold) and show the
video from the alarmed camera in this window.

if ([Link] == "CAM" && [Link] == "MD_START")


{
var camid = [Link];
DoReactStr("MONITOR","1","ACTIVATE_CAM","cam<"+ camid +">");
DoReactStr("MONITOR","1","KEY_PRESSED","key<SCREEN.1>");
}

Example 2. When alarm from a camera is completed, the recording must continue for five second and after this time the recording
must stop (analogue of Post-record mode).

260
if ([Link] == "CAM" && [Link] == "MD_STOP")
{
var camid = [Link];
DoReactStr("CAM",camid,"REC_STOP","delay<5>");
}

Example 3. On macros 1, enable telemetry control using mouse on the camera 4 displayed in the monitor 10. On macros 2, disable it.

if ([Link] == "MACRO" && [Link] == "RUN" && [Link] == "1")


{
DoReactStr("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<1>");
}
if ([Link] == "MACRO" && [Link] == "RUN" && [Link] == "2")
{
DoReactStr("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<0>");
}

261
The DoReact method
The DoReact method generates the reactions of the system objects. The method sends the reaction to the specified object. The
reaction is transferred directly to the kernel on which the object is registered, and not to the entire system. In the DoReact method,
the reaction is specified by the MsgObject object.

Syntax for method invocation:

function DoReact(msgevent : MsgObject)

Method arguments:

1. msgevent is a required argument. It specifies the reaction sent to the specified object. Possible values: the MsgObject
objects created earlier in the script.

Note

Two types of system messages are available Axxon PSIM: events and reactions. The events usually contain some information
and are used as notifications sent to all Axxon PSIM kernels connected to each other during the architecture configuration.
The reactions are commands sent to specific objects. A reaction is transmitted only to the kernel on which the required object
is registered, and not to the entire system. The DoReactStr and DoReact methods are used to generate reactions. The NotifyE
ventStr and NotifyEvent methods are used to generate events.

Example. When relay 1 closes, close relays 2 and 3. When relay 1 opens, open relay 2.

if ([Link] == "GRELE" && [Link] == "1")


{
var msgevent = [Link]();
if([Link] == "ON")
{
[Link] = "2";
DoReact(msgevent);
[Link] = "3";
DoReact(msgevent);
}
if([Link] == "OFF")
{
[Link] = "2";
DoReact(msgevent);
}
}

262
The DoReactSetupCore method
The DoReactSetupCore method is used to change the parameters of the system object. The method changes only the specified
parameters of the object, leaving other parameters unchanged.

Syntax for method invocation:

function DoReactSetupCore(objtype : String, id : String, param<value> [, param<value>] : String )

Method arguments:

1. objtype is a required argument. It corresponds to the type of system object which parameter values you want to set. Possible
values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in
the system.
3. param<value> is a required argument. You can specify several arguments of this type. It corresponds to the parameter(s) of
the system object reaction.

Syntax for setting a value to a parameter corresponds to a string:

“param<value>”, where

param is a name of the parameter;

value is a value of the parameter.

Syntax for setting a value to several parameters corresponds to a string:

“param1<value1>,param2<value2>…”.

Elements of the list are separated by commas without spaces.

Possible values of the param argument: String type, range is limited by the available parameters of the specified reaction. Possible
values of the value argument: String type, range depends on the parameter that you want to set.

Example. On macro 1, set the values of the following parameters of cameras 1-4: PTZ device number (telemetry_id) and number of
the microphone for synchronous recording (audio_id). The values must be equal to the camera numbers plus 1.

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
var i;
for(i=1; i<=4; i=i+1)
{
DoReactSetupCore ("CAM", i, "telemetry_id<" + (i+1) +">,audio_id<" + (i+1) + ">");
}
}

263
The DoReactSetup method
The DoReactSetup method is used to temporary change the parameters of the system object. The method changes only the specified
parameters of the object, leaving other parameters unchanged.

Syntax for method invocation:

function DoReactSetup (objtype : String, id : String, param<value> [, param<value>] : String )

Method arguments:

1. objtype is a required argument. It corresponds to the type of system object which parameter values you want to set. Possible
values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in
the system.
3. param<value> is a required argument. You can specify several arguments of this type. It corresponds to the parameter(s) of
the system object reaction.

Syntax for setting a value to a parameter corresponds to a string:

“param<value>”, where

param is a name of the parameter;

value is a value of the parameter.

Syntax for setting a value to several parameters corresponds to a string:

“param1<value1>,param2<value2>…”.

Elements of the list are separated by commas without spaces.

Possible values of the param argument: String type, range is limited by the available parameters of the specified reaction. Possible
values of the value argument: String type, range depends on the parameter that you want to set.

Example. On macro 1 starts, temporary remove all cameras from the first monitor.

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
DoReactSetup ("MONITOR","1","REMOVE_ALL","");
}

264
The DoReactGlobal method
The DoReactGlobal method is used to generate reactions of system objects. The DoReactGlobal method sends a reaction to the
required object. The reaction is sent not only to the kernel on which the object is registered, but to the entire system. In the
DoReactGlobal method, the reaction is specified by the MsgObject object.

Syntax for method invocation:

function DoReactGlobal(msgevent : MsgObject)

Method arguments:

1. msgevent is a required argument. It specifies the reaction sent to the specified object. Possible values: the MsgObject objects
created earlier in the script.

Example. On macro 2, arm sensor 2. The command must be sent to all system kernels as a reaction to be registered in the Event
Viewer.

if ([Link] == "MACRO"&& [Link] == "2" && [Link] == "RUN")


{
var msgevent = CreateMsg();
[Link] = "GRAY";
[Link] = "2";
[Link] = "ARM";
DoReactGlobal(msgevent);
}

265
The NotifyEventStr method
The NotifyEventStr method generates system events. The generated event is sent to all system kernels connected to the local kernel.
In the NotifyEventStr method, an event is specified by a group of String arguments.

Syntax for method invocation:

function NotifyEventStr(objtype : String, id : String, event : String, param<value> [, param<value>] : String )

Method arguments:

1. objtype is a required argument. It corresponds to the type of system object for which you want to generate an event. Possible
values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in
the system.
3. event is a required argument. It specifies the event that you want to generate. Possible values: String type, range is limited
by events available for the object of the specified type.
4. param<value> is a required argument. You can specify several arguments of this type. It corresponds to the parameter(s) of
the system event.

Syntax for setting a value to a parameter corresponds to a string:

"param<value>", where

param is a name of the parameter;

value is a value of the parameter.

Syntax for setting a value to several parameters corresponds to a string:

"param1<value1>,param2<value2>…".

Elements of the list are separated by commas without spaces. If no parameter needs to be specified, an empty string is used:

DoReactStr("CAM","1","MD_START","");

Possible values of the param argument: String type, range is limited by the available parameters of the specified event. Possible
values of the value argument: String type, range depends on the parameter that you want to set.

Note

Two types of system messages are available in Axxon PSIM: events and reactions. The events usually contain some
information and are used as notifications sent to all Axxon PSIM kernels connected to each other during the architecture
configuration. The reactions are commands sent to specific objects. A reaction is transmitted only to the kernel on which the
required object is registered, and not to the entire system. The DoReactStr and DoReact methods are used to generate
reactions. The NotifyEventStr and NotifyEvent methods are used to generate events.

Example. When an alarm is received, send the “panic lock” event for the corresponding region of the camera. For camera
identification numbers are from 1 to 4, use region 1. For camera numbers from 5 to 10, use region 2.

if ([Link] == "CAM" && [Link] == "MD_START")


{
var regionid;
if ([Link] <=4)
{
regionid = "1";
}
if (([Link] > 4) && ([Link] <= 10))
{
regionid = "2";
}
NotifyEventStr("REGION", regionid, "PANIC_LOCK", "");
}

266
The NotifyEvent method
The NotifyEvent method generates system events. The generated event is sent to all system kernels connected to the local kernel. In
the NotifyEvent method, the event is specified by the MsgObject object (see The MsgObject and Event objects and their built-in
methods and properties).

Syntax for method invocation:

function NotifyEvent(msgevent : MsgObject)

Method arguments:

1. msgevent is a required argument. It specifies the event sent to the system. Possible values: the MsgObject objects created
earlier in the script.

Note

Two types of system messages are available in Axxon PSIM: events and reactions. The events usually contain some
information and are used as notifications sent to all Axxon PSIM kernels connected to each other during the architecture confi
guration. The reactions are commands sent to specific objects. The reactions are transmitted only to the kernel on which the
object is registered, and not to the entire system. The DoReactStr and DoReact methods are used to generate reactions. The
NotifyEventStr and NotifyEvent methods are used to generate events.

Example. When the Backup Archive 1 module starts archiving video recordings, the analog output 1 of the Video Capture Device 2 is
disabled. Send the command as an event to be registered in the Event Viewer.

Note

When running this script, the analog output 1 of the Video Capture Device 2 is not disabled.

if ([Link] == "ARCH" && [Link] == "1" && [Link] == "ACTIVE ")


{
var msgevent = CreateMsg();
[Link] = " GRABBER ";
[Link] = "2";
[Link] = "MUX1_OFF";
NotifyEvent(msgevent);
}

267
The NotifyEventGlobal method
The NotifyEventGlobal method is used to generate system events. The generated event is transmitted to all system kernels connected
via the network. In the NotifyEventGlobal method, the event is specified by the MsgObject object (see The MsgObject and Event
objects and their built-in methods and properties)

Syntax for method invocation:

function NotifyEventGlobal (msgevent : MsgObject)

Method arguments:

1. msgevent is a required argument. It specifies the event sent to the system. Possible values: the MsgObject objects created
earlier in the script.

Example. On macro 1, the first camera is set to record. The command must be sent to all system kernels as the event to be
registered in the Event Viewer.

Note

When running this script, camera 1 is not set to record.

if ([Link] == "MACRO"&& [Link] == "1" && [Link] == "RUN")


{
var msgevent = CreateMsg();
[Link] = "CAM";
[Link] = "1";
[Link] = "REC";
NotifyEventGlobal(msgevent);
}

268
The CreateMsg method
The CreateMsg method creates objects based on the MsgObject prototype (see The MsgObject and Event objects).

Syntax for method invocation:

function CreateMsg() : MsgObject

There are no method arguments.

Example 1. When an alarm is received, send the “panic lock” event for the corresponding region of the camera. If the identification
number of the alarm camera is from 1 to 4, use region 1. If the identification number of the alarm camera is from 5 to 10, use region
2.

if ([Link] == "CAM" && [Link] == "MD_START")


{
var msgevent = CreateMsg();
[Link] = "REGION";
[Link] = "PANIC_LOCK";
if ([Link] <=4)
{
[Link] = "1";
}
if (([Link] > 4) && ([Link] < 10))
{
[Link] = "2";
}
NotifyEvent(msgevent);
}

Example 2. When timer №1 starts, start macro 1 every 30 seconds.

Note

To start this script, you must create the Timer object with the identification number 1 beforehand. Set value 1 to the Second
parameter of the Timer object, leave other parameters unchanged (Any by default).

if ([Link] == "TIMER" && [Link] == "1" && [Link] == "TRIGGER")


{
var msg = CreateMsg();
[Link](GetObjectParams("TIMER", "1"));
if([Link]("s") == "1")
{
DoReactStr("MACRO", "1", "RUN", "");
SetObjectParam("TIMER","1","s","30");
DoReactStr("TIMER","1", "DISABLE", "");
DoReactStr("TIMER","1", "ENABLE", "");
}
if([Link]("s") == "30")
{
DoReactStr("MACRO", "1", "RUN", "");
SetObjectParam("TIMER","1","s","1");
DoReactStr("TIMER","1", "DISABLE", "");
DoReactStr("TIMER","1", "ENABLE", "");
}
}

269
The Lock and Unlock methods
The Lock and Unlock methods are used to create a global critical section when synchronization of scripts started in different streams is
required. The Lock method opens a critical section and the Unlock method closes it.

Attention!

If you invoke the Lock method, you must also invoke the Unlock method. Otherwise, the system can freeze.

We recommend avoid using the Lock and Unlock methods.

Syntax for method invocation:

function Lock()

function Unlock()

Example. On macro 1, calculate the total amount of alarmed relays and sensors. Objects of each type must be calculated at the same
time (in an individual script). The result must be written to the counter global variable.

Script 1:

// Number of alarmed relays is calculated


var i = Number(0);
if ([Link] == "MACRO" && [Link]== "1" && [Link] == "RUN")
{
var msg = CreateMsg();
[Link](GetObjectIds("GRELE"));
var objCount = [Link]("[Link]");
var k;
for(k= 0; k < objCount; k++)
if(GetObjectState("GRELE", [Link]("id." + k))== "ALARM"){
Lock();
i = Itv_var("counter");
i++;
Itv_var("counter")=i;
Unlock();
}
}

Script 2:

//Number of alarmed sensors is calculated


var i = Number(0);
if ([Link] == "MACRO" && [Link]== "1" && [Link] == "RUN")
{
var msg = CreateMsg();
[Link](GetObjectIds("GRAY"));
var objCount = [Link]("[Link]");
var k;
for(k = 0; k < objCount; k++)
if(GetObjectState("GRAY", [Link]("id." + k))== "ALARMED"){
Lock();
i = Itv_var("counter");
i++;
Itv_var("counter")=i;
Unlock();
}
}

270
Note

If the Lock() and Unlock() methods are not used in this example, then collisions can occur and the calculated value will be
less than the actual value.

271
The IsAvailableObject method
The IsAvailableObject method is used to determine the current access permissions to an object.

Syntax for method invocation:

function IsAvailableObject(compname: String, objtype: String, id: String, param : String) : String

The method returns 0 if the current user has not been assigned permissions of the param type to access the object. The method
returns 1 if permissions have been assigned.

Method arguments:

1. compname is a required argument. It corresponds to the name of the Computer object on the basis of which the object was
created in the hardware tree.
2. objtype is a required argument. It corresponds to the type of the system object access permissions to which you want to find
out. Possible values: String type, range is limited by object types registered in the system.
3. id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argu
ment. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in
the system.
4. param is a required argument. It corresponds to the number of the type of permissions that you want to find out if they exist.
A description of permissions is given in Limiting access to the system objects administration, control and viewing functions.
Possible values:
a. 0—rightsNoView access permissions. The method will return 1 if there are no administrative, control, or monitoring
permissions to the object (red "x").
b. 1—rightsNoControl access permissions. The method will return 1 if there are only monitoring permissions (letter M).
c. 2—rightsViewAndControl access permissions. The method will return 1 if there are control and monitoring permissions
to the object (green checkbox).
d. 3—rightsViewOrControl access permissions. The method will return 1 if there is either monitoring or control
permissions to the object.
e. 4—rightsNot access permissions.
f. 5—rightsConfigure access permissions. The method will return 1 if there are administrative, control, and monitoring
permissions to the object (grey checkbox).

Example. A Camera object with the identifier 1 has been created in the hardware tree on the basis of the Computer object with the
"Comp" name. Find out the current access permissions to the object.

var i = 0;
for(i = 0; i <= 5; i++)
{
var result =
IsAvailableObject('Comp','CAM','1', i);
DebugLogString("right "+i+" = "+result);
}

272
The GetUserId method
The GetUserId method returns the identifier of the current Axxon PSIM user.

Syntax for method invocation:

function GetUserId (cmp : String) : String

Method arguments:

1. cmp is a required argument. It specifies the name of the computer on which Axxon PSIM is installed. Possible values: String
type that meets requirements for network computer names, range is limited by computer names registered in the system.

Example. Display in the debug window the identifier of the current user of Axxon PSIM installed on a computer named 'WS3':

DebugLogString(GetUserId("WS3"));

273
The GetEventDescription method
The GetEventDescription method is used to get a description of an event in natural language.

Syntax for method invocation:

function GetEventDescription (obj_type : String, event : String)

Method arguments:

1. obj_type is a required argument. It specifies the type of system object, the description of which you want to get.
2. event is a required argument. It specifies the name of the event, the name of which you want to get.

Example. When receiving events from camera 1, display messages about them in natural language in the debug window.

if ([Link] == "CAM"&& [Link] == "1")


{
var str = GetEventDescription("CAM", [Link]);
DebugLogString(str);
}

274
The GetObjectIdByParam method
The GetObjectIdByParam method allows you to get the ID of an object, some parameter of which is equal to the specified value. If
there are several such objects, the ID of the first found object is returned. If no such objects are found, 0 is returned.

Syntax for method invocation:

function GetObjectIdByParam (obj_type : String, obj_param : String, param_value : String)

Method arguments:

1. obj_type is a required argument. It specifies the type of system object, the ID of which you want to get.
2. obj_param is a required argument. It specifies the name of the parameter in the database, by the value of which you want to
search for the object.
3. param_value is a required argument. It specifies the required value of the object parameter.

Example. Find cameras with a black-and-white video image and set the Color parameter to 1 for them.

if ([Link] == "MACRO" && [Link]== "1" && [Link] == "RUN")

{
var id = GetObjectIdByParam("CAM","color","0"); //get the first object ID
while (id){ //while exist the Camera objects from which black-and-white image is received
SetObjectParam ("CAM", id, "color", "1"); //change the Color parameter for found object
id = GetObjectIdByParam("CAM","color","0"); //get the next object ID
}
}

275
The SaveToFile method
The SaveToFile method is used to save to a file the frame from the camera that is received in the data parameter of the FRAME_SENT
event.

Syntax for method invocation:

function SaveToFile (path: String, data: String, param : Boolean)

You can also save the frame using the GET_FRAME reaction of the CAM object. To do this, you must specify the path for saving the file
with the frame in the path parameter of this reaction. The FRAME_SENT event is created in the system if the GET_FRAME reaction
doesn't have the path parameter. In the data parameter of the FRAME_SENT event, the frame that must be saved using the
SaveToFile method is stored.

The reaction allows you to export a frame even if the camera is not displaying in the Video surveillance monitor.

Method argument:

1. path is a required argument. It specifies the full path to save the file with a frame.
2. data is a required argument. It specifies data to save to a file.
3. param is a required argument. It determines whether to transcode from base64 format before saving. Possible parameter
values:
a. true—transcode from base64 before saving;
b. false—save the string without transcoding.

Time of frame saving depends on the reference frame rate. The higher the reference frame rate, the shorter the time.

Example. When a frame is received from Camera 1, save it to the [Link] file on disk D:

if ([Link] == "CAM" && [Link] == "1" && [Link] == "FRAME_SENT")


{
SaveToFile("D:\\[Link]",[Link]("data"),true);
}

276
The GetLinkedObjects method
The GetLinkedObjects method is used to get the list of objects linked to the specified camera using the Objects link object (see Conne
ction of objects with cameras).

Syntax for method invocation:

function GetLinkedObjects(type1 : string, id : string, type2 : string)

Method argument:

1. type1 is the type of object for which you want to return the linked objects.
2. id is the identification number of an object for which you want to return the linked objects.
3. type2 is the type of linked objects which you want to return. If empty string is sent, linked objects of all types will be returned.

Example.

The Objects link object is configured in the following way:

Display in the debug window the list of objects linked to camera 1.

if ([Link] == "MACRO")
{

varmsgstr = GetLinkedObjects("CAM","1","MACRO")

DebugLogString("Linked objects " + msgstr);

As a result, the "Linked objects MACRO:1" message will be displayed in the script debug window.

277
The WriteIni method
The WriteIni method is used to write the string variable to the ini file.

Syntax for method invocation:

function WriteIni(varName: String, varValue: String, path: String)

Method argument:

1. varName is a required argument. It specifies the name of the variable for storing in the file.
2. varValue is a required argument. It specifies the value of the variable.
3. path is a required argument. It specifies the full path to the ini file in which the variable must be stored. Storage of variables
can be placed on the network resource. To do this, enter the network path in the argument.

Example. Write the MyVar variable to the \\fileserver\temp\[Link] file and set the "Hello world!" value to it. Then read the written
value and display it in the script debug window.

WriteIni("MyVar", "Hello world", "\\\\fileserver\\temp\\[Link]");


var result = ReadIni("MyVar","\\\\fileserver\\temp\\[Link]");
DebugLogString(result);

278
The ReadIni method
The ReadIni method is used to read values of the string variable in the ini file.

Syntax for method invocation:

function ReadIni (varName: String, path: String): String

Method arguments:

1. varName is a required argument. It specifies the name of the variable stored in the file.
2. path is a required argument. It specifies the full path to the ini file in which the variable is stored.

See example in The WriteIni method.

279
The AddIni method
The AddIni method is used to write, change and read integer variable from the ini file. The method returns the value of the variable
after its changing.

Syntax for method invocation:

function AddIni(varName: String, varValue: int, path: String): int

1. varName is a required argument. It specifies the name of the variable in the file.
2. varValue is a required argument. It specifies the value of the variable or the value which must be added to the existing value
of the variable:

a. If a variable with the varName name and a string value is stored in the file, the varValue value will be assigned to the
variable.
b. If there is no variable with the varName name in the file, such a variable will be created and the varValue value will be
assigned to it.
c. If there is a variable with the varName name in the file and it has an integer value or its value can be brought to the
integer type, the value will be brought to the integer type and the varValue value will be added to it.
3. path is a required argument. It specifies the full path to the ini file in which the variable must be stored. Storage of variables
can be placed on the network resource. To do this, enter the network path in the argument.

Example. There is no the MyVar variable in the C:\\[Link] file. Write to this file such a variable with the -1 value, then add 1 to it and
display the result value in the script debug window.

var result = AddIni("MyVar", -1, "C:\\[Link]");

result = AddIni("MyVar", 1, "C:\\[Link]");

DebugLogString(result);

280
The SetTimer method
The SetTimer method is used to start the timer.

Syntax for method invocation:

function SetTimer (id : int, milliseconds : int)

Method arguments:

1. id is a required argument. It specifies the timer ID. Possible values are int or string type.
2. milliseconds is a required argument. It specifies the period with which the timer will trigger if it is not stopped by the
KillTimer method. It is specified in milliseconds. Possible values: int type.

Example. Two seconds after the macro 1 is executed, start recording on camera 1.

if([Link]=="LOCAL_TIMER" && [Link]=="TRIGGERED" && [Link]==333) //you can specify Event.


SourceId == "333", that is use the string identifier type
{
var actuallyKilled = KillTimer(333);
if(actuallyKilled == 1)
{
DoReactStr("CAM","1","REC","");
}
}

if([Link]=="MACRO"&& [Link] == "1" && [Link] == "RUN")


{
SetTimer(333,2000); //333 - id, 2000 msec = 2 sec - period
}

281
The KillTimer method
The KillTimer method is used to stop the timer. It returns 1 if the timer was stopped as a result of the function execution.

Syntax for method invocation:

function KillTimer (id : int) : int

Method arguments:

1. id is a required argument. It specifies the timer ID. Possible values: int or string type.

Example. See in The SetTimer method.

282
The GetObjectChildIds method
The GetObjectChildIds method returns the identification (registration) numbers of the objects of the specified type that are below the
specified object in the object hierarchy.

Syntax for method invocation:

function GetObjectParentId(parent : String, id : String, objtype : String) : String[]

Method arguments:

1. parent is a required argument. It specifies the type of the system object which child objects you want to find out. Possible
values: String type, range is limited by object types registered in the system.
2. id is a required argument. It corresponds to the identification (registration) number of the object specified by the parent argu
ment. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in
the system.
3. objtype is a required argument. It specifies the type of the system object which is a child of the type specified by the parent
argument. Possible values: String type, range is limited by object types registered in the system.

Example. On macro 1, arm all cameras on the WS2 computer.

if ([Link] == "MACRO" && [Link] == "RUN" && [Link] == "1")


{
var children = GetObjectChildIds("SLAVE","DESKTOP-UBOS6BK","CAM");
ch=[Link](",");
for (i=0;i<[Link]; i++ )
{
DoReactStr("CAM",ch[i],"ARM","");
}
}

283
The Base64EncodeFile method
The Base64EncodeFile method is used to encode files using the Base64 scheme. The method returns a string.

See also The Base64Decode method and The SaveToFile method.

Syntax for method invocation:

function Base64EncodeFile (data_in: String): String

Method arguments:

1. data_in is a required argument. It specifies the path to the file that you want to encode.

Example. On macro 1, encode the [Link] file to Base64 and write it to the [Link] file.

if ([Link] == "MACRO" && [Link] == "1" && [Link] == "RUN")


{
var s = Base64EncodeFile("d:\\[Link]");
SaveToFile("d:\\[Link]",s, true);
}

284
The Base64EncodeW method
The Base64EncodeW method is used to encode a Unicode string using the Base64 scheme. The method returns a string.

See also The Base64Decode method.

Syntax for method invocation:

function Base64EncodeW (data_in: String): String

Method arguments:

1. data_in is a required argument. It specifies the string that you want to encode.

Example. Decode a string from Unicode to Base64, encode it back and display it in the debug string.

var test = Base64Decode


("MAAzAC0AMAA3AC0AMgAwADEAOQAgADEANQA6ADMAOQA6ADQAMAA6AA0ACgB0AGUAcwB0ACAAMQANAAoAMAAzAC0AMAA3AC0AMgAwADEAOQAgAD
EANQA6ADQAMgA6ADIAMQA6AA0ACgB0AGUAcwB0ACAAMgA=",true);
DebugLogString("----->"+test);
var res = Base64EncodeW(test);
DebugLogString("----->"+res);

If the Base64Decode method received the true parameter, the script will have the following output:

03-07-2019 15:39:40:
test 1
03-07-2019 15:42:21:
test 2

285
The run_cmd and run_cmd_timeout methods
The run_cmd method is used to execute commands on the command line from a script.

The run_cmd_timeout method is used to execute commands on the command line with the specified process termination timeout.

When invoking commands, the command line window does not open, the commands are executed in hidden mode.

Syntax for method invocation:

function run_cmd (cmd: String)


function run_cmd_timeout (cmd: String, timeout: int)

Method arguments:

1. cmd is a command for the command line.


2. timeout (only for run_cmd_timeout) is a command line process termination timeout after the command execution.

Example 1. Run the curl utility and send a POST request with the text "Hello" to the test URL [Link]

var s = run_cmd("curl --request POST --url [Link] --data \'Hello\'");


DebugLogString(s);

Example 2. Display the CPU usage on Chart 1, updating information on Timer 3.

var id = "1"; // id of the Charts object


var timer_id = "3"; // id of the Timer object to trigger the script
SLAVE_id = "DESKTOP-5397BVV"; // id of the Computer object

if ([Link] == "TIMER" && [Link] == "TRIGGER" && [Link] == timer_id)


{
var date = [Link]("date");
var time = [Link]("time");
var cpu = "for /f \"tokens=2* delims=^,\" %k in ('typeperf \"\\Processor Information(_Total)\\%
Processor Time\" -sc 1 ^| findstr \":\"') do echo %k";
var cpu_usage = run_cmd(cpu);
var cpu_usage2 = cpu_usage.replace(/\"/g,"");
var cpu_usage3 = cpu_usage2.replace(/\s/g,"");
DebugLogString(cpu_usage3);
DoReactStr("ANALOGCHART",id,"ANALOG_PARAMS","int_obj_id<"+id+">,parent_id<>,SLAVE_id<"+SLAVE_id+">,
objid<"+id+">,chan<5>,core_global<1>,text<"+cpu_usage3+">, min_val<0>,max_val<100>,sensor_id<cpu_usage>,time<"
+time+">,date<"+date+">");
}

286
The WriteIniAny method
The WriteIniAny method is used to write a string variable to an ini file. Unlike the WriteIni method, in the WriteIniAny method you can
specify the required file section for writing.

Syntax for method invocation:

function WriteIniAny(varName: String, varValue: String, path: String, section: String)

Method arguments:

1. varName is a required argument. It specifies the name of the variable for storing in the file.
2. varValue is a required argument. It specifies the value of the variable.
3. path is a required argument. It specifies the full path to the ini file in which the variable must be stored. Storage of variables
can be placed on the network resource. To do this, enter the network path in the argument..
4. section is a required argument. It specifies the name of the section of the ini file in which you want to write the variable.

Example. Write the MyVar variable to the "config" section of the C:\\Backup\\[Link] file, and set the "Hello world!" value to it. Then
read the written value and display it in the debug window of the script.

WriteIniAny("MyVar", "Hello world!", "C:\\Backup\\[Link]", "config");


var result = ReadIniAny("MyVar","C:\\Backup\\[Link]", "config");
DebugLogString(result);

287
The ReadIniAny method
The ReadIniAny method is used to read the values of a string variable in the ini file. Unlike the ReadIni method, in the ReadIniAny
method you can specify the required file section from which you want to read the variable.

Syntax for method invocation:

function ReadIniAny (varName: String, path: String, section: String): String

Method arguments:

1. varName is a required argument. It specifies the name of the variable stored in the file.
2. path is a required argument. It specifies the full path to the ini file in which the variable is stored.
3. section is a required argument. It specifies the name of the section of the ini file from which you want to read the variable.

See example in The WriteIniAny method.

288
The AddIniAny method
The AddIniAny method is used to write, change and read integer variable from the ini file. Unlike the AddIni method, in the AddIniAny
method you can specify the section of the file that contains the integer variable. The method returns the value of the variable after its
changing.

Syntax for method invocation:

function AddIniAny(varName: String, varValue: int, path: String, section: String): int

1. varName is a required argument. It specifies the name of the variable in the file.
2. varValue is a required argument. It specifies the value of the variable or a value which must be added to the existing value of
variable:
a. The varValue value will be assigned to the variable if there is a variable with the varName name and a string value in
the file.
b. If there is no variable with the varName name in the file, such a variable will be created and the varValue value will be
assigned to it.
c. If there is a variable with the varName name in the file and it has an integer value or its value can be brought to the
integer type, the value will be brought to the integer type and the varValue value will be added to it..
3. path is a required argument. It specifies the full path to the ini file in which the variable must be stored. Storage of variables
can be placed on the network resource. To do this, enter the network path in the argument.
4. section is a required argument. It specifies the name of the section of the ini file in which the variable is stored.

Example. There is no MyVar variable in the config section of the C:\\[Link] file. Write to this file such a variable with the -1 value,
then add 1 to it and display the result value in the script debug window.

var result = AddIniAny("MyVar", -1, "C:\\[Link]", "config");

result = AddIniAny("MyVar", 1, "C:\\[Link]", "config");

DebugLogString(result);

289
The MsgObject and Event objects and their built-
in methods and properties

290
The MsgObject and Event objects
The MsgObject object is a prototype (template) used to create objects. It implements methods and properties used to process system
events in Axxon PSIM. The methods and properties of the MsgObject object allow you to get information about system objects that
send or receive events, generate reactions for system objects, change their states, and so on.

You can invoke the methods and properties of the MsgObject object-prototype via the objects declared and initialized on its basis, or
via the Event static object.

The Event object is a static object that implements the interface for invoking the system events of Axxon PSIM. The Event object
provides access to the system event that started the script. All methods and properties of the MsgObject prototype are available
when working with the Event object.

You can declare (create) objects on the basis of the MsgObject prototype using the CreateMsg method of the Core object (see The
CreateMsg method).

291
The GetSourceType method
The GetSourceType method returns the system type of the MsgObject or Event object.

Syntax for method invocation:

function GetSourceType() : String

There are no method arguments.

Example. On macro 1, arm Detection Zones *.1 in the Day mode for cameras 1–4. On macro 2, arm Detection Zones *.2 in the Night
mode for cameras 1–4. On macro 3, arm Detection Zones *.3 in the Rain mode for cameras 1–4.

Note

The * charachter corresponds to identification number of a camera in the system (from 1 to 4).

if([Link]() == "MACRO" && [Link]() == "RUN")


{
var k;
//Switching the cameras to the Day mode by arming the *.1 detection zones
if([Link]() == "1")
{
for (k = 1; k<= 4; k = k+1)
{
DoReactStr("CAM_ZONE", k + ".1", "ARM", "");
DoReactStr("CAM_ZONE", k + ".2", "DISARM", "");
DoReactStr("CAM_ZONE", k + ".3", "DISARM", "");
}
}

//Switching the cameras to the Nigh mode by arming the *.2 detection zones
if([Link]() == "2")
{
for (k = 1; k<= 4; k = k+1)
{
DoReactStr("CAM_ZONE", k + ".1", "DISARM", "");
DoReactStr("CAM_ZONE", k + ".2", "ARM", "");
DoReactStr("CAM_ZONE", k + ".3", "DISARM", "");
}
}

//Switching the cameras to the Rain mode by arming the *.3 detection zones
if([Link]() == "3")
{
for (k = 1; k<= 4; k = k+1)
{
DoReactStr("CAM_ZONE", k + ".1", "DISARM", "");
DoReactStr("CAM_ZONE", k + ".2", "DISARM", "");
DoReactStr("CAM_ZONE", k + ".3", "ARM", "");
}
}
}

292
The GetSourceId method
The GetSourceId method returns the identification (registration) number of the MsgObject or Event object.

Syntax for method invocation:

function GetSourceId() : String

There are no method arguments.

Example. See the example in The GetSourceType method.

293
The GetAction method
The GetAction method returns the event received as an Event object or specified for a MsgObject object.

Syntax for method invocation:

function GetAction() : String

There are no method arguments.

Example. See the example in The GetSourceType method.

294
The GetParam method
The GetParam method returns the value of the specified parameter of the system object for the MsgObject or Event object.

Syntax for method invocation:

function GetParam(param: String) : String

Method arguments:

1. param is a required argument. It corresponds to the parameter name of the system object for which the MsgObject object
(or the Event static object) was created. Possible values: String type, range is limited by the parameters available for the
given object.

Note

If the object has no parameter with this name, then the method returns an empty string.

Example. When any event from any camera is registered, check from which computer the event comes. If the computer has the WS3
name, create the event copy in which the computer’s name is “Computer”.

if ([Link] == "CAM")
{
var msg = [Link]();
if ([Link]("SLAVE_id") == "WS3")
{
[Link]("SLAVE_id", "Computer");
NotifyEvent(msg);
}
}

295
The SetParam method
The SetParam method sets a value to the specified parameter of the MsgObject or Event object. The method changes only the
specified parameters of an object, other parameters remain unchanged.

Syntax for method invocation:

function SetParam(param : String, value : String)

Method arguments:

1. param is a required argument. It corresponds to the parameter name of the system object for which the MsgObject object
(or the Event static object) was created. Possible values: String type, range is limited by the parameters available for the
given object.
2. value is a required argument. It sets the value to the parameter specified in the param argument. Possible values: String
type, range depends on the set parameter.

Example. See the example in GetParam method.

296
The MsgToString method
The MsgToString method converts the MsgObject objects (including the Event static object) into a String variable.

Syntax for method invocation:

function MsgToString() : String

There are no method arguments.

Example. Send messages about all events registered for microphone 1 to a specified email address.

Note

The Short Messages Service must be installed and work properly.

if ([Link] == "OLXA_LINE" && [Link] == "1")


{
var msgstr = [Link]();
DoReactStr("MAIL_MESSAGE", "1", "SEND", "subject<Microphone 1>,body<" + msgstr + ">");
DoReactStr("MAIL_MESSAGE", "1", "SEND", "");
}

297
The StringToMsg method
The StringToMsg method converts a String variable into a MsgObject object.

Syntax for method invocation:

function StringToMsg(msg : String) : MsgObject

Method arguments:

1. msg is a required argument. It specifies a variable of the String type that you want to convert into a MsgObject object. Possibl
e values: variables of the String type that match the syntax of the MsgObject objects representation:

"objtype|id|action|param1<value1>,param2<value2>…", where

objtype is a type of system object;


id is an identification number of a system object;
action is an event or reaction of a system object;
param1<value1>,param2<value2> is a list of parameters with their values. Elements of the list are separated by commas
without spaces. If no parameters need to be specified, an empty string is used after the vertical line (|), for example: "CAM|1|M
D_START|"

Example. On alarm from Sensor 1 and 3, start recording audio from Microphone 1. On alarm from Sensor 2 or 4, start recording audio
from Microphone 2.

if ([Link] == "GRAY" && [Link] == "ALARM")


{
var audioid;
if ([Link] == "1" || [Link] == "3")
{
audioid = "1";
}
if ([Link] == "2" || [Link] == "4")
{
audioid = "2";
}
var str = "OLXA_LINE|"+audioid+"|ARM|";
var msg = CreateMsg();
[Link](str);
NotifyEvent(msg);
}

298
The StringToParams method
The StringToParams method converts a String variable into the list of parameters and overwrites the existing list of parameters of the
MsgObject object.

Syntax for method invocation:

function StringToParams(params: String)

Method arguments:

1. params is a required argument. It specifies a variable of the String type that you want to convert into a list of parameters of
the MsgObject object. Possible values: variables of the String type that match the syntax of the MsgObject objects
parameter list representation:

“param1<value1>,param2<value2>…”, where

param1<value1>,param2<value2> is a list of parameters with their values. Elements of the list are separated by commas without
spaces. If no parameters need to be specified, an empty string is used after the vertical line (|), for example: “CAM|1|MD_START|”

Example. When registering an Attach event for any of the cameras, re-initiate the Attach event in the system with changed values
of the Number of the PTZ device (telemetry_id) and Number of the microphone for synchronous recording (audio_id)
parameters. The values must be equal to the corresponding camera numbers plus 1.

if ([Link] == "CAM" && [Link] == "ATTACH")


{
var i;
for (i=1,i<=4;i=i+1)
{
var msg = [Link]();
var str = "telemetry_id<" + (i+1) +">,audio_id<" + (i+1) + ">";
[Link](str);
NotifyEvent(msg);
}
}

299
The Clone method
The Clone method creates a copy of a MsgObject and Event object.

Syntax for method invocation:

function Clone() : MsgObject

There are no method arguments.

Example. When relay 1 closes, start video recording on camera 1 and close relay 2. When relay 1 opens, start video recording on
camera 2 and open relay 2.

if ([Link] == "GRELE" && [Link] == "1")


{
var msgevent = [Link]();
if([Link] == "ON")
{
[Link] = "2";
DoReact(msgevent);
DoReactStr("CAM","1","REC","");
DoReactStr("GRELE","2","ON","");

}
if([Link] == "OFF")
{
[Link] = "2";
DoReact(msgevent);
DoReactStr("CAM","2","REC","");
DoReactStr("GRELE","2","OFF","");

}
}

300
The GetObjectIds method
GetObjectIds method is responsible for receiving identifiers from all objects of a specified type.

Syntax for method invocation:

function GetObjectIds(objectType : String)

Method arguments:

1. objectType is a required argument. It specifies the type of the system object for which you want to return the value of the
specified parameter (CAM, GRAY, GRABBER, and so on). Possible values: String type, range is limited by object types
registered in the system.

A string is returned:

CAM||COUNT|id.3<5>,[Link]<4>,id.0<2>,id.1<3>,id.2<4>

where

[Link]<> is a number of objects IDs,


id.[number]<> is an object ID.

Example. On Macro 1, all cameras must be armed.

if ([Link] == "MACRO" && [Link] && [Link] == "RUN")


{
var msg = CreateMsg();
[Link](GetObjectIds("CAM"));
var objCount = [Link]("[Link]");
var i;
for(i = 0; i < objCount; i++)
{
DoReactStr("CAM", [Link]("id." + i), "ARM", "");
}
}

301
The GetObjectParams method
GetObjectParams method is used to get the parameters of an object.

Syntax for method invocation:

function GetObjectParams(objectType : String, objectId : String)

Method arguments:

1. objectType is a required argument. It specifies the type of the system object (CAM, GRAY, GRABBER, and so on) for which
you want to return the type of the parent object. Possible values: String type, range is limited by object types registered in the
system.
2. objectId is an object’s identifier. Possible values: String type.

Example. On macro 1, check the color control of camera 2. If camera 2 is a color one, set it to recording.

if ([Link] == "MACRO" && [Link] && [Link] == "RUN")


{
var msg = CreateMsg();
[Link](GetObjectParams("CAM", "2"));
if([Link]("color") == "1")
{
DoReactStr("CAM", "2", "REC", "");
}
}

302
The SourceType property
The SourceType property allows you to return and set the system type for the MsgObject or Event object.

Syntax for property invocation:

SourceType : String

Example. When relay 1 closes (for example, the button connected to the relay is pressed), print the frames from cameras 1 and 2.

if ([Link] == "GRELE" && [Link] == "1" && [Link] == "ON")


{
//activating the Camera 1 Surveillance window
DoReactStr("MONITOR","1","ACTIVATE_CAM", "cam<1>");
//printing the frame from Camera 1
DoReactStr("MONITOR","1","KEY_PRESSED","key<PRINT>");
//activating the Camera 2 Surveillance window
DoReactStr("MONITOR","1","ACTIVATE_CAM", "cam<2>");
//printing the frame from Camera 2
DoReactStr("MONITOR","1","KEY_PRESSED","key<PRINT>");
}

303
The SourceId property
The SourceType property allows you to return and set the identification number for the MsgObject or Event objects.

Syntax for property invocation:

SourceId : String

See the example in The SourceType property.

304
The Action property
The Action property allows you to return and set a reaction or event for the MsgObject or Event objects.

Syntax for property invocation:

SourceId : String

See the example in The SourceType property.

305
Programming guide. Conclusion
For more information about Axxon PSIM, see:

1. Administrator’s Guide: configuring system objects in the interface.


2. Operator’s Guide: working with Axxon PSIM.
3. Installing and configuring security system components guide: installing and configuring hardware (cameras, alarm systems,
access control systems, and so on).

If you have any difficulties and problems while working with this software product, you can contact us. Before contacting us, we kindly
ask you to answer the following questions:

1. What is the problem?


2. When did the problem occur and what had happened before it occurred?
3. Under what conditions does the problem occur?

The more detailed and precise information you give us, the faster our experts will resolve your problem.

We are striving to improve the quality of our products, and hence welcome any suggestions and comments regarding the operation of
our software and its documentation.

306

You might also like