ClearSCADA supports common programming within the core ClearSCADA product using IEC logic and scripting on mimic. These programming environments function very differently to each other and choosing one over the other can be an important decision in terms of stability, accuracy and functionality. This article details some of the common differences between the two.
Logic runs within the server and comes in a number of flavours such as function blocks, sequential function charts and structured text. Each flavour has its own strengths and weaknesses are discussed at Comparison of Logic Languages.
Installing the Microsoft Script Debugger, available on the ClearSCADA DVD, is recommended to allow the debugging of scripting.
The following table covers various characteristics of programming and database design with an aim to guide users on the suitability of the environment for purpose:
|Characteristic||Within Logic||Within Scripting|
|Reliability||Always runs (whilst the logic driver is running)||Requires user to be logged in and to display a suitable mimic. Susceptible to network failure between client and server|
|Permissions||Requires configuration permission to create and edit||Requires configuration permission to create and edit|
|Security Context||Runs within the context of the ClearSCADA server||Runs within the context of the current user, both ClearSCADA and Windows environments|
|Threading||Single thread running on the server, execution cannot be aborted however refer to Logic Execution for parallel handling of inputs and outputs||Single thread running on each client, execution can be aborted by other scripting or by the user|
|Execution Performance||Extremely quick, although care should be taken with SQL queries as they may significantly impact server availability due to the query itself or the frequency of the query execution||Slower than logic, subject to bandwidth issues and latency on the network due to the server calls, and to both overall client and server performance|
|User Interface||No interface, dialogue when manually executed asking for any input parameters||Basic form functionality and the ability to interact with mimics|
|ClearSCADA Documentation||Standard IEC 6-1131 language not documented, software engineering concepts not documented, extended blocks and usage within ClearSCADA is documented||Standard language and software engineering not documented, custom objects documented. Documented examples are in VBScript|
|Data Type||Strongly typed||Weakly typed (language dependent)|
|Error Checking||Syntax and object reference at compile time, no exception handling in code||Syntax checks are compile time, object references during runtime, exception handling in code (i.e. On Error in VBScript)|
|File Handling||Limited ability to write to files (and COM ports)||Extensive functions using any installed COM libraries, for example FileSystemObject|