---
title: Edge Server Data Processors
description: Learn how to use Value Transforms, Virtual Variables, and Triggers to process and automate data on the ControlCom Edge Server.
source: https://documentation.controlcomtech.com/build/edge-server/data-processors
---

# Edge Server Data Processors

The ControlCom Edge Server can process data before it leaves the site. Value Transforms change a reading as it is read, Virtual Variables compute new values from existing ones, and Triggers act when a condition is met. This page covers all three.

> **Workflow Stage: Collect**

## Prerequisites

This guide requires the ControlCom Edge Server to be onboarded and configured with at least one device. See our [Onboarding Guide for the Edge Server](https://documentation.controlcomtech.com/build/edge-server/getting-started) and [Reading Modbus Data](https://documentation.controlcomtech.com/build/edge-server/clients/modbus) guides to get started.

## Value Transforms

Value Transforms modify the read value from a device item **before** it is sent to the platform. They allow you to apply calculations, conversions, or transformations to raw device data.

### Key Features

* Multiple transforms can be **chained** on a single item (executed in rank order 1-999)
* Each transform receives the output of the previous transform as its input
* Uses a special `{{READ_VALUE}}` variable that references the current value in the chain
* Supports complex expressions including unit conversions, thresholds, and formulas

### Navigation

**Path:** Administration > Devices > \[Select Device] > Edge Server tab > \[Select Modbus Client] > \[Select Modbus Item] > **Transforms Tab**

### Creating a Value Transform

1. Navigate to a Modbus Item's **Transforms** tab
2. Click **"+ Add Transform"**
3. Fill in the required fields:

| Field           | Description                                                          |
| --------------- | -------------------------------------------------------------------- |
| **Name**        | Display name for the transform                                       |
| **Rank**        | Execution order (1-999). Lower numbers execute first                 |
| **Description** | What this transform does                                             |
| **Expression**  | The transformation logic using `{{READ_VALUE}}` and device variables |
| **Enabled**     | Toggle to activate/deactivate                                        |

### Example Expressions

```javascript
// Unit conversion (pounds to kilograms)
{{READ_VALUE}} * 0.453592

// Threshold to boolean
{{READ_VALUE}} > 100 ? 1 : 0

// Using device variables
{{READ_VALUE}} * {{calibration_factor}} / 100
```

### Real-World Use Cases

**Temperature Sensor Calibration**
Raw sensor reads 23.5°C but needs +0.8°C offset:

```javascript
{{READ_VALUE}} + 0.8
```

**Pressure Unit Conversion (PSI to Bar)**
Device reports in PSI, platform needs Bar:

```javascript
{{READ_VALUE}} * 0.0689476
```

**Flow Rate Scaling**
Raw value is 0-4095 (12-bit ADC), actual flow is 0-500 GPM:

```javascript
{{READ_VALUE}} / 4095 * 500
```

**Boolean Status from Analog Value**
Motor running if current > 2 amps:

```javascript
{{READ_VALUE}} > 2 ? 1 : 0
```

**Multi-Step Transform Chain**

* Rank 1: Apply calibration offset: `{{READ_VALUE}} + 1.5`
* Rank 2: Convert units: `{{READ_VALUE}} * 0.0689476`
* Rank 3: Round to 2 decimals: `Math.round({{READ_VALUE}} * 100) / 100`

***

## Virtual Variables

Virtual Variables are **computed values** created from device variables using expressions. They enable Edge Servers to create NEW custom data points that are published to a specified topic property path. Unlike Value Transforms (which modify existing values), Virtual Variables create entirely new computed values.

### Key Features

* Create complex expressions using multiple device variables
* Support multiple data types (NUMBER, BOOLEAN, STRING)
* Published to a **new topic property path** (creates new data points)
* Can be enabled/disabled without deletion
* Independent of specific Modbus items (uses any device variables)

### Navigation

**Path:** Administration > Devices > \[Select Device] > Edge Server tab > **Virtual Variables Tab** (green Calculator icon)

### Creating a Virtual Variable

1. Navigate to the device's **Edge Server** tab
2. Click the **Virtual Variables** tab
3. Click **"Add Virtual Variable"** or the **"+"** card
4. Fill in the required fields:

| Field                   | Required | Description                                  |
| ----------------------- | -------- | -------------------------------------------- |
| **Name**                | Yes      | Display name for the virtual variable        |
| **Description**         | No       | Explains what this virtual variable computes |
| **Topic Property Path** | Yes      | Where the computed result is published       |
| **Expression**          | Yes      | Calculation using `{{variable_name}}` syntax |
| **Enabled**             | Yes      | Toggle to activate/deactivate                |

### Variable Syntax

Reference device variables using double braces: `{{variableName}}`

### Example Expressions

```javascript
// Average of two temperature sensors
({{temperature_sensor_1}} + {{temperature_sensor_2}}) / 2

// Power calculation
{{voltage}} * {{current}}

// Conditional logic
({{temperature}} > 25) ? {{fan_control}} : 0
```

### Real-World Use Cases

**Average Temperature Calculation**
Combine multiple temperature sensors into one reading:

* Topic Property Path: `temperature/average`
* Expression: `({{zone1_temp}} + {{zone2_temp}} + {{zone3_temp}}) / 3`

**Power Consumption (kW)**
Calculate real power from voltage and current:

* Topic Property Path: `power/consumption_kw`
* Expression: `{{voltage}} * {{current}} / 1000`

**Efficiency Percentage**
Calculate equipment efficiency from input/output:

* Topic Property Path: `efficiency/percentage`
* Expression: `({{output_power}} / {{input_power}}) * 100`

**Delta Temperature**
Calculate temperature difference between supply and return:

* Topic Property Path: `temperature/delta`
* Expression: `{{supply_temp}} - {{return_temp}}`

**Runtime Hours Estimation**
Convert seconds counter to hours:

* Topic Property Path: `runtime/hours`
* Expression: `{{runtime_seconds}} / 3600`

**Conditional Fan Control**
Enable fan output based on temperature threshold:

* Topic Property Path: `controls/fan_enable`
* Expression: `({{temperature}} > 30) ? 1 : 0`

***

## Triggers

Triggers are automation features that **evaluate a boolean expression** and **execute a command** when a specific condition transitions from FALSE to TRUE. They enable edge server automation based on device variable states.

### Key Features

* **Edge-triggered**: Execute when condition changes from FALSE to TRUE (not continuously)
* **Command execution**: Write a configurable value to a specified command/write variable
* **Optional re-execution**: Can repeatedly execute at specified intervals while condition remains TRUE
* **Two-state actions**: Can write different values when condition becomes TRUE vs FALSE

### Navigation

**Path:** Administration > Devices > \[Select Device] > **Edge Server** tab > **Triggers** tab

### Creating a Trigger

1. Navigate to a device's **Edge Server** tab
2. Click the **Triggers** tab
3. Click **"Add Trigger"**
4. Fill in the required fields:

| Field                        | Required | Description                                             |
| ---------------------------- | -------- | ------------------------------------------------------- |
| **Name**                     | Yes      | Display name for the trigger                            |
| **Description**              | Yes      | What the trigger does                                   |
| **Trigger Condition**        | Yes      | Boolean expression that must evaluate to TRUE           |
| **Write Variable**           | Yes      | Target command/write variable to execute                |
| **Value on True**            | Yes      | Value to write when condition becomes TRUE (default: 1) |
| **Value on False**           | No       | Value to write when condition becomes FALSE             |
| **Re-execute Interval (ms)** | No       | Interval for repeated execution while TRUE (min: 100ms) |
| **Enabled**                  | Yes      | Toggle to activate/deactivate                           |

### Example Trigger Configuration

* **Name:** "High Temperature Alert"
* **Condition:** `{{temperature}} > 100`
* **Write Variable:** `alarm_output`
* **Value on True:** `1`
* **Value on False:** `0`
* **Re-execute Interval:** (empty for single execution)

### Real-World Use Cases

**High Temperature Alarm**
Activate alarm when temperature exceeds safe limit:

* Condition: `{{temperature}} > 85`
* Write Variable: `alarm_relay`
* Value on True: `1` | Value on False: `0`

**Low Tank Level Alert**
Start fill pump when tank drops below 20%:

* Condition: `{{tank_level}} < 20`
* Write Variable: `fill_pump_start`
* Value on True: `1` | Value on False: `0`

**Equipment Fault Response**
Stop equipment when fault is detected:

* Condition: `{{fault_code}} != 0`
* Write Variable: `emergency_stop`
* Value on True: `1`

**Periodic Heartbeat**
Send keepalive signal every 5 seconds while system is running:

* Condition: `{{system_running}} == 1`
* Write Variable: `heartbeat_output`
* Value on True: `1`
* Re-execute Interval: `5000` (5 seconds)

**Pressure Safety Shutdown**
Emergency shutdown if pressure exceeds critical threshold:

* Condition: `{{pressure}} > 150 || {{pressure}} < 10`
* Write Variable: `safety_shutdown`
* Value on True: `1`

**Motor Overload Protection**
Stop motor if current draw exceeds rating:

* Condition: `{{motor_current}} > {{motor_rated_current}} * 1.2`
* Write Variable: `motor_stop_command`
* Value on True: `1` | Value on False: `0`

***

## Summary

### Feature Comparison

| Feature               | Purpose                                                | Location                                        | Expression Syntax                |
| --------------------- | ------------------------------------------------------ | ----------------------------------------------- | -------------------------------- |
| **Value Transforms**  | Modify existing item values before sending to platform | Device > Edge Server > Modbus Item > Transforms | `{{READ_VALUE}}`, `{{variable}}` |
| **Virtual Variables** | Create NEW computed values from device variables       | Device > Edge Server > Virtual Variables Tab    | `{{variableName}}`               |
| **Triggers**          | Execute commands based on conditions                   | Device > Edge Server > Triggers Tab             | `{{variable}}`                   |

### Key Differences

| Aspect                  | Value Transforms       | Virtual Variables       | Triggers               |
| ----------------------- | ---------------------- | ----------------------- | ---------------------- |
| **Creates New Data**    | No (modifies existing) | Yes (new topic path)    | No (writes to command) |
| **Has Rank/Order**      | Yes (1-999)            | No                      | No                     |
| **Tied to Modbus Item** | Yes (specific item)    | No (global to device)   | No (global to device)  |
| **Output**              | Modified item value    | New topic property path | Command execution      |

### Access Requirements

All three features are accessible on the device's Edge Server tab (the SDK Configuration editor) after the Edge Server has been onboarded and configured. See [Edge Server Management](https://documentation.controlcomtech.com/platform/devices/edge-server) for the editor itself.
