Scripts Module
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.
(Concept) provides the automation intelligence layer for FrameworX solutions, enabling custom business logic, data processing, and system integration through modern programming languages.
In this page
:
Table of Contents maxLevel 2 minLevel 2 indent 10px exclude
Steps style none
Key Concepts
*- ScriptTask
- : Script unit triggered by events or timers for automated execution
- ScriptClass: Reusable C#/VB.NET/Python class library used by scripts and displays
- ScriptExpression
- : Single-line
- expression for
- lightweight event
- -driven actions
- ScriptReference: External .NET assemblies referenced by scripts and displays
What It Does
The Scripts Module enables server-client programming and parallel execution 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
- third-party .NET assemblies and Python
- packages
- Multi-Threaded Execution - Run tasks in parallel for maximum performance
Configuration Workflow
Scripts Module Configuration Workflow | ||
---|---|---|
Step | Action | Description |
Create ScriptClasses | Build function libraries | Define reusable methods for your solution |
Create ScriptTasks | Implement business logic | Add data processing and automation code |
Create ScriptExpressions | Add simple actions | Single-line responses to events |
Add | ||
ScriptReferences | 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 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 asClient-Server Architecture
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 optimization and troubleshooting.
Feature Highlights
- Multi-Language Support - C#, VB.NET,
- and Python
- 3 in a single solution
- Integrated Code Editor - IntelliSense, debugging, breakpoints, and step-through execution
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
- - Scripts execute globally (server) or locally (client)
- Flexible Triggers - Date, time, condition
- , tag change, or interval
- -based execution
- Native Object Access - Direct IntelliSense access to tags, datasets, alarms
- as
- .
- NET objects
- Python Integration - Configure any Python interpreter version per project
- Code Translation - Convert
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 automatically
- Exception Protection - Automatic error handling prevents script failures from affecting system
- Multi-Threaded Processing - Parallel task execution with thread pool management
In this section...
Page Tree | ||||
---|---|---|---|---|
|
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: