Learn CITECT-SCADA-SCRIPTING with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Alarm Handling Script
IF Alarm('HighLevel').Active THEN
Message('High level detected!');
ValveClose('VLV1');
END_IF;
Trigger an action when a process alarm occurs.
2
Start/Stop Process Script
IF Input('StartButton') THEN
ProcessStart('Pump1');
ELSIF Input('StopButton') THEN
ProcessStop('Pump1');
END_IF;
Start or stop a process based on operator input.
3
Average Sensor Value
Sum := 0;
FOR i := 0 TO SensorArraySize-1 DO
Sum := Sum + SensorArray[i];
END_FOR;
Average := Sum / SensorArraySize;
Calculate the average of an array of sensor readings.