Skip to main content

Build the Check Sheet

Build the Receiving Inspection​

The Receiving Inspection checks a delivery of raw material: who supplied it, which lot it is, when it expires and, optionally, what it looked like. It's started by hand when a delivery arrives, needs no sign-off, and requires an item, so every inspection is tied to the material received.

Configure the Check Sheet​

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'.

Create the check sheet and its folder
  1. Navigate to Configuration → Quality → Check Sheets and add a check sheet named Receiving Inspection.
  2. On the Settings tab, click the folder button to open folder management.
  3. Create Warehouse and Operations folders under CoreForge.
  4. Put the check sheet in CoreForge\Warehouse.
  5. Select Item Required and choose the item class CoreForge\RM.
info
  • Folders keep check sheets organized as the list grows. Group them by whatever your users look for: department, process area, check type, quality program, customer or site.
  • Item Required makes the user pick an item when they start the check. Limiting the choice to an item class keeps the list short and reuses the plant's item master, so nobody retypes material names.
  • The item gives each inspection its context and restricts what can be picked. A check sheet can also use the item to look up a different tolerance for each part family.

Add Check Items​

Reference Materials: Check Item Settings - General

Check Item Settings - General​

Configure Check Items

Give your check item a name and assign it to a group. You can enable or disable it and determine whether it is a required or optional check. You can also add instructions that are displayed to the user when they select this check item.

Check Type​

There are several check types you can select from...

  • Check This is the main check type in that this check item will receive a value and store it against this check item.
  • Calculated A calculated check will perform a custom calculation based on the values of other check items. Those check items can be check types or calculated types themselves.
  • Trigger A trigger check is used to trigger the capture of other check item values.

Data Type This property defines the expected type of data expected to be received by this check and this selection drives other check item selections, including the component presented to the use to input the value. Options are Boolean, Datetime, Float, Geo Location, Image, Integer, String.


Reference Materials: Check Item Settings - Data Properties

Check Item Settings - Data Properties​

Configure Check Items

  • Number of Measurements: Set the # of measurements to be taken for this check. Allows for within-subgroup variance analysis.
  • Assign Attribute: Attributes are used to associate a check with a tolerance spec and a data source tag path. A check reads its value from either an attribute or its own data source tag, so Assign Attribute is hidden while a data source tag is set.
  • Data Source Tag: A tag the check reads its value from without an attribute, for a value that isn't specific to an asset (a utility supply temperature, say). Type the tag path or browse for it with the tag button. Like an attribute's data source, the tag is read when the check is triggered by a trigger check, and on an auto check sheet. Shown when the check has no attribute.
    • Scale Factor: The tag value is multiplied by this; empty is 1.
    • Ignore Zero Values: A zero read from the tag is treated as no value.
  • Dynamic: When enabled, this check item will only be shown when a valid tolerance can be found for the associated attribute. Usage is to prevent displaying checks that may not be valid for certain items (products/materials).
  • Units: Define engineering units for data display. Standard units are added for you, including °C, °F, µm, mL, kPa, N·m, pH, ppm, µS/cm, Ω and kΩ; any other unit can be typed in, with any symbol.
  • Format: Enter a format string for data presentation following the custom numeric string format i.e. #,##0.##
  • Persistent: When enabled, persistence will copy over the value entered the last time this check was taken. If asset and/or item is required, it will use previous value for that asset/item combination.

Specification​

  • Tolerance: Only shown if check datatype is a String or Number. Number choices are: 'Attribute Tolerance' (if check item is associated with an attribute), 'Tolerance', 'Set Point' and 'Range'. String choices are: 'Regex'.
  • Range: A value outside the range is saved as a failed check. Optional Entry Limits (Lower and Upper Entry Limit) go further: a value outside them is refused when it is entered, with a message, rather than saved. Set the entry limits to the range itself to make the range strict, so a value outside it can't be entered at all. A value between the entry limits but outside the range is still accepted and saved as failed. The entry limits are shown in red when they sit inside the range.

The data type of a check item decides what the user sees when they fill it in: a pick list, a text box, a date picker or an image upload. Validation rules make sure the value is usable before it's saved.

Add the check items
  1. Open Receiving Inspection and add these check items on the Checks tab. All are Type Check and Enabled.

    Check itemData typeRequiredSettings
    Supplier NameStringYesEntry Options Text with the Neutral responses AlloySource Materials, Summit BlendChem and Keystone Industrial Ingredients
    Lot NumberStringYesInstructions: Must be between 6 and 20 characters and all letters must be capitalized. Specification: Regex ^[A-Z0-9]{6,20}$
    Expiration DateDatetimeYes
    Product ImageImageNo
    Show the check items
    Receiving Inspection Check items
  2. Close the editor and release the check sheet.

info
  • The supplier responses are Neutral: they record information but don't pass or fail the check. Users can also type a supplier that isn't in the list.
  • Enabled decides whether an item appears at all. Required decides whether the check can be submitted with it blank.
  • The regex only accepts 6 to 20 uppercase letters and digits, so LOT20260515 is accepted and ab123 isn't.

Check Your Work​

Check your work

Copy this script into the Ignition Designer Script Console (Tools → Script Console) and run it. It checks the Warehouse and Operations folders, that Receiving Inspection is released in CoreForge\Warehouse and requires a CoreForge\RM item, and the data type, Required setting, supplier responses, regex and instructions of each check item. Each check prints PASS or FAIL with what to fix. It doesn't change anything.

Show the check script
checkLesson-receivingBuild.py
# Kanoa Quality Training - check "Build the Check Sheet" (Receiving Inspection, lesson 2)
#
# 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 = 'Receiving Inspection'
FOLDER = 'CoreForge\\Warehouse'
FOLDERS = ['CoreForge\\Warehouse', 'CoreForge\\Operations']
ITEM_CLASS = 'CoreForge\\RM'
SUPPLIERS = ['AlloySource Materials', 'Keystone Industrial Ingredients', 'Summit BlendChem']
REGEX = '^[A-Z0-9]{6,20}$'
ITEMS = [
# name, data type, required
('Supplier Name', 'String', True),
('Lot Number', 'String', True),
('Expiration Date', 'Datetime', True),
('Product Image', 'Image', False),
]

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

def spec(item):
try:
return dict(system.util.jsonDecode(text(field(item, 'specification')))) if text(field(item, 'specification')) else {}
except:
return {}

print '=' * 70
print 'Kanoa Quality Training - Build the Receiving Inspection check'
print '=' * 70

# 1. Folders
print '\n-- Folders'
folders = set(text(field(r, 'path')) for r in rows(system.kanoa.quality.sheet.getSheetTypes({})))
for path in FOLDERS:
check(path in folders, 'Folder %s exists' % path,
'On the Settings tab of a check sheet, click the folder button and add %s under CoreForge.' % path.split('\\')[-1])

# 2. 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, add a check sheet named %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." % (folder or 'no folder', FOLDER))
check(truthy(field(sheet, 'itemReqd')), 'Item Required is selected', 'On the Settings tab, select Item Required.')
classes = [text(field(r, 'itemClassPath')) for r in rows(system.kanoa.quality.sheet.getItemClasses(field(sheet, 'chkShtId')))
if truthy(field(r, 'enabled')) or field(r, 'enabled') is None]
check(ITEM_CLASS in classes, 'Items are limited to the %s class' % ITEM_CLASS,
'On the Settings tab, under Item Required, choose the item class %s.%s'
% (ITEM_CLASS, (' Now: %s.' % ', '.join(classes)) if classes else ''))
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'))

# 3. Check items
if sheet is not None:
print '\n-- Check items'
items = rows(system.kanoa.quality.config.getChecks({'chkShtId': field(sheet, 'chkShtId')}))
for name, dataType, required in ITEMS:
item = findItem(items, name)
if item is None:
check(False, '%s exists' % name, 'On the Checks tab, add a check item named %s.' % name)
continue
problems = []
actual = text(field(item, 'chkItemName'))
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')) != dataType:
problems.append("set Data Type to %s (it's %s)" % (dataType, text(field(item, 'dataTypeName')) or 'blank'))
if not truthy(field(item, 'enabled')):
problems.append('select Enabled')
if truthy(field(item, 'required')) != required:
problems.append('select Required' if required else 'clear Required')
check(not problems, '%s is an enabled %s %s check' % (name, 'required' if required else 'optional', dataType),
'; '.join(problems).capitalize() + '.')

if name == 'Supplier Name':
responses = pickList(field(item, 'pickListValues'))
ok = text(field(item, 'pickListName')) == 'Text' and responses['NEUTRAL'] == SUPPLIERS \
and not (responses['PASS'] or responses['WARNING'] or responses['FAIL'])
check(ok, 'Supplier Name has the three suppliers as Neutral responses',
'Under Entry Options, choose Text and add %s, each as Neutral.' % ', '.join(SUPPLIERS))
elif name == 'Lot Number':
s = spec(item)
regex = text(dict(s.get('regex') or {}).get('value'))
check(text(s.get('specType')).lower() == 'regex' and regex == REGEX, 'Lot Number is validated with the regex %s' % REGEX,
"Its specification is '%s'. Under Specification, choose Regex and enter %s." % (regex or text(s.get('specType')) or 'none', REGEX))
check(text(field(item, 'instructions')), 'Lot Number has instructions',
'Enter the instructions: Must be between 6 and 20 characters and all letters must be capitalized.')

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 Receiving Inspection is built and released.'
else:
print 'Fix the FAIL items above, then run this again.'
print '=' * 70
Finished Check Sheet

check-sheet-receiving-inspection.json: The finished Receiving Inspection Check