1. Home
  2. /
  3. Citect-scada-scripting
  4. /
  5. Start/Stop Process Script

Start/Stop Process Script - Citect-scada-scripting Typing CST Test

Loading…

Start/Stop Process Script — Citect-scada-scripting Code

Start or stop a process based on operator input.

	IF Input('StartButton') THEN
		ProcessStart('Pump1');
	ELSIF Input('StopButton') THEN
		ProcessStop('Pump1');
	END_IF;

Citect-scada-scripting Language Guide

Citect SCADA Scripting is the scripting environment within Citect SCADA (by AVEVA) used to automate, customize, and extend SCADA applications. It enables control logic, event handling, alarms, and user interface interactions through a structured scripting language.

Primary Use Cases

  • ▸Dynamic tag manipulation and calculation
  • ▸Custom alarm management and notifications
  • ▸Automated data logging and reporting
  • ▸HMI screen interactivity and conditional visualization
  • ▸Integration with PLCs, OPC servers, and databases

Notable Features

  • ▸High-level scripting within SCADA environment
  • ▸Access and manipulate process tags in real time
  • ▸Event-driven triggers for alarms or I/O changes
  • ▸Customizable HMI interaction via scripts
  • ▸Database interaction for historical or real-time data

Origin & Creator

Developed by Citect (later acquired by Schneider Electric, now AVEVA) in the 1980s to provide a flexible scripting solution for SCADA systems, allowing engineers to extend HMI/SCADA functionality beyond prebuilt objects.

Industrial Note

Citect scripting is essential for custom alarm handling, complex process logic, and advanced HMI behaviors where the standard SCADA configuration cannot meet specific operational requirements.

Quick Explain

  • ▸Citect SCADA scripting allows automation beyond graphical configuration of SCADA objects.
  • ▸Supports structured programming with variables, loops, conditionals, and functions.
  • ▸Enables dynamic control of tags, alarms, historical data logging, and HMI screens.
  • ▸Facilitates integration with PLCs, databases, and external systems via OPC or native drivers.
  • ▸Widely used in industrial automation for process control, monitoring, and visualization.

Core Features

  • ▸IF/ELSE, FOR, WHILE constructs for logic control
  • ▸User-defined functions for modular scripting
  • ▸Tag read/write access for real-time control
  • ▸Alarm and event scripting
  • ▸Integration with external systems via COM, OPC, or database connections

Learning Path

  • ▸Learn Citect SCADA basics and tag configuration
  • ▸Understand Cicode syntax and structure
  • ▸Practice event-driven scripting and alarm handling
  • ▸Integrate HMI screens with scripts
  • ▸Advance to multi-system SCADA automation projects

Practical Examples

  • ▸Automatically updating screen color based on process state
  • ▸Custom alarm escalation and notification logic
  • ▸Historical data logging based on process triggers
  • ▸Dynamic tag calculations for process optimization
  • ▸Integration with SQL database for reporting and analytics

Comparisons

  • ▸Cicode vs PLC Ladder Logic: SCADA-centric vs controller-centric
  • ▸Cicode vs VBScript/JavaScript: SCADA runtime integration
  • ▸Cicode vs Python: performance vs flexibility in SCADA
  • ▸Cicode vs KAREL: general process vs CNC/robot automation
  • ▸Cicode vs standard HMI configuration: dynamic scripting vs static screens

Strengths

  • ▸Extends SCADA functionality without modifying core system
  • ▸Supports modular, reusable scripts
  • ▸Enables dynamic and event-driven control
  • ▸Strong integration with HMI and PLCs
  • ▸Well-documented and widely used in industry

Limitations

  • ▸Proprietary to Citect SCADA
  • ▸Steep learning curve for beginners
  • ▸Debugging can be challenging without simulation
  • ▸Complex scripts may impact SCADA performance
  • ▸Integration with non-supported systems may require middleware

When NOT to Use

  • ▸Non-Citect SCADA systems
  • ▸Simple static HMI without dynamic behavior
  • ▸Extremely resource-limited SCADA runtime
  • ▸Projects requiring full cloud-native automation
  • ▸Use of high-level AI/ML directly in SCADA

Cheat Sheet

  • ▸SETTAG(tag, value) - set a SCADA tag value
  • ▸GETTAG(tag) - read a SCADA tag value
  • ▸IF … ELSE … ENDIF - conditional logic
  • ▸FOR … NEXT / WHILE … ENDWHILE - loops
  • ▸Function … END_FUNCTION - reusable script block

FAQ

  • ▸Can Cicode run outside Citect SCADA? -> No, it is SCADA runtime-dependent.
  • ▸Does Cicode support databases? -> Yes, via built-in DB functions or SQL interface.
  • ▸Can Cicode manipulate HMI screens? -> Yes, dynamic updates and interactions are supported.
  • ▸Is Cicode difficult to learn? -> Requires SCADA understanding but scripting is similar to standard languages.
  • ▸Does Cicode support external device integration? -> Yes, via OPC, COM, or drivers.

30-Day Skill Plan

  • ▸Week 1: Basic tag read/write scripts
  • ▸Week 2: Conditional logic and loops
  • ▸Week 3: Event handling and alarms
  • ▸Week 4: HMI screen scripting
  • ▸Week 5: Database integration and advanced projects

Final Summary

  • ▸Citect SCADA scripting enables automation, event handling, and dynamic HMI behavior.
  • ▸Supports structured programming with real-time process integration.
  • ▸Enhances operator interfaces and alarm management.
  • ▸Widely used in industrial process control and automation.
  • ▸Integrates with PLCs, databases, and external systems for complete SCADA solutions.

Project Structure

  • ▸Main Citect project files (.CFG, .PRJ)
  • ▸Cicode script files (.CI)
  • ▸Tag database and alarm configuration
  • ▸HMI screen configuration files
  • ▸External database or OPC configuration

Monetization

  • ▸SCADA automation consulting
  • ▸Custom Citect scripting services
  • ▸HMI and alarm optimization solutions
  • ▸Training and simulation services
  • ▸Integration with MES and industrial IoT

Productivity Tips

  • ▸Use functions to reduce repetitive code
  • ▸Test scripts in simulation first
  • ▸Keep tag names and variables consistent
  • ▸Optimize loops and event handling
  • ▸Document logic, parameters, and workflows

Basic Concepts

  • ▸Tag - variable representing process data
  • ▸Event - trigger that executes a script
  • ▸Alarm - condition monitored and reported via SCADA
  • ▸Function - reusable block of script code
  • ▸Screen Object - HMI element manipulated via script

Official Docs

  • ▸https://www.aveva.com/en/products/citect-scada/
  • ▸https://documentation.aveva.com/CitectSCADA
  • ▸https://community.aveva.com

More Citect-scada-scripting Typing Exercises

Alarm Handling ScriptAverage Sensor Value

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher