Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Image AddedScripts Module Overview

he Scripts module enables server-client programming and parallel execution using .NET (C#, VB.NET) and Python 3, providing the foundation for high-performance custom logic and data processing.


The Scripts Module enables the easy creation of server-client programming and parallel execution. Allowing interoperability of .NET (C#, VB) and Python 3, it it the foundation module to hight performance and flexible application. 

The Script Module implements:

  • Tasks: code execute in reaction to events, or time-based.
  • Classes: Library of methods for server and client execution 
  • Expressions: optimized event execution or tags changes, and other trigger conditions. 

On this Page:

Table of Contents
maxLevel2
minLevel2
excludeIntroductionOverview


Key Concepts

  • *ScriptTask*:
Defines code
  • Code that executes in
reaction to an event (trigger) or periodically at specified intervals.
  • ScriptClass A library of functions and methods that can be used in Script Tasks, Expressions, or from the Code Behind on graphical Displays.
  • ScriptExpression: One line of code in response to an event, when the entire script isn't necessary.Script
  • References:  External DLLs included for a script or display code compilation.
    • response to events or time-based triggers
    • *ScriptClass*: Library of reusable methods for server and client execution
    • *ScriptExpression*: Single-line code for simple event responses
    • *References*: External DLLs included for script compilation

    What It Does

    • Executes custom business logic and data processing
    • Provides server-side and client-side code execution
    • Handles event-driven and time-based automation
    • Enables data normalization and enrichment
    • Integrates with third-party .NET and Python libraries
    • Supports multi-threaded parallel execution

    Configuration Workflow

    Scripts Module

    configuration workflow

    Configuration Workflow

    Step

    Action

    Comments

    Description

    Create ScriptClasses

    Create a library of functions to

    Build function libraries

    Define reusable methods for your solution

    Create ScriptTasks

    Implement

    the

    business logic

    and

    Add data

    normalization, and data enrichment

    processing and automation code

    Create ScriptExpressions

    For

    Add simple

    event or time driven actions, use simples Expressions.

    actions

    Single-line responses to events

    Add References

    Include external libraries

    Import DLLs for extended functionality



    Runtime Behavior

    Execution Environment

    The server creates dedicated processes with multi-threading to execute tasks and expressions based on configured triggers. Each process runs in isolated application domains for security and

    Runtime Execution

    The server computer open a process and multi-threads to execute all tasks, and expressions, according the triggers and time-cycles. 

    A Service is created to allow Client Displays, and other distributed modules, to request server side execution of classes.

    Build-in diagnostic tools, including performance monitoring of each task, enable fine-tuning for reliable performance.



    Features Highlights

    Built-in Code Editor

    Our platform features an integrated script editor designed for developers to craft custom functionality for the application. This editor offers a robust set of tools to aid in testing and evaluating scripts. Debugging capabilities include setting breakpoints, stepping into and over code, executing line by line, and monitoring object values as they change with each step. Our code editor supports multiple languages such as C#, VB.NET, JavaScript, and Python, as well as XML and JSON documents.

    Server and Client Domains

    With our platform’s script editor, you have the flexibility to create scripts that execute either on the server for global accessibility or on the client side for local execution.

    Tasks, Classes and Expressions


    Module Highlights

    • Built-in Code Editor: Our code editor supports C#, VB.NET, JavaScript, and Python languages.

    • Server and Client Domains: Create scripts that execute on the server for global reach or on the client side for local reach.

    • Events and Scheduling: Tasks and expressions can be triggered by date, time, condition, calendar, tag change, or interval. Execution is distributed among processes, each running in its own application domain, isolated from the real-time database, ensuring maximum system security and performance.

    • Object Orientation and Solution Object: All solution objects, including tags, datasets, alarms, devices, and communication statuses, are immediately accessible via IntelliSense as native .NET objects. No temporary tags or function calls are required. With a single command, move data from tags to .NET objects and external data tables.

    • Configure Your Python Interpreter: The Scripts Module delivers exceptional scripting capabilities across various programming languages with seamless integration of Python. You can configure any version of the Python interpreter for each project.

    You have the option to create tasks, .NET classes, and function libraries. Sometimes, it's more efficient or preferable to create one-line expressions instead of full methods. For this purpose, our platform offers an expression editor that grants access to all .NET operands and classes.

    C#, VB.NET, Python and Javascript

    Our platform supports industry-standard languages like C#, Python, JavaScript, and VB.NET, so engineers no longer have to struggle with old proprietary, single-threaded, or interpreted scripting editors. You can also translate your code between C# and VB.NET anytime.  

    Events and Scheduling 

    You can trigger tasks and expressions to execute based on various factors like date, time, conditions, calendar events, tag changes, or intervals. The execution is distributed among processes, with each running in its own application domain, isolated from the real-time database. This ensures maximum system security and performance.

    Object Orientation, Project Elements

    You can access all project elements such as Tags, Datasets, Alarms, and devices instantly through IntelliSense, as they are native .NET objects. There's no need for temporary tags or function calls. With just one command, you can seamlessly transfer data from Tags to .NET objects and external Data-tables.

    Configure your Python Interpreter

    The Script module seamlessly integrates Python language and applications, providing exceptional scripting capabilities across various programming languages. You also have the flexibility to configure any version of the Python interpreter for each project.


    The Scripts Module allows:

    • Multi-Threaded Task Execution
    • Event-Driven Actions 
    • Library Creation for Methods and Classes
    • Intermixing C#, VB.NET and Python classes.
    • Integration with Third-Party Libraries.