Skip to main content

system.kanoa.event.checkSpeedLoss(assetId)

Checks one machine for running below its standard rate now, as the gateway does every minute: opens, updates or closes its automatic speed-loss performance event and writes its speed-loss tags (belowStandard, actualRate, actualRatePct, performanceEventId, performanceReason, performanceReasonColor, speedLossWindowMins). The actual rate is the infeed count (or the outfeed count times the package count) over a rolling window divided by the minutes running in it. An event opens when that rate has been below the threshold at every minute of the last few minutes, and is active (no end date) until the rate is back, the run changes or the machine stops running; its value is the minutes of output lost. The window, threshold and minutes come from the config values speedLossWindowMins (10), speedLossThresholdPct (95) and speedLossMinMins (5), overridden per asset by the attributes _speedLossWindowMins,_speedLossThresholdPct and _speedLossMinMins. The attribute _speedLossEnabled (set by Enable Real-time speed loss in the asset tree editor, inherited from the closest asset above) or the config value speedLossEnabled turns it off: no event opens and an open one closes.


Parameters​

assetId Integer: The machine (an OEE asset)


Returns​

(status, message): status is a dict with assetId, eligible (running a production run with a standard rate), actualRate (per the run's period), actualRatePct (of the standard rate), performanceEventId (the active speed loss, or None), reason, reasonColor, action (opened, updated, closed or none) and windowMins (the minutes the rate is measured over)


Example​

assetId = 1
status, message = system.kanoa.event.checkSpeedLoss(assetId)