The Scripts Module enables server-client programming.
Modules → Scripts | Tutorial | How-to Guide | Reference
Scripts Module Overview
It provides the automation intelligence layer for FrameworX solutions, enabling custom business logic, data processing, and system integration through modern programming languages.
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
- AI Tool Creation - Define custom MCP tools in Script Classes that AI models can invoke through MCP for Runtime
- Machine Learning - Deploy and execute ML models using Python with NumPy, Pandas, and scikit-learn
Supported Languages
Language | Best For | Performance | Key Features |
|---|---|---|---|
C# | Complex logic, performance-critical operations | Excellent | Full .NET access, strongly typed, IntelliSense |
VB.NET | Legacy systems, simple automation | Excellent | Familiar syntax, .NET access |
Python | Data analysis, ML integration | Good | Extensive libraries, NumPy/Pandas support |
Quick Selection Guide:
Maximum performance and reliability → C#
Legacy VB code migration → VB.NET
Data science or ML requirements → Python
Simple expressions → Any language (all are supported in expressions)
It's preferable to write C# target the .NET Standard 2.0, so your code to run directly in any .NET version.
Ir order to accomplish that, you need to setup your tools (or guide the AI) to use C# version 7.3.
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
Scripts can execute in both server and client contexts based on configuration needs. The platform manages dedicated processes with multi-threading for tasks and expressions, running them in isolated application domains for security and reliability. Built-in diagnostics track execution time, CPU usage, and error states, enabling performance optimization and troubleshooting.
Feature Highlights
Multi-Language Support - Mix C#, VB.NET, and Python 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, 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 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
- MCP for Runtime Tools - Script Classes expose methods as AI-callable tools for intelligent automation
- ML NET and Python ML - Integrate trained models for anomaly detection, predictions, and pattern recognition
- Bundled Libraries (New in 10.1.5) - Email and SMS sending libraries are included out of the box, with no manual ScriptReference setup required. Script Classes are also auto-injected into display code-behind for direct invocation from display logic.
→ Modules / Business Operations / Scripts Module → Tutorials / Business Operations / Scripts Module Tutorial → How-to Guides / I Business Operations / Scripts Module How-to Guide → Technical Reference / Business Operations / Scripts Module ReferenceScripts Module Links
Explanation - to understand concepts
Tutorials - to learn by doing
How-to Guides - to accomplish specific tasks
Reference - technical details
In this section...