Skip to content

Vision: statistics, yield and SPC ​

Last updated

License feature: Machine Vision

The Statistics panel under the picture answers "how is this inspection doing". Nothing in it is a separate store: the live counts are the device's own tags, yield over a window comes from the historian's record of those tags, and capability comes from the SPC module.

Live counts ​

The panel shows Inspections, Failed and Pass rate (refreshing every 2 seconds), "Counting since …", and a list of the tools that have failed with their fail counts — which tool is failing is the first question when yield drops.

  • An inspection with nothing judged counts as an inspection but neither a pass nor a fail.
  • Pass rate shows — until something has been judged, rather than 0% or 100%.
  • The counts start again on Reset counts (Admin or Editor; it writes the stats_reset tag), on a changeover, when the device's settings are saved, and when the driver restarts or the appliance reboots.

Yield over a window ​

Under Over the last, pick 1 h, 8 h or 24 h. The panel shows "412 inspections, 9 failed — 97.8% passed" and the tools that failed in that window.

The figures come from the historian, measured from how far each counter climbed between the two times. A reset or changeover in the middle of the window is handled — a drop in a counter is read as a reset followed by counting up — so a shift's figure is not spoiled by a changeover. It looks back up to 24 hours before the window for the starting value.

  • It needs the historian running and history on for inspections, passed, failed and each tool's fails (on by default). Otherwise: "The historian is not available, so there is no record to measure a window from. The live counts above still work."
  • If a counter had no recorded value before the window started: "A count had no reading before the window started, so the totals may be one inspection short."
  • The windows end now. For a fixed shift (06:00–14:00) call the API with from and to.

Capability (Cpk) in SPC ​

Measuring tools — Presence, Color match, Pattern match, Caliper, Circle gauge — of the program you are editing are listed under Capability (followed by the program name).

  1. Set the tool's limits and Save.
  2. Press Track in SPC (Admin or Editor).
  3. An SPC group named "Vision: device name — program name" is created (one per device and program), with a chart for the tool. The chart reads <prefix>/value, samples on last_inspected (once per inspection), uses the tool's At least / At most as the lower and upper spec limits, and checks Western Electric rules 1 and 2.
  4. The row then shows Cpk 1.52, the sample count n=86, a link to SPC, and Update limits.

Details:

  • The chart samples only while that program runs, because limits belong to one product.
  • Update limits copies the tool's current limits to its chart after you change them (and save). Changing the limits in the Vision page does not update the chart on its own.
  • Cpk is one-sided when a tool has only one limit — "at least 80% match" gives a Cpk against 80 and no Cp, which needs both. "Cpk needs more samples" until SPC has enough. Above 1.33 is generally considered capable.
  • SPC samples on last_inspected, not on inspections, because a reset or changeover also changes the counter and would put the previous product's last part on the new chart.
  • Counting, barcode and text tools do not produce a measurement to chart ("A circles tool does not produce a measurement to chart.").
  • Removing the tool or program does not delete its SPC chart; delete it on the SPC page.

See SPC, Control limits and capability and Control rules.

API ​

MethodPathReturns
GET/api/vision/:deviceId/statsYield between from and to (ISO times; default the last hour)
GET/api/vision/:deviceId/spcThe device's tracked tools with count, mean, Cp and Cpk
POST/api/vision/:deviceId/spcBody { "program": "bottle_500", "toolKey": "cap" } — track a tool or refresh its limits (Admin, Editor)
bash
curl -H "Authorization: Bearer $TOKEN" \
  "http://scada.local/api/vision/7/stats?from=2026-09-15T06:00:00Z&to=2026-09-15T14:00:00Z"

See also ​

Scada.Ink Help Center