Changes (4)

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.

h2. IEC 6-1131-3 Logic

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].

h2. Mimic ActiveScript

Scripting on mimics run at the client within ViewX and uses the Microsoft ActiveScript component to function. Various languages are supported however VBScript and JavaScript are the two common languages used and both available on most clients by default. Additional languages can be downloaded and installed, although for ease of maintenance/deployment not recommended.

Installing the Microsoft Script Debugger, available on the ClearSCADA DVD, is recommended to allow the debugging of scripting.

h2. Comparison

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||

|Execution|Server-side|Client-side| |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|

|Security|Requires configuration permission to create and edit, runs within the context of the server|Requires configuration permission to create and edit, runs within the context of the logged in user|

|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| |Ease of Learning|If you are used to PLC coding it is a similar concept; different to typical IT type coding|Uses Microsoft ActiveScript so a large choice of languages including VBScript and JavaScript. Plenty of resources online for reference|