General Script Configuration
General Script Configuration
General scripts are used to automate repetitive tasks, perform custom calculations, and manage complex workflows in your projects.
In the sections below, you will find all critical topics, from mandatory language rules to performance management and Tag access, required when preparing General Scripts.
Includes the mandatory class (MainClass) and method (Main) definitions and the basic code skeleton required in C# and Visual Basic (VB) languages for your scripts to compile and run.
2. Compilation and Execution Time
Contains important information regarding script performance. Explains how to monitor script compilation and execution times in milliseconds and how optimization processes affect the time during the first run.
3. External Reference (DLL) Usage
Explains how to include external libraries (DLLs) in your project to go beyond SCADA’s built-in functions. Configuration processes for both ready-made references and manually added DLLs are covered under this heading.
4. Synchronous and Asynchronous Operation Modes
This is the most critical performance setting determining the script’s operating principle. You will learn the differences between Synchronous (sequential and blocking) and Asynchronous (parallel and continuous) modes, when to choose which, and how to prevent incorrect execution using the Done bit control in asynchronous scripts.
Examines two different methods for data exchange between Scripts and SCADA Tags: Defining as a Class Member (Public Member) and instant access via Functions (TagRead/TagSet). The differences, advantages, and use cases of these two methods are explained in detail.
6. Tag Types
Shows the equivalents of data types from the PLC programming world (BOOL, DINT, REAL, etc.) in C# and VB languages and which notations are accepted. Also explains how to correctly convert between HEX values and numeric values.
7. StorageArray
Covers the management of data and the use of the StorageArray structure, which allows you to store temporary data, status information, or objects between script executions.
Explains how to call built-in SCADA functions (e.g., Alarm triggering, logging, etc.) from within a script and how to safely pass Tag values, constants, and other parameters to these functions using four different methods.
