Lamps Compare — PLC Control Template
Shared by TSIMEREZIVO Team · 4 Oct 2026 · 41 views
# Lamps Compare — Usage Guide
## Overview
Three-state lamp indication based on a process value crossing low and high thresholds.
## Commissioning
1. Set thresholds to the required process bands
2. Verify transitions occur cleanly at the desired values
---
## Control Logic — Vendor-Agnostic Pseudocode
# Lamps Compare — Logic
## Standards: IEC 61131-3
## Scan Rate: 100ms | Pattern: compare input value to lamp thresholds
```
ROUTINE: LampsCompare
SCAN_RATE: 100ms
LAMP_LOW := VALUE_PV < THRESH_LOW
LAMP_MID := VALUE_PV >= THRESH_LOW AND VALUE_PV < THRESH_HIGH
LAMP_HIGH := VALUE_PV >= THRESH_HIGH
HMI_VALUE := VALUE_PV
END_ROUTINE
```
---
## Tag List
```csv
Tag Name,Description,Data Type,Direction,Engineering Unit,Range Min,Range Max,Default Value,Address
VALUE_PV,Compared Process Value,REAL,input,,0,1000,0,AI:0:0.0
THRESH_LOW,Low Threshold,REAL,internal,,0,1000,30,
THRESH_HIGH,High Threshold,REAL,internal,,0,1000,70,
LAMP_LOW,Low Lamp Output,BOOL,output,,,,FALSE,DO:1:0.0
LAMP_MID,Mid Lamp Output,BOOL,output,,,,FALSE,DO:1:0.1
LAMP_HIGH,High Lamp Output,BOOL,output,,,,FALSE,DO:1:0.2
HMI_VALUE,HMI: Compared Value,REAL,output,,0,1000,0,
```
---
## Alarm Matrix
```csv
Alarm Tag,Condition,Setpoint,Priority,Type,Response,Delay,Auto Acknowledge
ALM_NONE,No active alarms defined for threshold lamp comparator,N/A,low,diagnostic,Add process alarms separately if required by the application.,0s,Yes
```