Versions Compared

Key

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

Image ModifiedScripts Module

Overview

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

Scripts Module links: How-to Guide, Reference 

Image Removed

(Concept) provides the automation intelligence layer for FrameworX solutions, enabling custom business logic, data processing, and system integration through modern programming languages.

Image Added

In this page

PanelborderWidth1borderStylesolidtitleOn this Page

:

Table of Contents
maxLevel2
minLevel2
indent10px
excludeSteps
stylenone




Scripts → Tutorial | Concept | How-to Guide | Reference



Key Concepts

*
  • ScriptTask
*: Code that executes in response to events or time-based triggers
  • *ScriptClass*: Library of reusable methods for server and client execution
    • : Script unit triggered by events or timers for automated execution
    • ScriptClass: Reusable C#/VB.NET/Python class library used by scripts and displays
    • ScriptExpression
    *ScriptExpression*
    • : Single-line
    code
    • expression for
    simple
    • lightweight event
    responses*References*: External DLLs included for script compilation
    • -driven actions
    • ScriptReference: External .NET assemblies referenced by scripts and displays

    What It Does

    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.  It implements:

    through:

    • Event-Driven Automation - Execute code in response to tag changes, alarms, or system events
    • Time-Based Processing - Run tasks on schedules, intervals, or specific times
    • Reusable Libraries - Create method collections for consistent calculations across the solution
    • Expression Evaluation - Perform simple calculations and updates without full task overhead
    • External Integration - Import
    • 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. 

  • 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 assemblies and Python
    libraries
  • Supports multi-threaded parallel execution
    • packages
    • Multi-Threaded Execution - Run tasks in parallel for maximum performance

    Configuration Workflow

    Scripts Module

    Configuration Workflow

    StepActionDescription
    Create ScriptClassesBuild function librariesDefine reusable methods for your solution
    Create ScriptTasksImplement business logicAdd data processing and automation code
    Create ScriptExpressionsAdd simple actionsSingle-line responses to events
    Add
    References
    ScriptReferencesInclude external librariesImport 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 performance.

    Client-Server Architecture

    A service enables client displays and distributed modules to request server-side class execution, providing centralized logic accessible from any client

    Scripts execute primarily server-side for consistency across all clients. Client-side execution available for WPF displays when web compatibility not required.

    Performance Monitoring

    Built-in diagnostics track execution time, CPU usage, and error states for each task, enabling

    performance

    optimization and troubleshooting.

    Features

    Feature Highlights

    *
    • Multi-Language Support
    *
    • - C#, VB.NET, and Python 3
    , and JavaScript
    • in a single solution
    *
    • Integrated Code Editor
    *
    • - IntelliSense, debugging, breakpoints, and step-through execution
    *
    • Server and Client Domains
    *
    • - Scripts execute globally (server) or locally (client)
    *
    • Flexible Triggers
    *
    • - Date, time, condition
    , calendar
    • , tag change, or interval-based execution
    *
    • Native Object Access
    *
    • - Direct IntelliSense access to tags, datasets, alarms as .NET objects
    *
    • Python
    Configuration*
    • Integration - Configure any Python interpreter version per project
  • *Isolated Execution* - Scripts run separate from real-time database for stability
  • *
    • Code Translation
    *
    • - Convert between C# and VB.NET
    anytime
    • automatically
  • *Third-Party Integration* - Import and use external .NET assemblies and Python packages
  • *
    • Exception Protection - Automatic error handling prevents script failures from affecting system
    • Multi-Threaded Processing
    *
    • - Parallel task execution
    for maximum performance
    • with thread pool management

    In this section...

    Page Tree
    root@parent
    spaces93DRAF