mes.spGetProductionDataForReliability
Description
This stored procedure collects detailed production and reliability data for a given asset and mode across a defined time range. It calculates raw counters, availability, performance, and quality metrics, including takt time, actual rates, and loss analyses, suitable for reliability and performance dashboards.Syntax
mes.spGetProductionDataForReliability @assetId, @rangeStart, @rangeEnd, @modeIdParameters:
@assetId (int): The ID of the asset
@rangeStart (datetime): Start timestamp for the query (optional)
@rangeEnd (datetime): End timestamp for the query (optional)
@modeId (int): Mode identifier to filter production context
Returns:
Each row represents a production period and includes:
- Asset and mode metadata
- Item and work order references
- Duration (in seconds)
- Runtime, downtime, and planned downtime in seconds
- Counter metrics: infeedCount, outfeedCount, wasteCount
- TargetCount and taktTime
- Calculated metrics: - **Availability** - **Performance** - **Quality** - **Infeed rate per second** - **Actual production rate** - **Lossed units and performance loss seconds** - **Quality loss seconds**
Code Example
EXEC mes.spGetProductionDataForReliability
@assetId = 1001,
@rangeStart = '2025-07-01',
@rangeEnd = '2025-07-10',
@modeId = 2;