Kanoa Quality Training
This section is focused on Kanoa Quality: digital check sheets, how checks get to the right people at the right time, and how to analyze the results.
You'll build five check sheets for the CoreForge plant, each one adding new features:
| Chapter | Check sheet | What it adds |
|---|---|---|
| Cleanliness Check | Cleanliness Check | The basic workflow: check sheet, check items, release, complete, review |
| Receiving Inspection | Receiving Inspection | Folders, item context, typed and validated items, mobile entry, revisions, corrections |
| First Article Inspection | Machining - First Article Inspection | Item sets, attribute tolerances, multiple measurements, mode-change triggers, notifications, Check Summary |
| Coating Line SPC | Coating SPC Checks | Attributes that read tags, automatic checks, timed triggers, Check Details and SPC |
| Offline Lab Inspection | Offline Lab Inspection | Trigger and calculated items, groups, sign-off, persistence, test fail actions |
- Complete Kanoa Ops Training. Quality uses the CoreForge assets, items, modes, and production runs you built there.
- Log in as your own user with Gateway Admin rights, as in the Ops course. The lessons build, release and revise check sheets, which needs Gateway Admin rights or the Configure Quality function.
If your CoreForge model is missing anything the Quality lessons use, you can import coreforge-asset-model.json.
Copy this script into the Ignition Designer Script Console (Tools → Script Console) and run it. It checks that your own user is a Gateway Admin, that Machine 1 to Machine 8 exist under Machining and are OEE Enabled, that Spray Line 1 and the Finishing area exist, and that the AL6061 raw material and the nine machined parts are in their item classes. Each check prints PASS or FAIL with what to fix. It doesn't change anything.
Show the check script
# Kanoa Quality Training - check "Before you Start" (course start page)
#
# 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.
ADMIN_NAMES = ['admin']
MACHINES = ['CoreForge\\Philadelphia\\Machining\\Machine %d' % n for n in range(1, 9)]
SPRAY_LINE = 'CoreForge\\Philadelphia\\Coating\\Spray Line 1'
FINISHING = 'CoreForge\\Philadelphia\\Finishing'
RM_CLASS = 'CoreForge\\RM'
RM_ITEM = 'AL6061'
MACHINED_CLASS = 'CoreForge\\WIP\\Machined'
MACHINED_ITEMS = ['%s-%s' % (family, alloy) for family in ('CP', 'PR', 'SC') for alloy in ('2024', '6061', '7075')]
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 truthy(v):
return str(v).lower() in ('true', '1', 'yes')
def toId(v):
# ids can come back as floats (2.0) through the Designer's RPC on Ignition 8.3; Kanoa wants an int
try:
return int(float(text(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]
print '=' * 70
print 'Kanoa Quality Training - getting started check'
print '=' * 70
# 1. Your own user, as a Gateway Admin
print '\n-- Your user'
users = rows(system.kanoa.security.getUsers({}))
admins = []
for u in users:
try:
if system.kanoa.security.checkIsGatewayAdmin(toId(field(u, 'userId'))):
admins.append(u)
except:
pass
own = [u for u in admins if text(field(u, 'userName')).lower() not in ADMIN_NAMES]
check(own, 'Your own user is a Gateway Admin',
'Log in as a Gateway Admin, then in Configuration > Users give your user the Gateway Admin role, as in the Ops course.')
if own:
note('Gateway Admin: %s' % ', '.join(text(field(u, 'userName')) for u in own))
# 2. The CoreForge assets from the Ops course
print '\n-- CoreForge assets'
assets = {}
for r in rows(system.kanoa.asset.getAssets({})):
assets[text(field(r, 'assetPath', 'path'))] = r
missing = [p for p in MACHINES if p not in assets]
check(not missing, 'Machine 1 to Machine 8 exist under Machining',
'Missing: %s. Finish Scaling Across the Enterprise in the Ops course, or import coreforge-asset-model.json from this page.'
% ', '.join(p.split('\\')[-1] for p in missing))
notOee = [p.split('\\')[-1] for p in MACHINES if p in assets and not truthy(field(assets[p], 'oeeEnabled', 'oeeEnable'))]
if not missing:
check(not notOee, 'The machines are OEE Enabled',
'Not OEE Enabled: %s. Open each one in Configuration > Ops > Assets, select OEE Enabled and save.' % ', '.join(notOee))
check(SPRAY_LINE in assets, 'Spray Line 1 exists under Coating',
'Add it as in the Ops course, or import coreforge-asset-model.json from this page.')
check(FINISHING in assets, 'The Finishing area exists',
'Add the Finishing area under CoreForge\\Philadelphia, as in the Ops course.')
# 3. The items the Quality lessons use
print '\n-- CoreForge items'
classIds = {}
for r in rows(system.kanoa.item.getItemClasses({})):
classIds[text(field(r, 'itemClassPath', 'path'))] = field(r, 'itemClassId')
def itemNames(classPath):
classId = classIds.get(classPath)
if classId is None:
return None
return set(text(field(r, 'itemName')) for r in rows(system.kanoa.item.getItems({'itemClassId': classId})))
rm = itemNames(RM_CLASS)
check(rm is not None and RM_ITEM in rm, '%s is in the %s item class' % (RM_ITEM, RM_CLASS),
'Run the item script from Scaling Across the Enterprise in the Ops course, or import coreforge-asset-model.json from this page.')
machined = itemNames(MACHINED_CLASS)
missingItems = [i for i in MACHINED_ITEMS if machined is None or i not in machined]
check(not missingItems, 'The nine machined parts are in %s' % MACHINED_CLASS,
'Missing: %s. Run the item script from Scaling Across the Enterprise in the Ops course, or import coreforge-asset-model.json from this page.'
% ', '.join(missingItems))
passed = results.count(True)
print '\n' + '=' * 70
print 'Result: %d of %d checks passed' % (passed, len(results))
if passed == len(results):
print 'All good. You are ready to start the Quality course.'
else:
print 'Fix the FAIL items above, then run this again.'
print '=' * 70

