PLC Uptime/Downtime Tracker
4 min
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 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