Documentation

oee.computeAPQ() function

The oee.computeAPQ() function is experimental and subject to change at any time. By using this function, you accept the risks of experimental functions.

The oee.computeAPQ() function computes availability, performance, and quality (APQ) and overall equipment effectiveness (OEE) using two separate input streams—production events and part events.

import "experimental/oee"

oee.computeAPQ(
  productionEvents: exampleProductionScheme,
  partEvents: examplePartsStream,
  runningState: "running",
  plannedTime: 8h,
  idealCycleTime: 2m,
)

Output schema

For each input table, the oee.computeAPQ function outputs a table with a single row and the following columns:

  • _time: Timestamp associated with the APQ calculation.
  • availability: Ratio of time production was in a running state.
  • oee: Overall equipment effectiveness.
  • performance: Ratio of production efficiency.
  • quality: Ratio of production quality.
  • runTime: Total nanoseconds spent in the running state.

Parameters

productionEvents

(Required) Production events stream that contains the production state or start and stop events. Each row must contain the following columns:

  • _stop: Right time boundary timestamp (typically assigned by range() or window()).
  • _time: Timestamp of the production event.
  • state: String that represents start or stop events or the production state. Use runningState to specify which value in the state column represents a running state.

Data type: Stream of Tables

partEvents

(Required) Part events that contains the running totals of parts produced and parts that do not meet quality standards. Each row must contain the following columns:

  • _stop: Right time boundary timestamp (typically assigned by range() or window()).
  • _time: Timestamp of the parts event.
  • partCount: Cumulative total of parts produced.
  • badCount Cumulative total of parts that do not meet quality standards.

Data type: Stream of Tables

runningState

(Required) State value that represents a running state.

Data type: String

plannedTime

(Required) Total time that equipment is expected to produce parts.

Data type: Duration | Integer

Integer values represent nanoseconds.

idealCycleTime

(Required) Ideal minimum time to produce one part.

Data type: Duration | Integer

Integer values represent nanoseconds.

Examples

The following example uses two streams of data (productionData and partsData) and oee.APQ() to calculate the APQ and OEE of an eight hour production window.

Input data

productionData
_start_stop_timestate
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T00:00:00Zrunning
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T04:03:53Zstopped
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T04:24:53Zrunning
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T08:00:00Zrunning
partsData
_start_stop_timepartCountbadCount
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T00:00:00Z00
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T04:03:53Z6735
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T04:24:53Z6735
2021-01-01T00:00:00Z2021-01-01T08:00:01Z2021-01-01T08:00:00Z129813

Query

import "experimental/oee"

productionData = // ...
partsData = // ...

oee.computeAPQ(
  productionEvents: productionData,
  partEvents: partsData,
  runningState: "running",
  plannedTime: 8h,
  idealCycleTime: 21s
)
|> drop(columns: ["_start","_stop"])

Output data

_timeavailabilityoeeperformancequalityrunTime
2021-01-01T08:00:01Z0.95630.93700.98970.989927541000000000

Set your InfluxDB URL

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.