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

In this page:



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



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

Supported Languages

LanguageBest ForPerformanceKey Features
C#Complex logic, performance-critical operationsExcellentFull .NET access, strongly typed, IntelliSense
VB.NETLegacy systems, simple automationExcellentFamiliar syntax, .NET access
PythonData analysis, ML integrationGoodExtensive 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)

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 ScriptReferencesInclude external librariesImport 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

In this section...