---
title: PLC Uptime/Downtime Tracker
slug: litmusedge/plc-uptimedowntime-tracker
docTags: 
createdAt: 2026-07-23T20:18:19.782Z
---

The PLC Uptime/Downtime Tracker measures how long a machine runs and how long it stops, based on the values a Programmable Logic Controller (PLC) reports. Use it when your PLC signals its state with a specific value, such as `0` when a machine stops and `1` when it resumes.

## How it works

You configure two indicator values, and the processor watches the incoming value against them.

- When the value matches the **Downtime Value**, the processor marks the start of a downtime period and begins tracking its duration.
- When the value transitions to the **Uptime Value**, the processor closes the downtime period and reports how long it lasted.
- Any other value updates the output without changing the tracked state.

The processor tracks each device independently, so a single flow can follow several machines at once.

## Timer interval

When you set a timer interval in milliseconds, the processor still emits a value on that interval even when the connected tag is offline. If your tag publishes reliably, enter `0` to disable the timer and rely on incoming messages instead.

## Output fields

The processor preserves the original message fields and adds the following:

- `system_status`: the current state, either `uptime` or `downtime`.
- `last_downtime`: the timestamp in milliseconds when downtime last started.
- `time_since_last_downtime`: the time in seconds since downtime last started.
- `current_downtime_period`: how long the machine has been down so far, in seconds, present only during downtime.
- `last_uptime_timestamp`: the timestamp in milliseconds when the machine was last in the uptime state, present only during downtime.
- `current_uptime_period`: how long the machine has been up, in seconds, present only during uptime.
- `timestamp`: the current event time in milliseconds.

## Parameters

| **Parameters**     | **Details**                                                                       |
| ------------------ | --------------------------------------------------------------------------------- |
| Downtime Value     | The value that indicates the PLC is in downtime. Default is \`0\`.                |
| Uptime Value       | The value that indicates the PLC is operational. Default is \`1\`.                |
| Timer Interval     | Timer in milliseconds in which to push values. Enter \`0\` to disable this timer. |
| Pass Through Value | Joins the input with the output of the processor.                                 |

:::hint{type="info"}
**Note:** The processor reads the `value` field as a signed integer and compares it against the configured indicators. Make sure each incoming message provides a `value` and a `timestamp` field.
:::

