Skip to main content

Build the Check Sheet

A check sheet is the reusable template for a check, like a blank form. Each question on the form is a check item. Nothing is recorded in this lesson; you're only building the form.

Create the check sheet
  1. Navigate to Configuration → Quality → Check Sheets.
  2. Click the add button and name the check sheet Cleanliness Check. Click outside the field; Kanoa saves the sheet as soon as it has a name.
  3. On the Settings tab, set the folder to CoreForge\Safety, creating the folders with the folder button if they don't exist yet. Leave Asset Required, Item Required and Sign Off Required cleared.
Reference Materials: Check Sheet Settings

Check Sheet Settings​

Configure Check Sheets

  • Enabled: Enable or disable a check sheet.
  • Sign Off Required: Require a sign off for approval. If unchecked a submitted check sheet is automatically moved to the 'Approved' status. Only approved checks are used in SPC analysis.
  • Auto: Indicate that this check sheet only contains checks whose values will be automatically captured when the check sheet is triggered. Add Check leaves Auto check sheets out of its list unless Include Auto Checks is ticked.
  • Folder: Saves the check sheet in a specific folder.
  • Asset Required: Determines if an asset must be selected for this check sheet.
  • Item Required: Determine if an items must be selected for this check sheet.
  • Issue Check Sheet: Choose a check sheet to schedule immediately upon test failure.
  • Notifications: Select a team or user for email notifications on test failure.
  • Sync Date: The 'Taken Date' of the Check Sheet by default is the date the check sheet is submitted. You can override this to force all check items and the check sheet itself to use the datetime picked for a check that is of datetime data type. This can be used when all check items are to be referenced to say the 'code time' printed on a product. To use this feature, simply create a check item that is of data type 'datetime' and then select it in this dropdown. When the user selects the date time, it will now be used for the 'Taken Time'.

Add the check items
  1. On the Checks tab, add a check item named Machining Area: Type Check, Data Type String, Enabled and Required selected.
  2. Under Entry Options, choose Text and add the responses: Clean as Pass, Passable as Warning, Over-Cluttered and Dirty as Fail.
  3. Save the check item.
  4. Use the duplicate button to copy Machining Area three times, and rename the copies Coating Area, Mixing Area and Finishing Area.
  5. Confirm all four items have the same four responses.

The result category on each response is what makes the check pass or fail. A single Fail on a required item makes the whole check not OK. A Warning doesn't.

Reference Materials: Check Item Entry Options

Check Item Settings - Entry Options​

Configure Check Items

Entry Options allows you to present the user with a number of different ways to enter in a value for a check item. You don't need to provide an entry option, a standard text field or numeric input field will be presented to the user and keyboard entry is always permitted (but validated).

The entry options that can be selected from vary based on the check item data type....

Boolean Data Type​

  • Boolean: Generates buttons based on values defined in the picklist values. Pick list values are in json format. 'TRUE' defines the button(s) that will yield a 1 result, 'FALSE' a 0. i.e. {'TRUE':['Yes'], 'FALSE':['No']}

Integer and Float Data Types​

  • Number: Generates buttons from attribute tolerance if it exists otherwise uses values defined in the picklist values. Pick list values are in json format. 'denominator' defines the increment part (0.1 will generate 0.1, 1.2, .3 etc. ). 'lel' and 'uel' defines the lower and upper value range, 'ucl', 'lcl', 'lsl', 'usl' defines the spec limit. i.e. {'denominator':0.5, 'lel':1,'lsl':1.1, 'lcl':1.8, 'tgt':2, 'ucl':2.2, 'usl':2.6, 'uel':3}
  • Time: Presents the user with a time key pad to enter duration in hours, minutes and seconds for a check. The value is stored in seconds.
  • Fraction: Generates buttons from attribute tolerance if it exists otherwise uses values defined in the picklist values. Pick list values are in json format. 'denominator' defines the increment part (0.1 will generate 0.1, 1.2, .3 etc. ). 'lel' and 'uel' defines the lower and upper value range, 'ucl', 'lcl', 'lsl', 'usl' defines the spec limit. i.e. {'denominator':0.5, 'lel':1,'lsl':1.1, 'lcl':1.8, 'tgt':2, 'ucl':2.2, 'usl':2.6, 'uel':3}

String Data Type​

  • Tree: Generates a tree selector. Selection options are generated from a comma separated list. Each option must be wrapped in single quotes and use / to create the tree structure. i.e. 'Kanoa Industries/T1-Acme, TX','Kanoa Industries/T2-Acme, TX','Kanoa Enterprises/P1','Kanoa Enterprises/P1/Line 1','Kanoa Enterprises/P2/Line 2'. Do not have spaces between tree elements
  • Text: Generates buttons with the text defined in the pick list values. Pick list values are in json format. i.e. {'PASS':["Perfect", "Good"], 'WARNING':["Fair", "Average"], 'FAIL':["Bad"],'NEUTRAL':["Doesn't Matter"]}
  • Boolean: Generates buttons based on values defined in the picklist values. Pick list values are in json format. 'TRUE' defines the button(s) that will yield a 1 result, 'FALSE' a 0. i.e. {'TRUE':['Yes'], 'FALSE':['No']}
  • Barcode Scanner: Provides a button that will uses a mobile devices camera to scan a barcode. Only valid for devices that have a built-in camera. A custom script can be selected to further parse the scanned in bar code. Refer to 'Creating custom scripts' for more info.

Trigger: If the check sheet has checks defined as triggers, you can choose a trigger check item that will cause this check to be taken. Used primarily to pull data from an external datasource such as a plc.


Release the check sheet
  1. Close the editor to return to the check sheet list. The new sheet's status is Draft.
  2. Change its status to Released.
  3. Open the sheet again and notice you can no longer change its items.

Operators can only run Released check sheets. Once a sheet is released, changes go through a new revision, so completed checks always point to the exact version that was used. You'll revise a sheet in the Receiving Inspection chapter.

Reference Materials: Check Sheet Version Control

Check Sheet Version Control​

In the table, we can see that each check sheet has a status column.

Check Sheet Versioning

A released check sheet can't be edited directly. To change one, set its status from Released to In Revision, make the changes, then set it back to Released. Operators keep using the released version until the revision is released.

If you click the arrow on the far left of a check sheet's row, its previous versions are shown. You can view each one, and revert the check sheet to a previous version.

Version states​

StateWhat it means
DraftA new check sheet that hasn't been released yet. It's version 1.
ReleasedThe version operators use. A check sheet has one released version at a time.
In RevisionA copy of the released version being edited. It's disabled, so operators don't see it.
ArchivedA version that a newer release replaced. It's kept, with its events, and can be reverted to.

What a revision does​

  1. Released to In Revision: the released check sheet is copied to a new check sheet named "<name> - In Revision", with the next version number. The copy is what you edit; the released version stays in use.
  2. In Revision to Released:
    • the old released version is archived and renamed "<name> - <its version number>";
    • the revision is released, enabled and renamed back to "<name>";
    • check sheets that used any version of it as their re-test sheet now use the new release.
  3. Reverting to an archived version sets it back to In Revision as the newest version, named "<name> ver<its old number> - In Revision". Release it to put it back in use.

Because a revision is a copy, each version is its own check sheet with its own chkShtId. An event taken on a check sheet keeps the chkShtId of the version that was used, so you can always tell which version an operator filled in.

The check sheet ids​

IdWhat it identifiesChanges
chkShtIdOne version of a check sheet.Every revision gets a new one.
masterChkShtIdThe current released version: its chkShtId. Every version of the check sheet points at it.Each time a revision is released, it moves to the new release.
chkShtVersionGroupIdThe check sheet across all its versions.Never.

Reports, SPC and the quality analysis functions take a masterChkShtId and include the events of every version of the check sheet.

Referring to a check sheet from your own views and scripts​

Because masterChkShtId moves on each release, a view, dashboard or script that stores one stops finding the check sheet after its next revision is released. Store the chkShtVersionGroupId instead, and look up the current masterChkShtId from it when you need one:

groupId = 12 # stored once; it never changes
sheets = system.kanoa.quality.sheet.getSheets({'chkShtVersionGroupId': groupId, 'chkShtVersionStateName': 'Released'})
masterChkShtId = sheets.getValueAt(0, 'masterChkShtId') if sheets.getRowCount() else None
# then, for example
data = system.kanoa.quality.analysis.getContinuousChartData(masterChkShtId, chkItemPath, startDate, endDate)

To find the chkShtVersionGroupId of a check sheet you already refer to by chkShtId or masterChkShtId, look it up in its version history:

history = system.kanoa.quality.sheet.getSheetVersionHistory({'chkShtId': chkShtId})
groupId = history.getValueAt(0, 'chkShtVersionGroupId') if history.getRowCount() else None

chkShtVersionGroupId is returned by getSheets, getSheetsByAsset and getSheetVersionHistory. getSheets and getSheetVersionHistory can filter by it.


Check your work

Copy this script into the Ignition Designer Script Console (Tools → Script Console) and run it. It checks that Cleanliness Check is in CoreForge\Safety with Asset, Item and Sign Off Required cleared, that it's released, and that the four area items are enabled, required String checks with the Clean, Passable, Over-Cluttered and Dirty responses. Each check prints PASS or FAIL with what to fix. It doesn't change anything.

Show the check script
checkLesson-cleanlinessBuild.py
# Kanoa Quality Training - check "Build the Check Sheet" (Cleanliness Check, lesson 1)
#
# 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.

import re

SHEET = 'Cleanliness Check'
FOLDER = 'CoreForge\\Safety'
ITEMS = ['Machining Area', 'Coating Area', 'Mixing Area', 'Finishing Area']
RESPONSES = {'PASS': ['Clean'], 'WARNING': ['Passable'], 'FAIL': ['Dirty', 'Over-Cluttered'], 'NEUTRAL': []}

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 findItem(items, name):
exact = [i for i in items if text(field(i, 'chkItemName')) == name]
close = [i for i in items if key(field(i, 'chkItemName')) == key(name)]
return (exact or close or [None])[0]

def pickList(value):
"""The responses in each result category of a Text pick list."""
out = {}
for cat in ('PASS', 'WARNING', 'FAIL', 'NEUTRAL'):
m = re.search(r"""['"]%s['"]\s*:\s*\[(.*?)\]""" % cat, text(value))
found = re.findall(r"""'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)\"""", m.group(1)) if m else []
out[cat] = sorted(a or b for a, b in found)
return out

print '=' * 70
print 'Kanoa Quality Training - Build the Cleanliness Check check'
print '=' * 70

# 1. The check sheet and its settings
print '\n-- Check sheet'
sheet, versions = findSheet(SHEET)
if sheet is None:
check(False, 'Check sheet %s exists' % SHEET,
'In Configuration > Quality > Check Sheets, click the add button and name it %s.' % SHEET)
else:
actual = text(field(sheet, 'chkShtName'))
check(actual == SHEET, 'Check sheet %s exists' % SHEET, "Found '%s'. Rename it to %s." % (actual, SHEET))
folder = text(field(sheet, 'chkShtTypePath'))
check(folder == FOLDER, 'It is in the %s folder' % FOLDER,
"It's in '%s'. On the Settings tab, set the folder to %s (create the folders with the folder button)." % (folder or 'no folder', FOLDER))
for col, label in (('assetReqd', 'Asset Required'), ('itemReqd', 'Item Required'), ('signOffReqd', 'Sign Off Required')):
check(not truthy(field(sheet, col)), '%s is cleared' % label, 'On the Settings tab, clear %s.' % label)
state = text(field(sheet, 'chkShtVersionStateName'))
check(state == 'Released', 'It is Released',
"It's %s. Close the editor and change its status to Released." % (state or 'not set'))

# 2. The four check items and their responses
if sheet is not None:
print '\n-- Check items'
items = rows(system.kanoa.quality.config.getChecks({'chkShtId': field(sheet, 'chkShtId')}))
for name in ITEMS:
item = findItem(items, name)
if item is None:
check(False, '%s exists' % name,
'On the Checks tab, duplicate Machining Area and rename the copy %s.' % name)
continue
actual = text(field(item, 'chkItemName'))
problems = []
if actual != name:
problems.append("rename '%s' to %s" % (actual, name))
if text(field(item, 'chkItemTypeName')) != 'Check':
problems.append('set Type to Check')
if text(field(item, 'dataTypeName')) != 'String':
problems.append('set Data Type to String')
if not truthy(field(item, 'enabled')):
problems.append('select Enabled')
if not truthy(field(item, 'required')):
problems.append('select Required')
check(not problems, '%s is an enabled, required String check' % name, '; '.join(problems).capitalize() + '.')

listName = text(field(item, 'pickListName'))
responses = pickList(field(item, 'pickListValues'))
wrong = [cat for cat in RESPONSES if responses[cat] != sorted(RESPONSES[cat])]
if listName != 'Text':
check(False, '%s uses the Text entry options' % name,
"Its entry option is '%s'. Under Entry Options, choose Text." % (listName or 'none'))
else:
check(not wrong, '%s has the four responses' % name,
'Under Entry Options, set Clean as Pass, Passable as Warning, Over-Cluttered and Dirty as Fail. Now: %s'
% '; '.join('%s %s' % (cat, ', '.join(responses[cat]) or 'none') for cat in ('PASS', 'WARNING', 'FAIL', 'NEUTRAL')))
extra = [text(field(i, 'chkItemName')) for i in items if key(field(i, 'chkItemName')) not in [key(n) for n in ITEMS]]
if extra:
note('Other items on the sheet: %s. The lesson only has the four areas.' % ', '.join(extra))

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

check-sheet-cleanliness-check.json: The finished Cleanliness Check