Kanoa Ops Training
This section is focused on Kanoa Ops, the core operational foundation of Kanoa MES.
We'll start by modeling the assets within the plant, creating materials (items), linking them to assets, configuring their expected production rates, and configuring asset modes and states. We'll then connect PLC tags to automate data collection, schedule operations on assets, and pull production orders from an ERP. Next, we'll manage users and their roles, customize the navigation menu, build dashboards and marquees, and use scripts to scale the model across the enterprise. Finally, we'll explain speed losses with performance reasons, record custom and measured process values, and analyze how effectively operators' time is used.
The first user to log into a freshly installed Kanoa MES application automatically receives Gateway Admin rights, and only Gateway Admins can grant Gateway Admin rights to other users. Do not log in as admin. Create a user in the Ignition default user source with a first and last name, and log in as that user.
Let's start by having you log into the application. This is a really important first step!
- Create a user in the Ignition default user source with a first and last name.
- Launch the KanoaMES project from the Gateway Page and log in as that user.
Next let's setup this Gateway as a development environment. In a development environment, gateway admins can delete asserts even if they have production data linked to them. In a production environment, we provide safeguards against inadvertently deleting all your production data.
- Navigate to Configuration → Application → Settings.
- set Environment to 'Development'
Copy this script into the Ignition Designer Script Console (Tools → Script Console) and run it. It checks that a user with a first and last name (not admin) has logged in to Kanoa and is the Gateway Admin, and that the environment is set to Development. Each check prints PASS or FAIL with what to fix. It doesn't change anything.
Show the check script
# Kanoa Ops Training - check the Ops Training 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'] # built-in gateway accounts you shouldn't log in to Kanoa with
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 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 Ops Training - getting started check'
print '=' * 70
# 1. Logged in as your own user, who became Gateway Admin by logging in first.
# Kanoa creates a user's record the first time they log in to the application.
print '\n-- Your user'
users = rows(system.kanoa.security.getUsers({}))
admins = []
for u in users:
try:
if system.kanoa.security.checkIsGatewayAdmin(field(u, 'userId')):
admins.append(u)
except:
pass
def describe(u):
name = ('%s %s' % (text(field(u, 'firstName')), text(field(u, 'lastName')))).strip()
return '%s (%s)' % (text(field(u, 'userName')), name or 'no name')
own = [u for u in users if text(field(u, 'userName')).lower() not in ADMIN_NAMES]
named = [u for u in own if text(field(u, 'firstName')) and text(field(u, 'lastName'))]
ownAdmins = [u for u in admins if u in named]
check(named, 'A user with a first and last name has logged in to Kanoa',
'In the Ignition default user source, create a user with a first and last name, then launch the '
'KanoaMES project from the Gateway page and log in as that user.' +
((' Users without a name: %s.' % ', '.join(describe(u) for u in own)) if own else ''))
if named:
check(ownAdmins, 'Your user is a Gateway Admin',
('Gateway Admins: %s. ' % ', '.join(describe(u) for u in admins) if admins else '') +
'The first user to log in becomes Gateway Admin. Log in as a Gateway Admin, then in Configuration > Users '
'give your user the Gateway Admin role.')
if ownAdmins:
note('Gateway Admin: %s' % ', '.join(describe(u) for u in ownAdmins))
builtIn = [u for u in admins if text(field(u, 'userName')).lower() in ADMIN_NAMES]
if builtIn:
note("%s is a Gateway Admin. That's fine, but don't use it for the training." % ', '.join(describe(u) for u in builtIn))
# 2. The gateway is set up as a Development environment
print '\n-- Environment'
configs = rows(system.kanoa.config.getConfig({}))
envRows = [c for c in configs if 'environment' in text(field(c, 'configName')).lower()]
if not envRows:
note("Couldn't find the environment setting%s. Check Configuration > Application > Settings by hand."
% ((' (config names: %s)' % ', '.join(sorted(set(text(field(c, 'configName')) for c in configs)))) if configs else ''))
else:
value = text(field(envRows[0], 'configValue', 'value', 'configValueString'))
check(value.lower().startswith('dev'), 'Environment is Development',
"It's '%s'. Go to Configuration > Application > Settings and set Environment to Development." % (value or 'not set'))
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're ready to start."
else:
print 'Fix the FAIL items above, then run this again.'
print '=' * 70





