Skip to main content

Revise and Correct

Overview

In this section, we will make a change to the Receiving Inspection check sheet so a check that nobody starts is set to Missed 60 minutes after it's added. We will then correct an already approved check sheet to change one of the check item values.

A manually added check is due as soon as it's added. It should be marked Over Due if nobody starts it within 30 minutes, and Missed 30 minutes after that. You'll change the trigger timers on Receiving Inspection, which means creating a new revision.

Revise the trigger timing
  1. Navigate to Configuration → Quality → Check Sheets
  2. Change the status of the Receiving Inspection check sheet from Released to In Revision, and open it.
  3. On the Triggers tab, add or edit the Manual trigger: Delay 0, Coming Due 0, Over Due 30, Grace 30.
  4. Save, close the editor, and set the status back to Released.

A check you add by hand is Due as soon as it's added: Delay and Coming Due only apply to checks a trigger schedules. With these timers it's Over Due after 30 minutes and Missed after 60.

Revisions apply to any change, including triggers, not only to check items. While a sheet is In Revision, every user, Gateway Admins included, can only start its released version. Checks added after you release the revision use the new version.

Reference Materials: Check Sheet Triggers

Check Sheet Triggers​

The trigger tab allows you to define what should trigger a check sheet. Check Sheets can be scheduled manually without a trigger, but if you want a set of checks to be performed whenever shift changes, or when a new product starts running on a line or after maintenance has been completed, all these scenarios can be supported by adding one or more triggers.

Configure Check Sheets

Click the + button to add a new trigger or Configure Check Sheets to edit an existing trigger.

Configure Check Sheets

Trigger Types​

  • Manual: A check sheet can be manually created without this trigger, however if manual trigger is created, it will specify how much time a user has to take the checks once it has been scheduled.

  • Mode Change: When the mode changes on an asset i.e. from Changeover to Production, this trigger will schedule a check sheet if it meets the specified mode/shift, other options. An optional From Mode limits it to a change from that mode, so a check sheet can run on Changeover to Production but not on Maintenance to Production.

  • Product Change: When the product changes on an asset, this check sheet will be scheduled if the currently running product is specified by the check sheet.

    • Every Product: Quality check is required every time the product changes
    • Unique Products Per Shift: Quality check is required only once per product per shift
    • Once Per Shift: Only one quality check will be performed per shift
  • Re-Test: Set the delay, coming due etc. when a check sheet is scheduled due to a re-test being required.

  • Shift Change: Check sheet will be scheduled if the current shift meets the shift settings of this trigger.

  • Timed Interval: This check sheet will be triggered periodically based on the mode and shift settings.

  • Recurring: The check sheet is scheduled on a repeating calendar rule (every weekday at 6:00, the first Monday of the month, ...). Times are in the asset's site time zone, so 6:00 stays 6:00 at the plant across daylight-saving changes, whatever time zone the gateway runs in.

  • State Change: The check sheet is scheduled when an asset has been in one of the chosen states for at least the minimum time (For at least n mins), for example a check after a line has been Blocked for 10 minutes. It's scheduled once each time the asset goes into the state, so a short stop that clears before the minimum time doesn't trigger a check.

  • Infeed Count, Outfeed Count, Waste Count: The check sheet is scheduled every n counts of the asset's infeed, outfeed or waste counter.

  • General Count: The same, for one of the asset's general counters, by its name.

    For the count triggers, the count starts when the trigger is added and never resets: it carries on across product and shift changes, and what's left over after each n counts toward the next. When n counts are reached while a check sheet is still open, that check is skipped. Counts made while the check sheet doesn't apply (another shift, product, mode or tool than its settings) aren't counted.

State Change and the count triggers are checked by the quality timer, so a check sheet is scheduled within one timer interval of the state's minimum time or the count being reached.

Note If a trigger causes a new check sheet to be scheduled when there is already an existing check sheet scheduled, it will set the current check sheet to aborted if it has not already been started and create the new check sheet.

Timers​

  • Delay: Delay in minutes between a trigger executing and the check sheet being scheduled. Primarily used on shift change to give shift personnel a chance to drink their tea before being bombarded with checks to be performed. Until it passes, the check is In Delay: no screen shows it, and the trigger won't create another.
  • Coming Due: Once a check sheet is scheduled, indicates to a user how long they have in minutes before this check will become due. For Recurring and Timed Interval triggers, it's how far ahead of the due time the check appears.
  • Over Due: Provides amount of time in minutes a user has to start performing the checks once it becomes due.
  • Grace: Number of minutes a check sheet will remain over due before its status is set to 'Missed'.

A check sheet added by hand (Manual trigger) is due as soon as it's added, so its Delay and Coming Due don't apply. With Over Due 30 and Grace 30, it's Over Due after 30 minutes and Missed after 60.

A scheduled check sheet that hasn't been started moves through the following statuses on its own, driven by its trigger's timers:

In Delay → Coming Due → Due → Over Due → Missed

A check is In Delay only when its trigger has a Delay; with none it starts Coming Due.

A check sheet added by hand (Add Check) skips In Delay and Coming Due: it's Due as soon as it's added, so only the Manual trigger's Over Due and Grace apply to it. Delay and Coming Due apply to checks a trigger schedules.

When someone starts filling out a check sheet, it will automatically move to 'In Progress'.

  • Submit moves it to Submitted. If the sheet doesn't require a sign-off, it goes straight on to Approved.
  • An Approved check can later be Rejected so it can be corrected: open it from the Check Table, switch it from view to edit mode with the toggle at the upper right, and click Reject. Change the values and resubmit it. Rejecting and approving need the Approve Checks security function.
  • A check that hasn't been approved can be Cancelled or Disabled.

Reports and SPC only look at Check Sheet events that are in the Approved status.



Approved Checks can't be edited by accident. To correct a check, it must be rejected first.

Correct an approved check sheet
  1. Navigate to Quality → Schedule → Check Table and open the Cleanliness Check you submitted with a failure.
  2. Use the toggle at the upper right to switch from view to edit mode, then click Reject.
  3. Change the failed answer, for example from Over-Cluttered to Passable.
  4. Resubmit the check and confirm the Check Table now shows it as OK.

A resubmitted check goes back to Approved if its sheet doesn't need a sign-off; otherwise it waits in Submitted for approval. Rejecting and approving needs the Approve Checks security function.

Reference Materials: Approve Checks security function

Approve Checks​

This function allows for users with the ‘Approve Checks’ function to approve check sheets.

security

Check your work

Copy this script into the Ignition Designer Script Console (Tools → Script Console) and run it. It checks that Receiving Inspection is released as a new revision with no revision left open, that its Manual trigger is enabled with Delay 0, Coming Due 0, Over Due 30 and Grace 30, and that an approved Cleanliness Check now has no failures. Each check prints PASS or FAIL with what to fix. It doesn't change anything.

Show the check script
checkLesson-reviseAndCorrect.py
# Kanoa Quality Training - check "Revise and Correct" (Receiving Inspection, lesson 4)
#
# Run in the Ignition Designer Script Console (Tools > Script Console), in the
# project that inherits KANOA_SCRIPTS. It only reads; it changes nothing.
# Every check prints PASS or FAIL with what to fix, then a summary.

SHEET = 'Receiving Inspection'
TIMERS = [('delayMins', 'Delay', 0), ('comingDueMins', 'Coming Due', 0), ('overDueMins', 'Over Due', 30), ('graceMins', 'Grace', 30)]
CLEANLINESS = 'Cleanliness Check'

results = []

def check(ok, what, fix=None):
results.append(bool(ok))
if ok:
print 'PASS %s' % what
else:
print 'FAIL %s' % what
if fix:
print ' -> %s' % fix

def note(what):
print 'NOTE %s' % what

def field(row, *names):
for n in names:
if n in row and row[n] is not None:
return row[n]
return None

def text(v):
return '' if v is None else unicode(v).strip()

def key(v):
return ' '.join(text(v).lower().split())

def truthy(v):
return str(v).lower() in ('true', '1', 'yes')

def num(v):
try:
return float(v)
except:
return None

def rows(data):
# Kanoa returns a dataset, a list of dictionaries, or None
if data is None:
return []
if hasattr(data, 'getRowCount'):
cols = list(data.getColumnNames())
return [dict((c, data.getValueAt(i, c)) for c in cols) for i in range(data.getRowCount())]
return [dict(r) for r in data]

def findSheet(name):
"""All versions of a check sheet, and the one to check: the Released version, or else the newest.
A revision renames the archived version '<name> - N' and the open one '<name> - In Revision',
so the other versions are found by their master sheet, not by name."""
sheets = rows(system.kanoa.quality.sheet.getSheets({}))
named = [s for s in sheets if text(field(s, 'chkShtName')) == name] or \
[s for s in sheets if key(field(s, 'chkShtName')) == key(name)]
if not named:
return None, []
masters = set(text(field(s, 'masterChkShtId', 'chkShtId')) for s in named)
versions = [s for s in sheets if text(field(s, 'masterChkShtId', 'chkShtId')) in masters]
versions.sort(key=lambda s: num(field(s, 'chkShtVersionNumber')) or 0)
released = [s for s in versions if text(field(s, 'chkShtVersionStateName')) == 'Released']
return (released or versions)[-1], versions

def millis(v):
return v.getTime() if hasattr(v, 'getTime') else 0

def sheetEvents(versions):
"""Every check event of any version of the sheet, newest first."""
out = []
for s in versions:
out += rows(system.kanoa.quality.event.getChkShtEvents({'chkShtId': field(s, 'chkShtId')}))
out.sort(key=lambda e: millis(field(e, 'scheduledDate', 'takenDate')), reverse=True)
return out

print '=' * 70
print 'Kanoa Quality Training - Revise and Correct check'
print '=' * 70

# 1. The revision
print '\n-- Revision of %s' % SHEET
sheet, versions = findSheet(SHEET)
if sheet is None:
check(False, 'Check sheet %s exists' % SHEET, 'Build it earlier in this chapter first.')
else:
state = text(field(sheet, 'chkShtVersionStateName'))
version = int(num(field(sheet, 'chkShtVersionNumber')) or 1)
check(state == 'Released', 'It is Released', "It's %s. Set its status back to Released." % (state or 'not set'))
check(version > 1, 'The released sheet is a new revision (version %d)' % version,
'Set the status to In Revision, change the trigger, then set it back to Released.')
open_ = [v for v in versions if text(field(v, 'chkShtVersionStateName')) == 'In Revision']
if open_ and state == 'Released':
check(False, 'No revision is still open',
'A copy is still In Revision. Release it so your trigger change takes effect.')

# 2. The Manual trigger timers
print '\n-- Manual trigger'
triggers = rows(system.kanoa.quality.config.getChkShtTriggers({'chkShtId': field(sheet, 'chkShtId')}))
manual = [t for t in triggers if text(field(t, 'triggerTypeName')) == 'Manual']
if not manual:
check(False, 'It has a Manual trigger', 'On the Triggers tab, add a trigger of type Manual.')
else:
t = manual[0]
check(truthy(field(t, 'enabled')), 'The Manual trigger is enabled', 'Edit the trigger and select Enabled.')
for col, label, expected in TIMERS:
actual = num(field(t, col))
check(actual == expected, '%s is %d minutes' % (label, expected),
"It's %s. Edit the Manual trigger and set %s to %d." % (text(field(t, col)) or 'blank', label, expected))

# 3. The corrected Cleanliness Check
print '\n-- Corrected %s' % CLEANLINESS
cSheet, cVersions = findSheet(CLEANLINESS)
if cSheet is None:
check(False, 'Check sheet %s exists' % CLEANLINESS, 'Build it in the Cleanliness Check chapter first.')
else:
events = sheetEvents(cVersions)
approved = [e for e in events if text(field(e, 'chkShtStateName')) == 'Approved']
clean = [e for e in approved if (num(field(e, 'failedChecks')) or 0) == 0]
check(clean, 'An approved Cleanliness Check now has no failures',
'In Quality > Schedule > Check Table, open the Cleanliness Check with a failure, switch to edit mode, click Reject, '
'change the failed answer to Clean or Passable, and resubmit it.')
stillFailed = [e for e in approved if (num(field(e, 'failedChecks')) or 0) > 0]
if stillFailed:
note('%d approved Cleanliness Check(s) still have a failure. That is fine if you corrected another one.' % len(stillFailed))
waiting = [e for e in events if text(field(e, 'chkShtStateName')) in ('Rejected', 'In Progress')]
if waiting:
note('%d Cleanliness Check(s) are %s. Resubmit a rejected check to finish the correction.'
% (len(waiting), ' or '.join(sorted(set(text(field(e, 'chkShtStateName')) for e in waiting)))))

passed = results.count(True)
print '\n' + '=' * 70
print 'Result: %d of %d checks passed' % (passed, len(results))
if passed == len(results):
print 'All good. The revision is released and the check is corrected.'
else:
print 'Fix the FAIL items above, then run this again.'
print '=' * 70