Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
24 views396 pages

Ignition Core Manual

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views396 pages

Ignition Core Manual

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 396

HMI · SCADA Software

5-Day Ignition Training


Core Course

800.266.7798
www.inductiveautomation.com
Ignition
by Inductive Automation
5-Day Ignition Core Training

Copyright 2019
All rights reserved.

Inductive Automation
90 Blue Ravine Road
Folsom, CA 95630
5-Day Ignition Core Training
© 2019 Inductive Automation

All rights reserved. No part of this work may be reproduced in any form or
by any means - graphic, electronic, photographic or mechanical; including,
but not limited to, photocopying, recording, taping or information storage
and retrieval systems - without the written permission of Inductive
Automation.
All Inductive Automation product names, including, but not limited to,
Ignition by Inductive Automation®, Ignition Edge by Inductive
Automation®, Ignition SCADA by Inductive Automation®, Perspective®, as
well as the company name, Inductive Automation® and Ignition check mark
symbol and the Inductive Automation sprocket/arrow symbol are
trademarks of Inductive Automation, either through federal registration or
continuous use. Other brand and product names are trademarks of their
respective holders.
Every effort has been made to make this book as complete and as accurate
as possible, but no warranty of fitness is stated or implied. The information
provided is on an "as is" basis without any warranty of any kind. Inductive
Automation shall have neither liability nor responsibility to any person or
entity with respect to any loss or damages from any acts or omissions
arising or based upon the information contained in his book.

Printed: December 2019 in the U.S.A.


Version: 8.0

2 ©2019 Inductive Automation


Table of Contents

Welcome ..................................................... 1
About this Training . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1

Chapter 1. Software Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


What Is Ignition? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Ignition Software Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Ignition as a Communications Hub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Ignition’s Various Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Ignition’s Main Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

Chapter 2. Installation and Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . 7


Install Ignition on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
Commissioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Installing a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Accessing the Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Licensing and Activating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
How Licensing Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
How Activation Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Chapter 3. Connecting to PLCs and Databases . . . . . . . . . . . . . . . . . . 23


Connecting to Simulators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Connecting to Allen Bradley Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Connecting to a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Microsoft SQL Server Connection Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Chapter 4. Launch Designer and Create a Project . . . . . . . . . . . . . . . 37


Launching the Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

©2019 Inductive Automation i


Table of Contents

Chapter 5. Vision Clients, Windows, and Navigation . . . . . . . . . . . . . 43


Launch Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Downloading and Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Windows, Components, and Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Window Names and Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Types of Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Changing Window Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Anatomy of a Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Adding a Window to Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Chapter 6. Vision Component Properties and Bindings . . . . . . . . . . 61


Configuring Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Dragging Components to Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Understanding Component Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Drawing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Component Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Understanding Property Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

Chapter 7. Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Main Benefits of Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Tag Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Creating Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Tag Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Dragging Tags to Windows and Components . . . . . . . . . . . . . . . . . . . . . . 92
Types of Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Creating Memory Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Creating a Derived Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Client and Gateway System Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
System Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Vision Client Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Tag Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

ii ©2019 Inductive Automation


Table of Contents

Chapter 8. Complex Tags (UDTs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111


Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Creating Complex Tags (UDTs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Making Instances of the UDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Overriding UDT Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Nesting UDTs and Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

Chapter 9. Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125


Master Template and Template Instances . . . . . . . . . . . . . . . . . . . . . . . . . 126
Template Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Creating a Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Creating Indirect Tag Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

Chapter 10. Tag History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147


Log the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Logging Data for the Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Data Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

Chapter 11. Display Historian Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155


Create a Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Add Subplots to the Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Customize the Easy Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Using a Tag Browse Tree with the Easy Chart . . . . . . . . . . . . . . . . . . . . . . 163
Creating Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

Chapter 12. Transaction Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173


The Transaction Execution Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Types of Transaction Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Common Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Group Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Handshaking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Creating a Basic History Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Creating a Recipe Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

©2019 Inductive Automation iii


Table of Contents

Chapter 13. Alarming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195


Alarm Journal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Alarm Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Alarm Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Configure a Digital Alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Alarm Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Alarms in UDTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

Chapter 14. Alarm History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217


View Alarming History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

Chapter 15. Alarm Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225


Alarm Notification Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Alarm Notification - User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Alarm Notification — On-Call Rosters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Alarm Notification — Email Notification . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Alarm Notification - Pipelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Alarm Notification - Escalation Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . 242

Chapter 16. Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247


Authentication Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Basic Security Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Component Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Gateway Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

Chapter 17. Popup Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263


Creating a Popup Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Opening Multiple Instances of a Popup Window . . . . . . . . . . . . . . . . . . 274
Creating an Indirect Easy Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Creating a Dynamic Alarm Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284

iv ©2019 Inductive Automation


Table of Contents

Chapter 18. Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287


What Is Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Learning Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Python in Ignition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

Chapter 19. Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309


Creating a View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Tag Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Deep Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Coordinate Layout Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Page Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Launching a Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Perspective Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Embedding Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Breakpoint Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Perspective Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

Chapter 20. Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353


Creating a Basic PDF Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Adding Data to Your Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Designing Your Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Client Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

Chapter 21. Gateway Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373


Connect to a Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Set Up a Remote Tag Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376

Chapter 22. Backups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379


Gateway Backup/Restores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Creating a Scheduled Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Project Backup/Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382

©2019 Inductive Automation v


Table of Contents

vi ©2019 Inductive Automation


Welcome

Thank you for choosing Ignition by Inductive Automation, a highly


configurable industrial automation SCADA/HMI software.

About this Training


We will use a step-by-step approach to teach you the core features and
capabilities offered by Ignition. We focus on the Ignition platform and its
main modules: Vision, Perspective, SQL Bridge, Tag History, Reporting, and
Alarming.
Although the architecture of Ignition is modular, the modules are seamlessly
integrated so you can focus on the tasks being performed.
Some of the things you will learn in this training are: how to install the
software, connect to PLCs and SQL Databases, create your own projects,
create Tags and store history, launch Clients and Sessions, set alarms and
notification, and generate reports.
Let's get started!

1
2 ©2019 Inductive Automation
Chapter 1

Software
Introduction

This chapter introduces you to Ignition. It describes what Ignition is, what it
can do, what modules are, and how Ignition can be used in different
situations such as redundancy and in network security.

What Is Ignition?
Ignition is a software platform for creating custom human machine interface
(HMI), supervisory control and data acquisition (SCADA), manufacturing
execution system (MES), and Industrial Internet of Things (IIoT)
applications. Ignition is designed from ground up to be approachable and
easy to get started with while it is flexible and capable of scaling up to the
largest projects. Ignition is installed as server software and it is based
heavily on current web technologies.

©2019 Inductive Automation 3


Software Introduction

Ignition’s Basic Flow


Ignition is unique in the industrial space because it is server-centric. You
launch a Designer and pull data from the Gateway. Then when you save
your project, it’s stored back into the Gateway. When runtime Clients are
opened, they pull from the Gateway as well. This means any computer that
has a connection to the Gateway will always be up to date.

What Can Ignition Do?


Ignition has a unified architecture that provides a way to create anything
you need. It can be used for SCADA, historian, reporting, database
applications, alarming, and more. You can also mix and match to get the
functionality that you want and leave out the rest.

What Makes Ignition Special?


There are a few key points that set Ignition apart from other HMI/SCADA
software. The licensing is sold by the server and it gives unlimited Tags,
Clients, screens, connections, and devices. It has a small installer that
downloads and installs in minutes across Windows, Mac, and Linux. The
Designer is included and allows you to quickly create projects, bind values,
set up expressions, and add scripts. It’s modular so it is flexible and
scalable. And it’s easy to get started and see real results in just a few
minutes.

What Are Modules?


Modules are applications that are built on the Ignition platform, they are
similar to applications for a smartphone. The modules are seamlessly
integrated onto Ignition so you can choose them based on your system and
plant requirements. Modules include OPC UA connections and drivers,
visualization systems, historical storage, alarm notification and more.

Ignition Software Stack


The architecture or high-level structure of the Ignition software has several
distinct layers. The Platform sits in Java, so it is OS agnostic. The modules
are in the platform and can access any functionality in the platform.
Additional modules are built to work using the core modules’ functionality as
a starting point.

4 ©2019 Inductive Automation


Software Introduction

Ignition as a Communications Hub


You can use Ignition as an effective communication hub in your network.
This central location is possible because Ignition will talk to many types of
devices and services.

Ignition’s Various Architectures


Ignition being a modern software and system, it combines web servers,
databases, and OPC UA. This combination allows a wide variety of powerful
configurations based on the customer’s system and plant needs. There are
several types of architectures that can be built with Ignition starting from a
standalone installation and going all the way to a multi-site system spread
through different countries. Ignition can be used in the cloud if you want,
and has failover redundancy as a primary feature.

Ignition’s Main Parts


Ignition has four main parts: Gateway, Designer, Vision Clients, and
Perspective Sessions. The Gateway is the primary service that drives
everything. The Designer is an application that lets you configure and build
your projects. Vision Clients are launched from the Gateway, run as full
applications and feel like traditional installed clients without the need to
install and manually synchronize projects. Clients are the "runtimes" of the
Vision Module. Perspective Sessions are launched from the Gateway, run in
a web browser, and feel like traditional installed clients that synchronize
automatically. Sessions are the "runtimes" of the Perspective Module.

Gateway
The Gateway’s architecture contains many parts, each one performing
specific tasks or serving up information to other systems. The Gateway
contains database and device connections, Tags, alarms, user sources,
projects, and more.

Projects
A project is the central unit of configuration. A project contains Windows,
Views, Transaction Groups, and more. You use the Ignition Designer to
design and create projects. There is no limit to the number of projects you
can create in the Gateway.

©2019 Inductive Automation 5


Software Introduction

Shared Settings among all Projects


It’s important to note that many systems in the Gateway are shared among
all projects like Tags, database connections, authentication profiles, OPC
and device connections, alarm storage and notification.

6 ©2019 Inductive Automation


Chapter 2

Installation and
Activation

Ignition can be installed on any 64 bit Windows, Linux, or Mac OS X


operating system. The installer can be downloaded from our ia.io website
and installed on any modern computer for testing. When using Ignition in
production, and server class computer is recommended.
The minimum system requirements for Ignition are extremely low, but we
recommend at least a dual core processor, 4GB RAM, and 10GB free HD
space.

©2019 Inductive Automation 7


Installation and Activation

Install Ignition on Windows


Before you install Ignition, make sure you have Administrator privileges to
run the Ignition installer. There is an installer already downloaded and
added to your desktop in class. If you do not have an installer, you can
download the it from the inductiveautomation.com website.

1. Go to your desktop and find the installer file. It is an executable file


named something like: Ignition-X.X.X-windows-x64-installer.exe, where
X.X.X is the version number.

2. Double-click on the .exe executable file to start installation.

The Setup window welcomes you to the Ignition Setup Wizard.

3. Click Next.

8 ©2019 Inductive Automation


Installation and Activation

4. Click the I have read and agree with the terms and conditions
button and click Next.

The Installation Directory window is displayed. By default, Ignition is


installed under your Program Files directory. This is usually a good choice.

©2019 Inductive Automation 9


Installation and Activation

5. Leave the default Installation Directory, and click Next.

6. The Installation Mode window is displayed. Select the Typical mode.


The Typical installation includes all of the Ignition modules that we’ll
need.

10 ©2019 Inductive Automation


Installation and Activation

7. The Setup Wizard shows that Ignition is now ready to install. Click Next.

Java also gets installed if you do not currently have it installed on your
machine.

8. After the installer is done transferring files, click Next.


9. The Ignition installation is now finished, make sure that the check box for
Start Ignition now is selected, then click Finish.

©2019 Inductive Automation 11


Installation and Activation

Commissioning
Once the Ignition service starts, a web browser will open and you will be
prompted to start the commissioning process.

1. Click the Get Started button to continue.

2. Type in a username and password to create the main user for Ignition.

This can be changed later but will be the primary way we access the
Gateway and Designer in class. Write down your username and password
here.

Username: ___________________

Password: ____________________

12 ©2019 Inductive Automation


Installation and Activation

3. Enter the password again to confirm, then click Next.

©2019 Inductive Automation 13


Installation and Activation

4. Setup is now Complete. Click on the Start Gateway button to start


Ignition. It will take a moment to complete.

5. Click on the Gateway Homepage button to launch the Gateway.

14 ©2019 Inductive Automation


Installation and Activation

Ignition installs itself as a Window Service (Start > Control Panel >
Administrative Tools > Services > Ignition Gateway), so it starts
automatically when your computer starts up.

Installing a Database
To take full advantage of Ignition, you will want to install a database. Our
training computers already have MySQL and Microsoft SQL Server installed
so we don’t need to do anything else.
If you want to install a database on another computer, see the online
manual at docs.inductiveautomation.com.

Accessing the Gateway


The Ignition Gateway, is accessed through a web browser and is the primary
software service that drives everything in Ignition. It is a single application
that runs an embedded web server, connects to data, executes modules,
communicates with Clients and Sessions, and more.

©2019 Inductive Automation 15


Installation and Activation

The Gateway has a web server in it and when it's running you can access it
to make changes and view data through a web page.

1. After Commissioning, your browser is automatically redirected to:


http://localhost:8088
You can open a browser later and enter this address to come back.

If you are at a different machine, you access the Gateway using the
computer name or IP address as follows:
http://ComputerName:8088
http://XXX.XXX.XXX.XXX:8088
Note: To get to the Gateway home page from another machine, the port
8088 must be open on the firewall.

The Gateway is the central location in Ignition where all general services
are configured.

The next step is to login to the configuration section.

2. On the Gateway home page, click on the Config button in the top left
corner.

16 ©2019 Inductive Automation


Installation and Activation

3. Log in using the username and password that you created during the
Commissioning step of the installation.

Once you login, you can navigate to the various areas in the Gateway
using the menu tree on the left side of the page.

Gateway Tabs
The tabs in the upper left of the Gateway lead you to the key sections of the
server.

Home
The Home tab takes you to the home page that shows a list of ways to get
started with Ignition or to learn about it.
• Launch the Designer.
• Launch a Client or Session.
• Learn more about Ignition.

Status
The Status tab, provides you in-depth information about various parts of
the Ignition system. The subpages contain information about the following
and more:
• The state of the installed modules
• The current redundancy map
• The status of all Database connections, OPC Server connections, and Tag
providers
• The status of the store-and-forward engine, including performance
metrics and data cache information
• Current Designers, Clients, and Sessions connected to the Gateway

Config
The Config tab takes you to the Config section where you do all the
Gateway and platform operations such as backing up the system, restoring,
and managing projects in addition to:
• Create new projects.
• Create database connections.
• Create connections to OPC servers.
• Tune performance settings.
• Modify Tags Historian data settings.
• Manage users and roles.

©2019 Inductive Automation 17


Installation and Activation

Launch Designer
The Get Designer button in the top right corner of the page will take you to
download the Designer Launcher installer. Running this will allow you to
launch a Designer and start working on your project.

Licensing and Activating


Ignition has a free trial mode that works for two hours at a time and is
infinitely resettable. For this class, we will activate a week-long license so
we can see uninterrupted history and alarms throughout the week. With this
Ignition server license, we will be able to:
• Launch unlimited runtime clients.
• Create unlimited Tags from devices, OPC servers, and other Tags.
• Connect to unlimited PLCs, SQL databases, and devices.

How Licensing Works


Ignition is a modular platform, therefore it is licensed based on modules.
Licensed and unlicensed modules can operate side-by-side, so some
modules can be tested in trial mode while others are running in a licensed
state.

18 ©2019 Inductive Automation


Installation and Activation

When an individual module is in trial state, Ignition shows the trial time
remaining at the top of the Gateway webpage.

CD-Key and License File


Despite the modular licensing, there is generally one CD-Key for each
server. That is, a single license that dictates which modules are currently
activated.
When module(s) are purchased, you receive a CD-Key, a six digit code, that
identifies your purchase. You then use this CD-Key to activate the software
through the Ignition Gateway. If you are adding an additional module, your
account is updated and you can re-use your existing CD-Key to activate the
new features.
You can unactivate your CD-Key at any time, freeing it for activation on a
different machine.

©2019 Inductive Automation 19


Installation and Activation

How Activation Works


Activation is the method by which a CD-Key is assigned to a computer and
the modules are notified of their license state. Activation can be done
automatically (over the Internet) or manually (by email or through the
Inductive Automation website).
We will walk through activating our copy of Ignition over the Internet.

Activate Ignition Online


1. Go to the Gateway home page, and login to the Configure section.

2. From the menu on the left, select System > Licensing.

3. Click on the Activate Online button on the right.

The Activate Online window is displayed.

20 ©2019 Inductive Automation


Installation and Activation

4. Enter your CD-Key and click Activate.

Once activated, the Current License is displayed and if you expand it, you
can see all of the modules attached to your CD-Key.

5. Go to the Status section of the Gateway and select Systems > Modules.

The Module Configuration page is displayed. Notice that the license


column for some or all the modules are now listed as activated
(depending on your CD-Key).

©2019 Inductive Automation 21


Installation and Activation

22 ©2019 Inductive Automation


Chapter 3

Connecting to PLCs
and Databases

Now that you installed Ignition and logged into the Config section of the
Gateway, you can add or connect to devices and databases. A device is a
named connection to an industrial device like a PLC. If you don't have a real
device, Ignition has simulator devices you can add which act as if it is a
connection to a real device.
A Database is a piece of software that allows you to store data long term for
historical or other purposes.
In this section we will show you how to connect to simulator devices, real
PLC devices, and a database.

©2019 Inductive Automation 23


Connecting to PLCs and Databases

Connecting to Simulators
Connecting to a Simulator Device
We need to connect to a few devices to give us Tags to work with throughout
the week. These will be used later for realtime values, history, and alarms.

1. From Gateway, go to the Config section.

2. From the menu on the left, select OPC UA > Device Connections.

The Devices page is displayed.

3. Click on Create new Device....

4. On the Device type selection page, select Programmable Device


Simulator and click Next.

24 ©2019 Inductive Automation


Connecting to PLCs and Databases

5. The following New Device page for Programmable Device Simulator


is displayed.

Enter GenSim as the Name and click Create New Device to add your
device.

6. Your device is now added and the following table is displayed. If Ignition
connected successfully, under the Status column it shows Running.

©2019 Inductive Automation 25


Connecting to PLCs and Databases

7. Now we can set the program for the simulator. On the right, click on the
More dropdown and select edit program.

8. On the Load Program dropdown, select the Generic Program option


and click the Load Simulator Program button.

9. You will see many instructions appear. This is how the simulator creates
Tags and sets their values. Click the Save Program button.

26 ©2019 Inductive Automation


Connecting to PLCs and Databases

10. The simulator gets its values from an instruction file. Each instruction file
has a set of Time Intervals and Tag Paths. If there is more than one Time

©2019 Inductive Automation 27


Connecting to PLCs and Databases

Interval for a Tag, it will step through those values in order. You could
alternatively have a single time Interval and a function in the Value
Source field. The Generic Program that we loaded uses this method for
Tag values. This makes the Tags step through generated values like
Ramps, Sines, and others.

You can manually create these instruction files if you want to simulate
your running process. It is best to Export the File (as a CSV), modify it in
another program like Excel, and re-import the file.

Connecting to Allen Bradley Devices


Now we will connect to two real PLCs: a ControlLogix and a MicroLogix. You
should still be in the Config section on the Device Connections page.

11. Click on Create new Device....

The Device type selection page is displayed.

12. Select Allen-Bradley Logix Driver and click Next.

The Device details page is displayed showing the available settings for AB
Logix v21+ devices.

28 ©2019 Inductive Automation


Connecting to PLCs and Databases

13. Enter the following information:

Name: CLX
Hostname: 172.16.3.103
Slot Number: 0

Note: Leave the connection path blank.

©2019 Inductive Automation 29


Connecting to PLCs and Databases

14. Click Create New Device.

This takes you back to the Devices page and will say have Successfully
created new Device "CLX". After a few seconds, the CLX device will
show "Connected" in the Status column.

Now we will connect to a second MicroLogix device.

15. From the Devices page, click on Create new Device....

The Device type selection page is displayed.

16. Select Allen-Bradley MicroLogix and click Next.

The Device details page is displayed showing the available setting for AB
MicroLogix.

17. Enter the following information:


Name: MLX
Hostname: 172.16.3.101 (or 172.16.3.102)

30 ©2019 Inductive Automation


Connecting to PLCs and Databases

18. Click on Create New Device.


The Devices page is displayed showing that you have now Successfully
created new Device "MLX".

Now you have installed 3 devices that are all connected as shown below:

©2019 Inductive Automation 31


Connecting to PLCs and Databases

Connecting to a Database
Many of the advanced features of Ignition, such as Transaction Groups and
Tag Historian, require a connection to an external database.
This section describes how you can connect to an external database such as
Microsoft SQL Server.

Connecting to Microsoft SQL Server


1. From the Gateway, go to the Config section.

2. From the menu on the left, select Databases > Connections.

3. Click on Create new Database Connection....

4. Select Microsoft SQLServer and click Next.

32 ©2019 Inductive Automation


Connecting to PLCs and Databases

5. On the New Database Connection page, enter the following


information:
Name: MSSQL
Connect URL: jdbc:sqlserver://localhost\SQLEXPRESS

Note: We are connecting to the express edition of SQL Server. If you have
the full SQL Server, replace SQLEXPRESS with MSSQLSERVER, or
whatever your instance name is.

username: sa
password: sqlserver (password is what you entered during the SQL
Server installation, for Training, password is sqlserver)
Extra Connection Properties: databaseName=test (enter your database
name here if it is different)

©2019 Inductive Automation 33


Connecting to PLCs and Databases

34 ©2019 Inductive Automation


Connecting to PLCs and Databases

6. At the bottom of the form, click on Create New Database Connection.

Your connection is now created and the Database Connections page is


displayed showing the Status of your connection as Valid.

7. To display the details about the status of your database connection, see
the Note on the above window and click on the Database Connection
Status link.

Microsoft SQL Server Connection Guide


There are several different ways to connect to Microsoft SQL Server, but in
class we already have one type set up. If you want to use a different way to
connect, you can find a complete connection guide in the online
documentation at https://docs.inductiveautomation.com.

©2019 Inductive Automation 35


Connecting to PLCs and Databases

36 ©2019 Inductive Automation


Chapter 4

Launch Designer
and Create a
Project

Now that we have set up some connections, we'll launch the Designer and
get started creating a project. Ignition has a special launcher program
available in the Gateway that allows us to use the Designer without first
installing Java on any computer.
Once the Designer is open, we will familiarize ourselves with the panels and
workspaces that are available. Configuration for almost every module is
available through the Designer, and this is where we will be spending most
of our time throughout the week working on our projects.

©2019 Inductive Automation 37


Launch Designer and Create a Project

Launching the Designer


1. Click the Get Designer button on the upper-right of any Gateway page.
This will take you to the Download page for the Designer Launcher.

2. Click on the Download for Windows button at the top of the page. This
page will attempt to detect your operating system and give you the
correct installer.

3. When the DesignerLauncher.exe file is downloaded, run it.

The first screen that opens allows you to create a desktop shortcut. Click
Next to continue.

38 ©2019 Inductive Automation


Launch Designer and Create a Project

4. The Designer Launcher is ready to install. Click the Install button and
wait a few seconds for it to complete.

5. When the installer is done, click the Finish button. The Launcher will start
automatically.

6. The Launcher will first try to detect an Ignition installation on your


network. If it asks if you want to create a connection to a specific
installation of Ignition, verify the Name and IP Address and click OK if it
is correct. This will add the Gateway by IP Address.

7. If your Gateway does not show up, click on the Add Designer button to
manually add it.

Wait a moment for the list to populate and select your Ignition installation
from the list. The one with a URL of http://localhost:8088 is correct.

If you don’t see your Gateway, you can click the Manually Add Gateway
button in the upper right corner. Type in the URL http://
localhost:8088, and click the Add Gateway button.

8. This takes you back to the list of Designers. Adding the Designer only
needs to be done once. The next time you open the Designer Launcher, it
will already have this link.

9. Click on the Launch button for your new Gateway connection.

©2019 Inductive Automation 39


Launch Designer and Create a Project

10. The Designer starts up and the login window is displayed.

11. Enter the username and password that you created when installing
Ignition.

40 ©2019 Inductive Automation


Launch Designer and Create a Project

Creating a Project
Now, the Open/Create Project window is displayed. Initially, we have
no projects so we must create one.

1. Click on the + New Project button to create a new project.

2. In Project Name, enter a name for your new project (no spaces).

3. In Project Title, give your project any title you want.

4. For Project Template, select the Vision Tab Nav template from the
drop-down list.
Rather than starting from a blank project, the Project Templates let you
start from one of our skeleton projects that already have navigation set
up. These projects are designed to help you get started faster, and are
completely customizable.

5. Click on Create New Project. That's it! The Designer is now launched
and you can work on the project!

©2019 Inductive Automation 41


Launch Designer and Create a Project

42 ©2019 Inductive Automation


Chapter 5

Vision Clients,
Windows, and
Navigation

Vision Clients are launched from the Client Launcher or from the Designer,
and typically have many windows a user can navigate through.
Here you will learn how to Launch a client, and create a navigation structure
for your project.
Each project is a collection of windows, components, and templates. A
window is a hierarchy of components and templates are re-usable
components.
We can create a navigation structure to allow users to easily move between
pages.

©2019 Inductive Automation 43


Vision Clients, Windows, and Navigation

Launch Types
• Standard - Standard or Windowed mode is the usual Client launch
method. The Client is started with the Client Launcher, and runs as its
own full independent application that can be moved or resized on your
computer.

• Full Screen - The Full Screen launch mode is similar to the Windowed
mode and also runs as a full and independent application. However in
this mode, the Client occupies the full screen, does not have a title bar or
borders, and covers the operating system task bar.

Downloading and Installing


The Client Launchers are available on the Gateway Homepage and can be
installed in Windows, Linux, and Mac OS X.

Download and Install the Client Launcher


1. From the Gateway Homepage, click on the Download Vision Client
Launcher button. This takes you to the Download page for the Client
Launcher. This page will attempt to detect your operating system and give
you the correct installer.

2. Click on the Download for Windows button at the top of the page.

3. When the VisionClientLauncher.exe file is downloaded, run it.

4. First decide whether you want a desktop shortcut and click the Next
button.

44 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

5. The Client Launcher is ready to install. Click the Install button and wait a
few seconds for it to complete.

6. When the installer is done, click the Finish button. The Launcher will start
automatically.

7. The Launcher will first try to detect an Ignition installation on your


network. If it asks if you want to create a connection to a specific
installation of Ignition, verify the Name and IP Address and click OK if it
is correct. You should see the name you entered when restoring the
Gateway Backup previously.

8. If your Gateway does not show up, click on the Add Vision Client button
to manually add it.

©2019 Inductive Automation 45


Vision Clients, Windows, and Navigation

Wait a moment for the list to populate and select your Ignition installation
from the list. The one with a URL of http://localhost:8088 is correct.
Click the Add Selected Gateway button in the lower right.

If you don’t see your Gateway, you can click the Manually Add Gateway
button in the upper right corner. Type in the URL http://
localhost:8088, and click the Add Selected Gateway button.

46 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

9. This takes you to a list of the Vision projects on that Gateway. Select the
project you want and click on the Add Applications button in the upper
right. This will add the project to your list of available projects and take
you back to the launch screen.

©2019 Inductive Automation 47


Vision Clients, Windows, and Navigation

10. Go to the project and click on the Launch Windowed button for your
project to open it.

11. Now you can use the Client. Navigate through the windows by clicking on
the tabs at the top. We don’t have many components yet, but we will
soon.

48 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

Client Launcher and Redundancy


The Client Launcher can take advantage of a redundant Gateway setup.
Whenever a connection is established with a master Gateway, the backup
Gateway IP address is automatically stored in the client launcher
configuration file. If the master Gateway cannot be contacted the next time
the client launcher is run, an attempt is made to contact the backup

Windows, Components, and Templates


Windows, components, and templates are the fundamental building blocks
for projects using the Ignition Vision module. A Vision project is a collection
of Windows. These windows are loaded into the Vision Client, where any
number of them may be open at one time.
A window itself is a hierarchy of components. Components range in
complexity from the humble Button and Label all the way to the powerful
Easy Chart and Table components. Shapes such as a line or a rectangle are
also considered components, but have some additional capabilities such as
the ability to be rotated.
Templates are components that are reusable across many windows. They
are designed separately, outside of any window. After being designed, you
can add them to any window within a project. The true power of a template
is that if you change its design, all uses of that template across all windows
reflect those changes. This feature gives templates a major advantage over
a copy-and-paste style of design.
Windows, components, and templates are designed visually with a drag-
and-drop interface within the Ignition Designer. Components each have a
host of properties that govern how the component looks and behaves.

Window Names and Organization


To keep your window navigation organized, you have many options. You can
create folders for each window, you can rename the folders, and you can
add information notes related to the window.

Creating Folders
By creating folders you can organize your windows. Each window must have
a unique name among the windows in its folder. A window's name and folder
path is very important, it is how other windows reference it.

©2019 Inductive Automation 49


Vision Clients, Windows, and Navigation

Renaming a Window
To rename a window, from the Project Browser panel, right-click on a
window and choose Rename or press F2.

Adding Notes to a Window


To add window notes, from the Project Browser, right-click on a window and
choose Notes. This free-form text field lets you document the purpose and
any technical information about how the window works.

Types of Windows
There are three types of windows: Main, Popup, and Docked. You can create
them from the File > New menu as shown below.

By changing a window's properties, you can transform any window into


various configurations. You can change a window's Dock Position, Border
Display Policy, Titlebar Display Policy, and Start Maximized properties to
change it into one of the three categories.

50 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

Main Windows
A window is called a "main window" when it is set to Start Maximized, and
has its border and titlebar display policies set to When Not Maximized or
Never.
The main window takes up all the available space (minus space used by any
"docked" windows) and acts much like a typical "HMI screen." There can be
many main windows in a project, but you must open only one main window
at any time.

Popup Windows
A window is called a "popup window" when its Dock Position is set to
Floating and is not maximized. Its border and titlebar display policies are
usually set to When Not Maximized or Always, so that they can be
changed by the end-user.
The popup windows are often opened by components in a main window, and
are meant to be on top of the screen. Therefore, they should have their
Layer property set to a number higher than zero so they don't get lost
behind the main window. To make a window pop up at a specific position,
edit the Window's Starting Location property.
Popup windows are often parameterized so they can be reused. By
parameterized, it is meant that you define custom parameters for the popup
window and when you create instances of it to reuse it, you can simply pass
in their new parameter values.

Docked Windows
A window is called a "docked window" whose Dock Position is set to any
thing but Floating. This makes the window stick to one side of the screen,
and nothing can overlap it. It also typically has its border and titlebar
display policies set to Never. This makes the "docked" window appear to be
joined seamlessly with the current "main screen" window.
These screens are usually tall and skinny or short and wide, depending on
the edge they're docked to. The purpose of a docked window is to make
some information always available, typically navigation controls and overall
status information. Using docked windows can help eliminate repetitive
design elements from being copied to each screen, making maintenance
easier.

©2019 Inductive Automation 51


Vision Clients, Windows, and Navigation

Changing Window Properties


Windows have several properties that define how they look and behave. You
can change these properties from the Property Editor. There are also some
additional properties that you can change from the Project Browser.

Changing the Properties in Property Editor


1. Go to the Property Editor panel in Designer.

2. Change the properties in Behavior, Appearance, and Layout sections of


the panel.

52 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

Changing Properties from the Project Browser


1. In the Project Browser, right-click on a Window.

2. From the popup menu, you can select and edit the following window
properties: Open on Startup, "About" Window, Notes...,
Scripting..., and Security. Note that the window must be open to edit
some properties.

©2019 Inductive Automation 53


Vision Clients, Windows, and Navigation

Anatomy of a Window
Name and Path
Windows are the top-level unit of a design for Vision projects. A window is
identified by its path, which is the name of all its parent folders plus its
name with forward slashes (/) in between each one. For example, the path
to a window in the top level called MainWindow is simply its name:
MainWindow, whereas the path to a window named UserOptions under a
folder called OptionsWindows is: OptionWindows/UserOptions.

54 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

Titlebar and Border


A window may display a titlebar and/or a border. The titlebar allows you to
drag the window around, and houses the window's close and maximize/
restore buttons. The border of a window lets you resize the window when it
is floating or docked.
Whether or not the titlebar and border are displayed, depends on the values
of the window's titlebar and border display policy properties and its current
state. Commonly, a window displays both a titlebar and border when it is
floating, but only a titlebar when maximized. It is often desirable to remove
titlebars and borders on maximized windows.

Root Container
Inside a window there is always the Root Container. This is a normal
container component except that it cannot be deleted or resized, its size is
always set to fill the entire window. The Root Container is where you place
all of your components in the window.

©2019 Inductive Automation 55


Vision Clients, Windows, and Navigation

Adding a Window to Navigation


Since we started with one of the template skeleton projects, it is easy to add
new windows to the navigation. If you look in the Project Browser under
Windows, you can see several folders and windows that were created for
you automatically.
There are two windows with a square and triangle icon to the right of them:
Main Windows/Overview, and Navigation. These windows are set to open on
startup so they are the first windows the user will see in the run-time
environment.
The Navigation window contains tabs that let you choose the main window
you want to look at. Right now there are only three main windows. Let's add
another one.

Add a Main Window


1. Right-click on the Main Windows/Overview window and select
Duplicate Window.

56 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

2. Right-click on the newly created window, Overview (1), and select


Rename

3. Rename the window to Components and press Enter.

4. Right-click Components and de-select Open on Startup.

Note: It is important to only have one main window that is set to Open
on Startup. Otherwise, you will have multiple main windows hiding each
other.

5. Double-click Components to open it.

6. On Main Window, select the Header Label component.


• Change the label’s Text property to Components
• Click on the folder icon in the Image Path Property Editor to select a
different icon.

©2019 Inductive Automation 57


Vision Clients, Windows, and Navigation

Now that we have a Components Window created, we can add it to our


tabs.

7. In the Project Browser, double-click the Navigation window to open it.

8. Right-click on the Tab Strip component and select Customizers > Tab
Strip Customizer. The Tab Strip Customizer window is displayed.

9. Select the Overview tab and click the Add Tab button on the left. A new
tab called Tab 1 is added.

10. Click on the drop-down list for Window Name and select Main
Windows/Components.

11. Change the Display Name to Components.

58 ©2019 Inductive Automation


Vision Clients, Windows, and Navigation

12. Click OK to submit your changes.

13. Save the project.


Go back to your open Client to view your changes. By default, all updates to
the project will automatically be pushed out to every Client so you will see
your new Tab Strip button immediately.

©2019 Inductive Automation 59


Vision Clients, Windows, and Navigation

60 ©2019 Inductive Automation


Chapter 6

Vision Component
Properties and
Bindings

Components are the useful content of your windows. Any computer user
interface contains components, they are the widgets you work with every
day, they are the buttons, text areas, drop-downs, charts, and so on.
The Vision module comes with a host of useful components out of the box,
many of which are specialized for industrial controls use. Other modules,
like the Reporting module, have more components for specialty purposes.

©2019 Inductive Automation 61


Vision Component Properties and Bindings

Configuring Components
Configuring components is likely the bulk of a designer's work when
designing a Vision project. The basic workflow is to take a component from
the palette and drop it into a container on a window. From there, you can
use the mouse to drag and resize the component into the correct position.
While the component is selected, you can use the Property Editor panel to
change the component's properties, which changes the component's
appearance and behavior.
To make the component do something useful, like display dynamic
information or control a device register, you configure property bindings for
the component. To make the component react to user interaction, you
configure scripting for it.
You can configure the following items for each component:
• Properties
• Custom Properties (Dynamic Properties)
• Size and Position
• Layout Mode
• Style Customizers
• Scripting
• Security

62 ©2019 Inductive Automation


Vision Component Properties and Bindings

Dragging Components to Window


The basic workflow is to take a component from the component palette or
Symbol Factory and drop it into a container on a window. From there, you
can use the mouse to drag and resize the component into the correct
position.
Shapes are components too. Use the shape toolbar to create different
shapes.
Each shape can be individually selected, named, and assigned its own
properties. Shapes have some additional capabilities that other components
don't have, such as the ability to be rotated. Shapes are created using the
shape tools, not dragged from the component palette.
Let’s drag in some components to your window.

Drag Components onto the screen


On the right of the designer, you will find a list of components

1. Open your new Components window. You can find it in the Project
Browser, or because it’s already open from the previous example, there is
a tab at the bottom of the Designer.

2. Select the large Welcome text and the Open Popup button and delete
them by right-clicking and selecting Delete or by pressing the delete key.

3. Click and drag a few components onto the window, for example:
• Cylindrical Tank
• Label
• LED Display
• Meter

4. Save the project.

©2019 Inductive Automation 63


Vision Component Properties and Bindings

While the component is selected, you can use the Property Editor panel to
alter the component's properties, which changes the component's
appearance and behavior.
To make the component do something useful, for example display dynamic
information or control a device register, you configure property bindings for
the component. To make the component react to user interaction, you
configure event handlers for it.

Understanding Component Layout


Layout is the concept that a component's size and position, which is relative
to its parent container's size and position, can be dynamic. The layout
feature allows the creation of windows that resize gracefully. This is a very
important concept because of the web-launched deployment of Vision
clients, they often end up being launched on many different monitors with
many different resolutions.

64 ©2019 Inductive Automation


Vision Component Properties and Bindings

You can choose between two layout modes: relative and anchored.

©2019 Inductive Automation 65


Vision Component Properties and Bindings

Relative Mode
Relative layout is the default mode which is a simple but effective mode. It
simply keeps a component's size and position relative to its parent container
constant, even as the parent container grows or shrinks.
More precisely, it remembers the component's position and size as a
percentage of its parent's bounds at the last time the window was saved.
The Relative mode also has the option of scaling a component's font
appropriately.

Anchored Mode
Anchored layout lets you specify various "anchors" for the component. The
anchors dictate how far each of the four edges of the component stay from
their corresponding edges in the parent container.

66 ©2019 Inductive Automation


Vision Component Properties and Bindings

For example, if you anchor top and left, then your component stays a
constant distance from top and left edges of its parent. Since you didn't
specify an anchor for the right or bottom sides, they won't be affected by
the layout.

Examples
The Ignition's component layout feature allows components to resize
automatically. This feature provides you the advantage of not having to
develop an application at a specific resolution. To illustrate how component
layout works let's look at a few small examples with the components we just
added. You can change the layout of multiple components at the same time.

1. Select all of the components you just added to the Main Window by
clicking them while holding control.

2. Right-click on one of the selected components. and select the Layout


option. Use the following examples to test layout in the Client.

Example 1 - Relative Mode - Maintain Aspect Ratio


By default the layout constraints of a component is set to Relative-
Maintain Aspect Ratio which means the components will resize based on a
ratio of the component size to the size of the window while maintaining the
aspect ratio.
To see the default setting, right-click the components and choose Layout...
from the menu. This is the default layout for new components so you don’t
need to change anything. Open the client and resize it. As the window gets
larger, the components will resize but will never look skewed.

©2019 Inductive Automation 67


Vision Component Properties and Bindings

Components Set to Relative-Maintain Aspect Ratio

Components Set to Relative-Maintain Aspect Ratio, Resized Larger

68 ©2019 Inductive Automation


Vision Component Properties and Bindings

Example 2 - Relative Mode - No Aspect Ratio


The Relative- Do not Maintain Aspect Ratio option means the
components will resize based on the container size, and will ignore any
aspect ratio changes. This means components will skew if your designer and
Client aspect ratios are different.

1. Select all of the new components on the window.

2. Right-click one of the selected components and select Layout.

3. Select Relative but now uncheck the Maintain Aspect Ratio.

4. Save the project and try it out in an open client. Notice how the
components look skewed with all the components set to No Aspect
Ratio.

All Components Set with Relative-Maintain Aspect Ratio

©2019 Inductive Automation 69


Vision Component Properties and Bindings

All Components Set with No Aspect Ratio

Example 3 - Anchored Mode


The Anchored Mode option means the components will be locked a certain
distance from a set of edges. This means components will not resize unless
they are locked to opposite edges, and will follow edges as the Client
dimensions change.

1. Select all the new components on the window.

2. Right-click one of the selected components and select Anchored Mode.

3. Select the Top and Left layout options, and make sure the other options
are deselected. Press OK.

4. Save the project, and open a client.

The components will all be locked to the upper left corner of the Client. As
the Client gets bigger, you will notice empty space to the right and below
the components.

70 ©2019 Inductive Automation


Vision Component Properties and Bindings

5. This is more noticeable if you make the Designer window small and the
Client large.

©2019 Inductive Automation 71


Vision Component Properties and Bindings

That is the basic idea. You can play with all of the Layout modes to get a
better feel for them.

Drawing Tools
Shapes such as lines, rectangles, and circles are created using the shape
tools, not dragged from the component palette. But shapes are components
too as each shape may be individually selected, named, and assigned its
own properties. Shapes have some additional capabilities that other
components don't have, such as the ability to rotate.
By default, the shape toolbar is displayed on the right-hand edge of the
Designer window, but you can drag it to wherever you prefer.

72 ©2019 Inductive Automation


Vision Component Properties and Bindings

There are a number of tools here for your use, and each one makes the
window editing workspace act differently when active.
Shape tools allow you to create various shapes as well as edit them after
they are created. Click on the tool's icon to make it the active tool, then click
in the Designer and drag to place the tool in your workspace. You can also
double-click on a shape to change to that shape's native tool. When a shape
tool is active, a toolbar is displayed that has specific actions and settings for
that tool.
After a shape is created, you can change it's fill color, stroke color, and
stroke style. All shapes can be treated as paths and be used with composite
geometry functions to alter or create other shapes.

Selection Tool
Normally the selection tool is active. When active, you can select shapes and
components. Selected components can be moved, resized, and rotated. For
more information about the Selection Tool to manipulate components and
shapes, see the Ignition User Manual.

Rectangle Tool
The rectangle tool creates and edits rectangle shapes. To create a rectangle,
select the tool and drag inside a window, holding down Ctrl, makes a
perfect square. Once a rectangle is created, you can use the square handles
to change the rectangle's height and width. This is important because it is
the only way to resize a rotated rectangle while it remains a rectangle.

©2019 Inductive Automation 73


Vision Component Properties and Bindings

If you resize a non-orthogonally rotated rectangle using the selection tool, it


skews and becomes a parallelogram, but if you double-click it so that the
rectangle tool is active, you can change the rectangle's width and height
using the tool-specific handles.
There are also small circle handles that let you alter the rectangle's corner
rounding radius. Simply drag the circle down the side of the selected
rectangle to make it a rounded rectangle. Hold down Ctrl to drag each
rounding handle independently if you want non-symmetric corner rounding.
You can use the Make Straight button in the rectangle tool's toolbar to
return a rounded rectangle to be a standard straight-corner rectangle.

Ellipse Tool
The ellipse tool creates and edits circles and ellipses. You use it in much the
same way as the rectangle tool. While it is the active tool, you can drag
inside a window to create a new ellipse. Hold down Ctrl to make it a perfect
circle. When an ellipse is selected, use the width and height handles to alter
the shape.

Polygon/Star Tool
The polygon tool creates polygons and stars. Use the toolbar that becomes
visible when this tool is active to change the settings of the shape that is
created when you drag to create a polygon. You can use this tool to make
any polygon with 3 corners (a triangle) or more. Once created, you can use
the center square handle to move the polygon around, and the diamond
handles to alter the size and angle of the polygon. Hold down Ctrl to keep
the polygon's rotation an even multiple of 15°.

Arrow Tool
The arrow tool creates single or double-sided arrow shapes. When it is
active, simply drag to create a new arrow. Use the check box on the toolbar
to choose a single or double-sided arrow. To alter the arrow, use the
diamond handles to change the two ends of the arrow, and the circle
handles to change the size of the shaft and the head. When changing the
arrow's direction, you can hold down Ctrl to snap the arrow to 15°
increments.

Pencil Tool
The pencil tool draws freehand lines and shapes. When selected, you can
draw directly on a window by holding down the mouse button. Release the
mouse button to end the path. If you stop drawing inside the small square
that is placed at the shape's origin, you create a closed path, otherwise you
create an open path (line).

74 ©2019 Inductive Automation


Vision Component Properties and Bindings

On the pencil tool's toolbar, there is a Simplify and Smooth setting, as well
as a toggle between creating straight line segments or a curved line
segments.
The Simplify option lets you specify a size in pixels that decreases the
number of points used when creating the line. In general, points on the line
are as far apart as this Simplify setting. If you find the line isn't accurate
enough, decrease this setting. If you choose to create curved segments, the
segments between points will be Bézier curves instead of straight lines. The
Smooth option controls how curvy these segments are allowed to get.

Line Tool
The line tool draws lines, arbitrary polygons, or curved paths. Unlike all of
the other tools, you don't drag to create new paths with the line tool.
Instead, you click for each vertex you'd like to add to your path. To draw a
straight line, simply click once where you want the line to start and double-
click where you want the line to end. To make a multi-vertex path, click for
each vertex and to end the line, double-click, press enter, or make a vertex
inside the origin box.
As you draw the line, "locked-in" sections are drawn in green and the next
segment is drawn in red. Hold down Ctrl at any time to snap the next
segment to 15° increments.
On the line tool's toolbar, you can choose between three modes: normal
line, perpendicular, and curve. Perpendicular mode is just like line mode
except that each segment is restricted to be either horizontal or vertical.
Curve mode creates a Bézier curve path by attempting to draw a smooth
curve between the previous two vertices and the new vertex.

Path Tool
The path tool edits all shapes and paths. This tool lets you directly modify
the nodes in the path, add new nodes, remove nodes, and toggle segments
between straight or curved.

Gradient Tool
The gradient tool affects the orientation and extent of any gradient paints.

Eyedropper Tool
The eyedropper tool sets the selected shape(s) and/or component(s)
foreground/background or stroke/fill colors by pulling the colors from
somewhere else in the window. When this tool is active, left-click to set the
selection's fill or back ground, and right-click to set the selection's stroke or

©2019 Inductive Automation 75


Vision Component Properties and Bindings

foreground. Note that this tool works on most components as well as


shapes. For example, right-clicking sets the font color on a Button, or left-
clicking sets the background color.
Drag a few Shapes onto the window.

Setting a Shape’s Fill and Stroke


All shapes have three properties that affect how they look, they are as
follows:
• Fill Paint is of type Paint and it represents the interior color of the
shape.
• Stroke Paint is of type Paint and it represents the color of the shape's
outline.
• Stroke Style is of type Stroke and it affects the thickness, corners, and
dash properties of the shape's outline.

Editing Paints
The fill and stroke paints can be set to a variety of different kinds of paints.
You can edit a shape's fill or stroke paint in two ways:

1. Select one of your Drawing Tool components.

2. On the Fill Paint property, click on the Edit icon on the right of the
Property Editor to open the color wheel.

76 ©2019 Inductive Automation


Vision Component Properties and Bindings

Fill and Stroke Paint Types


At the top of the Fill and Stroke panel, a selection area lets you choose
between the five different paint types.

1 2 34 5
These five paint types are as follows:

• No Paint - When used as a fill paint, it makes the interior of the shape
transparent. Used as the stroke paint, does not draw the shapes outline.

©2019 Inductive Automation 77


Vision Component Properties and Bindings

• Solid Color - Equivalent to the Color type used elsewhere throughout


the component library. A solid color is any color, including an alpha
(transparency) level.

• Linear Gradient - Smoothly blend any number of colors along a straight


line across the shape. Each color is called a Stop. Each stop is
represented as a drag-able control on a horizontal preview of the
gradient in the gradient editor. You can click on a stop to select it and
change its color or drag it to reposition it. You can right-click on it to
remove it. You can right-click on the preview strip to add new stops and
change the gradient's cycle mode.

• Radial Gradient - Very similar to linear gradient except the colors


emanate from a point creating an ellipse of each hue. Radial paints are
configured in the same way as linear paint.

• Pattern Paint - Uses a repeating pixel-pattern with two different colors.


You can pick a pattern from the drop-down or create your own using the
built-in pattern editor.

Gradient Paint Bounds


The two gradient paints, linear and radial, are more than a list of colored
stops, they also need to be placed relative to the shape. The same gradient
may look wildly different depending on how it is placed against the shape.
By default, a linear gradient runs horizontally across the width of the entire
shape, but this is easily changed. By switching to the Gradient Tool, you can
drag around handles that control how the gradient is applied.

78 ©2019 Inductive Automation


Vision Component Properties and Bindings

Gradient Cycles
The two gradient paints, linear and radial, both have a three cycle mode
that you can choose by right-clicking within the preview strip.

The three cycle modes shown above are as follows:

1. No Cycle - The first and last stops are continued forever after the edge of
the paint bounds.

2. Reflect - Beyond the bounds of the paint, it is reflected and drawn in


reverse and then reflected again, creating a smooth repetition.

3. Repeat - Beyond the bounds of the paint, it is repeated forever.

Stroke Style
A shape's stroke paint is only half the story. The stroke style is also an
important component of how an outline is drawn. Primarily the style controls
the thickness of the line drawn, but you can also use it to create a dashed
line.
The setting for thickness is specified in pixels. Creating a dashed line is as
easy as choosing the style from the list.
The effect of thickness and dash pattern settings is fairly self-explanatory,
but the other stroke settings are a bit more subtle. You can notice their
effect more easily on thick lines.

©2019 Inductive Automation 79


Vision Component Properties and Bindings

Component Properties
Each component has a unique set of properties. A property is simply a
named variable that affects something about the component's behavior or
appearance.
Each property has a distinct data type. Hover your mouse over the property
name in the Property Editor panel to see its description, data type, and
scripting name.

The different ways that a property name can appear are as follows:

• A blue name which indicates that the property is a custom (dynamic)


property.

• A bold name with a binding icon which indicates that the property is
bound using a property binding.

• A bold name with a color palette icon which indicates that the
property is using the component's styles settings.

• A red bold name with a warning icon which indicates that the
property has a binding and a style. The property can have either a
binding or a style but not both.

80 ©2019 Inductive Automation


Vision Component Properties and Bindings

Custom Component Properties


Most Vision components support custom properties. This means that in
addition to the normal properties of the component, you can add your own
properties. You can think of these properties like your own variables in the
window.
Custom properties are extremely useful and are integral to creating
maintainable projects using Ignition Vision. They let you turn a "plain"
component into one customized for your particular use.
You'll notice the custom properties you add are displayed in the Property
Editor in blue. You can use these properties like any others, with data
binding, scripting, styles, and so on.

Understanding Property Binding


Property Binding is perhaps the most important concept to understand when
designing a project using the Vision module. It is primarily through property
binding that you bring windows to life and have them do useful things.
When you initially place a component on a screen, it doesn't really do any
thing. Changing its properties in the Designer makes it look or act different,
but it has no connection to the real world. This is what property binding
adds.
Property binding, as its name suggests, lets you bind a property to
something else. That something else could be:
• Some other component's property
• An OPC Tag
• The results of a SQL query
• An expression involving any of these things
• The results of a Python script
Now that we know a little bit about the components and properties, let’s
drag a few components on the window and test a few Bindings.

Property Bindings
Property bindings are useful to force two components to match their values
exactly. Let’s take a Tank component and a Slider component, and use one
to change the other.

1. If you don’t already have one on your Main Window, drag a Cylindrical
Tank component onto the window.

©2019 Inductive Automation 81


Vision Component Properties and Bindings

Changing the Value property on the tank will change the level of the
liquid in the tank.

Changing the Capacity property on the tank will also change the level.

2. Drag a Slider component onto the window.

3. Put the Designer into Preview Mode by selecting it from the Menubar
under Project -> Preview Mode. You can now drag the slider handle and
you can see that the value property of the slider component changes.

4. You can change other properties in the Slider to affect the way it looks.
Set the Horizontal Slider property to False and change the shape of the
slider to be tall and thin. Move it next to the tank.

5. Now we can bind the tank and slider together. Since bindings listen for
value changes, select the Cylindrical Tank component to add the
binding there.

6. Find the Value property of the Cylindrical Tank and click on the binding
icon on the right.

7. Select the Property binding type.

8. Expand the property tree and select the Slider -> Value property.

82 ©2019 Inductive Automation


Vision Component Properties and Bindings

9. Click OK. Now you can see the tank value matches the slider.

10. Put the Designer back in Preview Mode and move the slider to see the
value change.

©2019 Inductive Automation 83


Vision Component Properties and Bindings

11. The Slider component has one more property worth changing. Take the
Designer out of Preview Mode, select the Slider, and set the Defer
Updates property to False. This will cause the slider to constantly fire
updates instead of waiting until you drop the slider handle. You can test
this is Preview Mode.

Expression Bindings
We can also set a binding that is more complex. The Expression binding will
allow you to use more than one property in our expression language to
create complex logic to return a single value. Let’s add a label to our
example that displays the current value in a nicer way.
1. Drag a Label component onto the window below the Tank.

The Text property on the component is what allows us to write on the


window. You can change the Text property to test it.

2. Click on the binding icon to the right of the Text property.

3. We want to display the value of the Tank, but we also want to show the
units "gallons." Select the Expression binding type.

4. We can start with a link to the Tank. Click on the Insert Property
icon in the upper right.

5. Select the Cylindrical Tank -> value property and click OK. You will see
it populate the expression field with:
{Root Container.Cylindrical Tank.value}

84 ©2019 Inductive Automation


Vision Component Properties and Bindings

6. We can use that value and add a string to it. You can concatenate strings
in the expression language with the + operator. Add +" gal" to the
expression. Note the space before the "g" in gal.
{Root Container.Cylindrical Tank.value}+" gal"
7. Click OK. You will now see the value on the Label change.
You can use Preview mode to move the slider and see the value in the label
update.

©2019 Inductive Automation 85


Vision Component Properties and Bindings

86 ©2019 Inductive Automation


Chapter 7

Tags

In Ignition, a Tag is more than simply what is considered a "tag" in other


systems. Each Ignition Tag starts similarly as one data point, and may have
a static or dynamic value that comes from an OPC address, an expression,
or a SQL query.
In addition to this, Ignition Tags allow us to add configurations for alarming,
scaling, historical storage, and more.
Ignition Tags are stored in Providers, and you can have as many providers
as you want. By default, a fresh Ignition installation will have a single
internal Tag provider - this can be thought of as a standard internal Tag
database.

©2019 Inductive Automation 87


Tags

Main Benefits of Tags


Tags work naturally and easily with Ignition to offer the following exciting
features:

Drag and Drop Screen Design


Using the Vision and Perspective modules, you can drag and drop Tags to a
window to automatically create new bound components. Drag Tags to
existing components or properties to quickly bind them to the data.

Object-oriented Design
Use Tag UDTs (User Defined Types) to design re-usable, parameterized, and
extendable data types. You can create and configure new instances of these
types in seconds, saving a great amount of time over traditional tag
systems.

Performance and Scalability


Tags offer a great performance on both the Gateway and Client. On the
Gateway, the system can support thousands of value changes per second
and hundreds of thousands of Tags. On the Client, Tags improve efficiency
with their lightweight subscription architecture. Adding additional Clients
creates a nearly negligible effect on the database and the Gateway
performance.

Integrated Component Feedback


Tags offer a quality and overlay system for Vision and Perspective module
components. If a Tag's data quality is anything but good, a component that
depends on it gets a visual overlay. Input components display an animated
overlay while write pending requests are being written. These features
effectively communicate the status of the system at a glance.

Tag Values
Fundamentally, the primary goal of a Tag is to represent a value in the
Ignition system. The values can come from OPC, expressions, queries, and
so on, and can be used on Vision windows, Perspective views, Transaction
Groups, and more.
Additionally, Tags offer the following core set of features which is above and
beyond just simple values:
• Alarming
• Scaling
• Meta Data
• History

88 ©2019 Inductive Automation


Tags

Depending on the specific type of Tag, even more options can be available.
In general, Tags provide a common interface for tying together many types
of data in Ignition.

Creating Tags
Now that you are in the Designer and have created some navigation
windows, a good first step is to create some Tags. You'll use these Tags for
realtime status and control and to store history with the Tags Historian. Tags
are all configured in the Tag Browser panel.

Creating Tags by Dragging Them from OPC


The easiest way to create Tags is by dragging the Tags from the OPC
Browser.

1. In the Tag Browser, first select the Tags folder and click the Browse OPC
Servers icon.

The OPC Browser is displayed and you can browse all of your OPC
connections.

By default, you've got a connection to the internal Ignition OPC UA Server,


which has the devices in it you created earlier. Browse the devices and
find some Tags that you're interested in.

©2019 Inductive Automation 89


Tags

2. From the OPC Browser, highlight both folders inside the GenSim folder
and drag it to the Tags folder in the Tag Browser.

You can drag individual Tags or folders. When you drag folders, Ignition
keeps the same hierarchy as the PLC.

3. Expand the GenSim >Ramp folder to see live values.

That's it! You now have some Tags. You can see their values come in and
start updating automatically. By default, they update at a 1 second rate.

90 ©2019 Inductive Automation


Tags

Tag Properties
Each Tag has a set of properties that affect how it looks and behaves in your
project. You can access the Tag properties by double-clicking on a Tag or
right-clicking a Tag and selecting Edit Tag.

There are many properties for each Tag and we will get through all of them
this week. For now we just want to talk about the first few sections:

• Basic Properties - These properties are the main pieces of information


for a Tag: the name, Tag Group (execution) and enabled status.

• Value - This section is where the Tag gets its data from. For an OPC Tag
like the simulators, that means the OPC path data.

©2019 Inductive Automation 91


Tags

• Numeric Properties - This section controls how the raw value is


represented in the Ignition Tag. It includes a deadband, scaling, and
engineering limits.

• Meta Data Properties - This section gives you a place to document the
Tag however you like.
The Security, Permissions, History, and Alarming will be covered in later
sections of the class.

You can also add properties to Tags by clicking on the Add icon at the
top. These properties will take any static values and can be used to identify
or group your Tags, or to store additional data. They are commonly used to
be bound to by other properties like alarm settings.

Dragging Tags to Windows and Components


You can drag Tags onto a component in three different ways:
• Drag a Tag onto a window and then create a component.
• Drag a component from Component Palette onto the window and then
drag a Tag to the component.
• Drag a component from Component Palette onto the window and then
drag a Tag to only one property for the component.

Dragging a Tag onto a Window to Create a Component


1. Open the Components window.

2. Drag the Ramp 1 Tag from the Ramp folder onto the window (which is
the Root Container).

A popup menu is displayed.

3. From the popup menu, select Display > Tank.

92 ©2019 Inductive Automation


Tags

4. Notice in the Property Editor, the Mouseover Text, Value, and Units
properties of the tank component are bold, this means that these
properties are bound to Tags.

5. Click on the binding icon to the right of the Value property.

The Property Binding window is displayed showing you that the Value
property is bound to the Ramp1 Tag.

©2019 Inductive Automation 93


Tags

Dragging Multiple Tags onto a Window


You can also select multiple Tags at once and drag them all onto the window
at the same time.

1. Select several of the Realistic Tags (with CTRL+click or Shift+click) and


drag them all onto the window.

2. Select the LED Display component.

94 ©2019 Inductive Automation


Tags

3. Notice that dragging the Tag onto an existing component binds multiple
properties at once.

Bidirectional Bindings
Tags that you drag onto the screen will automatically create bidirectional
bindings when they are dropped.
1. Drag a Numeric Text Field onto the window.

2. Drag the WriteableInteger1 Tag down to the Value (Integer) property


of the Numeric Text Field.

3. Notice that only the one property is bold now.

©2019 Inductive Automation 95


Tags

4. Put the Designer in Preview Mode and change the Value in the Numeric
Text Field.

An error message should pop up telling you that the Gateway is not in
Read/Write Mode. This is a safety feature in Ignition.

96 ©2019 Inductive Automation


Tags

5. You can enable the Read/Write Mode from the Menubar of the
Designer. Select Project > Comm Read/Write and try changing the
value again.

6. If you are working in the Designer and attempt to enter a value in the
Numeric Text Field of the Property Editor and Read/Write Mode is not
enabled, you will get a popup message. You have the option of choosing
to Enable Read/Write Mode from the message box. Select either
Enable Read/Write Mode or Write Once. Try entering a value again.

Types of Tags
There are several types of Tags. While when talking about "Tags" we
commonly mean the Gateway executed Tags, but system System Tags and
Client Tags can play an important role in the overall design of a project.

Gateway Executed Tags


Tags executed in Gateway support all of the primary features of Tags:
scaling, alarming, history, and role-based permissions. They are identical in
their configurations, apart from defining how the value is generated.

• OPC Tag - An OPC server and address which drives values. The OPC
address is subscribed at the rate of the Tag's Tag Group.

• Memory Tag - A simple value that is specified during configuration and


is stored when written (if the Tag allows writing).

• Expression Tag -A Tag driven by an expression. The expression syntax


is the same as for property bindings and allows mathematical
operations, references to other Tags, logic operations, and more.

• Derived Tag - A Tag driven by a source Tag and has both read and write
expressions. It behaves in the same way as the Expression Tag but
allows you to write values back to the source Tag.

©2019 Inductive Automation 97


Tags

• Query Tag - Executes a SQL Query, whose result provides the value for
the Tag. Like SQL binding in Vision, SQL Query Tag can reference other
Tags to build dynamic queries.

• Reference Tag - A simple type that has the same value as another Tag.
This way you can have multiple copies from the same source, and set
different values for alarms, history, scaling, etc.

• Complex Tag (UDT) - Created from a standard Tag type, but offers a
variety of additional features. In simple terms, you can think of them as
a way to create "data templates", where a particular structure of Tag is
defined and can then be created as if it were a single Tag.

Creating Memory Tags


Memory Tags are simply values. You can use them as setpoints (that are not
stored in the PLC) or just for storing extra information.

1. From Tag Browser, right-click on Tags or a folder of your choice and select
New Tag > New Standard Tag > Memory Tag.

98 ©2019 Inductive Automation


Tags

2. In the Tag Editor, set the Name to TempF, set the Data Type to Float,
and set the initial Value to a reasonable temperature like 50.3.

3. Click OK.

That’s it! You now have a memory Tag that you can read from or write to.
This is just like having a global variable for your project.

Creating a Derived Tag


A Derived Tag allows you to perform a special calculation based on other
Tags for reading, and another for writing. In that way, you can do the
calculation one time and view it on any window in your project.

1. In the Tag Browser, right-click on Tags or a folder of your choice and


select New Tag > Derived Tag.

©2019 Inductive Automation 99


Tags

2. In the Tag Editor, set the Name to TempC, the Data Type to Float.

3. Set the Source Tag Path to our new TempF Tag. You can click on the
Edit icon to the right to select the Tag.

100 ©2019 Inductive Automation


Tags

4. This Tag type has both Read and Write expressions. Find the Read
Expression property and click on the Edit icon on the right.

5. Type in this expression using the built-in {source} object:


({source}-32)*5/9

©2019 Inductive Automation 101


Tags

6. Click Commit, and then OK.

You will see the value from your calculation on the Tag.

7. With a Derived Tag, you also write the value back to the same Tag. In the
Tag Editor > Write Expression, click the Edit icon on the right.

8. Enter the following expression:


{value}*9/5+32

Now when we write to the Tag, it will send a modified value back to the
source Tag.

102 ©2019 Inductive Automation


Tags

Client and Gateway System Tags


Ignition comes with predefined system Tags to provide more information
about the Client and the Gateway. In the Tag Browser, under the System
folder, you can see several Client and Gateway Tags.
For Client, they provide the following information:
• Client IP Address
• Client Hostname
• Client OS
• Who is logged in and what roles they have
• Which project is opened
• Gateway's address
• and more...
For Gateway, they provide the following information:
• Database connection information
• Ignition performance stats
• Redundancy information
• Number of client sessions opened and more...

©2019 Inductive Automation 103


Tags

System Tags
System Tags provide status about the system, such as memory usage,
performance metrics, and so on. They exist for the Client and the
Gateway.You can modify the Gateway system Tags to perform alarming,
history, and scaling, but you cannot modify the Client Tags.

Vision Client Tags


Client Tags, as the name implies, are only available for use in Vision Clients.
This means that their values are isolated to a Client runtime. Even though
they are created in the Designer, each Client creates their own instances.
This makes them very useful as in-project variables, for passing information
between screens and between other parts of the Clients, such as scripting.
Client Tags are a hybrid of memory, expression, and SQL query Tags.
However, they do not have a Tag Group. When set to run as an expression
or query, a poll rate is specified dictating how often the value is calculated.
A great way to use Client Tags is to have a variable that is used across
multiple pages when you can't use a normal Memory Tag because each
running Client would want their own value. For example, you might have
several windows reused for all areas around your facility. If you are passing
the area name into each screen, then you want to use a Tag to remember
without having to pass variables around while opening windows. If two or
more people would want to see different areas at the same time, a Memory
Tag won't work but a Client Tag will.

Tag Groups
Tags are executed by Tag Groups inside of a Tag Provider. In a typical
system, there are a number of Tag Groups and one or two Tag Providers:
the internal Tag provider and possibly an external Tag Provider from another
installation of Ignition.
Tag Groups dictate the rate of execution of Tags, and therefore play crucial
role in the design of large and high-performance systems. They offer several
key execution modes to help create efficient projects.
The different execution modes are as follows:

• Direct - Executes based on a fixed rate.


• Driven - Executes at a slow or fast rate based on a condition. This type
can be set to execute once when the condition is true.
• Leased - Executes at a slow or fast rate according to when the Tag
values are needed.

104 ©2019 Inductive Automation


Tags

Direct Tag Group


The Direct Mode executes at a fixed rate, which is defined by the slow rate
setting. Every Tag that uses the Direct mode will poll the PLC at the slow
rate setting 24x7x365 (at all times).
Ignition comes with two default Direct Tag Groups called Default and Default
Historical. You can Modify the settings of these default Tag Groups.

Edit a Tag Group


1. Open the Designer. In the Tag Browser, click on the Edit Tag Groups
icon.

The Tag Group Editor is displayed. On the left of the window, you can
see the default Tag Groups: Default and Default Historical. They are
both direct Tag Groups. The Default Tag Group is a 1 second rate and the
Default Historical is a 10 second rate.

©2019 Inductive Automation 105


Tags

2. Select the Default Tag Group on the left. You can now make changes to
the Tag Group including changing the Slow Rate to 30,000ms. For the
class, we will leave the Default rate at 1,000ms.

Since all new Tags automatically use this Default group, it is a good idea
to change it to a much slower rate and create a new 1 second rate with a
different name.

Setting the Tag Group Rate for a Tag


1. Right-click on any Tag and select Edit Tag.

The Tag Editor window is displayed.

2. Under the Basic Properties, find the Tag Group dropdown property and set
it to a new Tag Group. Make sure you saved your project after creating
a new Tag Group.

3. Click OK to save it.

106 ©2019 Inductive Automation


Tags

You will immediately see the Tag updating at a different rate. The Tag also
uses the Tag Group to determine how fast to log data for the historian. The
history Tag Group doesn't affect how fast the values get polled from the PLC,
but affects how fast the data gets logged. If you have history enabled on
your Tag, this property will appear under the History section.

Leased Tag Group


The leased Tag Group executes at the Leased/Driven Rate (fast rate)
when any of the Tags it contains are subscribed and visible in a client
window. If no Tags are subscribed, the Tag Group runs at the slow Rate.
Every Tag that uses the leased Tag Group will poll the PLC at the Leased/
Driven Rate (fast rate) when a client or session needs the value, and at the
slow Rate when none of the Tags have a binding on an active window or
view.

©2019 Inductive Automation 107


Tags

Add a Leased Tag Group


Let's add a new leased Tag Group that updates the Tag at a 1 second rate
when a client needs the Tag and 30 seconds when the client is closed.

1. In the Tag Group Editor, click on the Add icon to add a new Tag Group.

2. Set the following:

Tag Group Name: Leased


Mode: Leased
Rate: 30000
Leased/Driven Rate: 1000

3. Click OK to save.

4. Set the Tag Group on the Tags to use this new Leased Tag Group.

The Tags will only be polled when a component that is bound to it is


showing in a Client.

5. To test your Tag Group, Edit an Ignition Tag to use this group and drag it
onto a window.

Driven Tag Group


The rate of the Driven Tag Group is based on a simple comparison between
a Tag value and a number. If the condition is true, the Tag Group executes at
the fast rate. If false, it runs at the slow rate. There are two exceptions to
this:
• Any Change operator
• One-shot mode

108 ©2019 Inductive Automation


Tags

Using either of these, the Tag Group does not run at a rate. Instead, it will
be triggered by a change in the driving Tag's value. Any change will
execute each time the value changes, and one-shot will execute once when
the comparison condition is true and not again until the condition becomes
false and subsequently true.
It's useful to keep in mind that the driving Tag can be an Expression Tag that
performs complex calculations and references other Tags. In this way, it's
possible to create robust Tag Group triggering.
Every Tag that uses the driven Tag Group, will poll the PLC at the fast rate
when the condition is true and the slow rate when the condition is false.

Add a Driven Tag Group


Let's add a Driven Tag Group that updates the Tags based on the outside
temperature from our Memory Tag.

1. Click on the Edit Tag Groups icon in the Tag Browser to open the Tag
Group Editor.

2. Click on the Add icon to add a new Tag Group and set the following:

Tag Group Name: Driven


Mode: Driven
Rate (ms): 0 so we don't poll when the condition is false. If you set the
value to 10 seconds it simply would just poll slower when the condition is
false.
Leased/Driven Rate (ms): 1000
Driving Expression: {[default]TempF}
Driving Comparison:>
Comparison Value: 50

©2019 Inductive Automation 109


Tags

3. Click OK to save.

Set the Tag Group on any Tag to this one to update on this condition. If
you use this Tag Group for history, the Tag will only store history during
those times.

After you set Tags to use this Tag Group, change the TempF Tag to see it
worked.

110 ©2019 Inductive Automation


Chapter 8

Complex Tags
(UDTs)

Complex Tags, also referred to as Tag UDTs, let you leverage object-oriented
data design principles in Ignition. Using complex Tags, you can dramatically
reduce the amount of work necessary to create robust-systems by
essentially creating parameterized "data templates" that you can use to
generate Tag instances.
The primary features of UDTs are as follows:

• Central Definition - Once you define your data type, you can then
create instances of it. If at a later time you want to change some aspect
of the Tag, you can simply edit the type definition and all instances of it
are automatically updated.

©2019 Inductive Automation 111


Complex Tags (UDTs)

• Parameterized Settings - Define custom parameters on your data type


and then reference them inside your member Tags. When its time to
create instances, you can simply modify their parameter values in order
to change where the underlying data comes from.

• Extendable - Data types can inherit from other data types in order to
add additional members or override settings. Instances can also override
settings, allowing flexibility for dealing with irregular data and corner
cases.

Terminology
The following terms are frequently used when discussing complex Tags:

• UDT (User Defined Type) - The definition of the data type: its
structure, Tags, attributes, and settings. This should be a generic type,
like Motor, or Cooling Tank.

• Instances - Running copies of a data type with specific data for all
members. Instances are linked to their parent types and are reloaded
when their parent type changes. Besides specifically overridden settings,
all settings are inherited from the type definition. This should be a
specific object, like Motor 3, or Cooling Tank 5.

• Parameters - Custom properties on data types that you can use inside
the type or instance definition to create parameterized data templates.
For example, if a data type consists of three OPC Tags that only differ by
a number in the path, you can use a parameter for the "base address",
allowing instances to be created with only one setting.

• Members - Tags inside of a data type or instance. Members can be basic


Tag types, or other UDTs.

Creating Complex Tags (UDTs)


So far we have only dealt with simple Tags. In Ignition, you can create user
defined types (UDTs) for Tags. These types can model UDTs in certain PLCs,
for example a ControlLogix or can be completely new. You create UDTs in a
special folder in the Tag Browser called Data Types.

112 ©2019 Inductive Automation


Complex Tags (UDTs)

There are three ways to create UDTs:


• Manually
• From OPC via the OPC Browser
• From existing Tags
If your PLC supports UDTs, the easiest way to create a type is from OPC.
Because we are connected to a ControlLogix and it supports UDTs, we use
the second method (from OPC) to create the UDTs. In our ControlLogix PLC,
we already have a motor UDT setup. Let's create the UDT in Ignition.

Create the UDT from OPC Browser


1. From Tag Browser, click the OPC Browser icon.

2. Under the CLX folder, go to the Controller:Global folder and find the M1
folder.

M1 represents a motor which has four Tags: AMPS, HOA, RUN_CMD, and
STATUS.

©2019 Inductive Automation 113


Complex Tags (UDTs)

3. Drag the M1 folder to the Data Types folder in the Tag Browser.

4. A window prompts you asking if you want to create a type or Tags. Click
on Create Type.

114 ©2019 Inductive Automation


Complex Tags (UDTs)

The Tag Editor window is displayed. Notice two Tags, AMPS and HOA, are
automatically part of the UDT.

5. In the Tag Editor, change the name from M1 to MotorUDT to make the
type name more of a generic name.

6. Right click on the RUN_CMD Tag and select Delete. Then, delete the
STATUS Tag as well.

7. Right now each Tag is pointing to a specific address in the PLC. Select the
AMPS Tag to see that it is pointing to M1 in the PLC.

©2019 Inductive Automation 115


Complex Tags (UDTs)

Because we are creating a UDT we don't want to point to one specific set
of Tags. We want each instance of the UDT to reference a different set of
Tags. To do that, we need to add a parameter to the UDT.

Parameters are custom properties on data types. You can use the
parameters inside the type or instance definition to create parameterized
data templates.

For example, if a data type consists of three OPC Tags that only differ by a
number in the path, you can use a parameter for the "base address",
allowing instances to be created with only one setting.

8. In the Tag Editor, double click on the MotorUDT data type and edit the
parameters by clicking Edit icon.

9. Click the Add icon to add a parameter. Change the name to


MotorNumber and click Commit.

116 ©2019 Inductive Automation


Complex Tags (UDTs)

10. Click Apply. Now for each Tag, we can substitute the motor number with
the MotorNumber parameter.

11. Select the AMPS Tag. In the OPC Item Path, click on the binding icon on
the right and select the Edit... option.

©2019 Inductive Automation 117


Complex Tags (UDTs)

12. You will now see your original OPC Item Path. Place your cursor after
“M1.” Click on the parameters icon on the right to bring up the list of
parameters.

13. Click MotorNumber option to insert {MotorNumber}. Delete the "1" in


"M1" before moving on.
The OPC Item Path will then show:
ns=1;s=[CLX]Global.M{MotorNumber}.AMPS
14. Do the same for the HOA Tag. The OPC Item Path will then show:
ns=1;s=[CLX]Global.M{MotorNumber}.HOA
15. Click OK to save the UDT. You will see the MotorUDT in the Data Types
folder.

Making Instances of the UDT


Now that we have the Motor UDT we can make instances of it. Instances are
running copies of a data type with concrete data for all members.
1. In the Tag Browser, right-click on Tags and select New Folder to create a
new folder. Name the folder “Motors”.

118 ©2019 Inductive Automation


Complex Tags (UDTs)

You can create a single instance of the motor or use the multi-instance
wizard to rapidly create all four at the same time.

©2019 Inductive Automation 119


Complex Tags (UDTs)

2. Right-click on the Motors folder and select New Tag> Data Type
Instance> Multi-Instance Wizard.

The Instance Creation Wizard is displayed.

3. From the Step1 - Select Data Type to Create drop-down, select


MotorUDT.

4. Set the following:


Base Tag Name: "Motor " (note the space at the end)
Tag Name Pattern: 1-10 this creates 10 Tags Motor 1, Motor 2, etc
Parameter: MotorNumber which is what we used to reference specific
Tags in the PLC.
Pattern: 1-10 so that Motor 1 Tag will have a parameter of 1 and Motor 2
will have a parameter of 2 and so on.
Tags to create: 10 This field will not be editable once the Pattern is filled
in.

Note: you will have to make the Instance Creation Wizard window taller to
show the Parameter Pattens table.

120 ©2019 Inductive Automation


Complex Tags (UDTs)

Basically, you have the Tag name and the parameter value to set.

5. Click Preview to see what Ignition will create for the Tag name and the
parameter value.

©2019 Inductive Automation 121


Complex Tags (UDTs)

6. Click OK to see all four Tags created.

If you expand each Tag, you can see all the members of the UDT and their
respective values.

Now if you make a change to the UDT, all 10 instances are automatically
updated because they are of that type.

7. Edit your Motor UDT by double-clicking on it in the Tag Browser.

The Tag Editor is displayed.

122 ©2019 Inductive Automation


Complex Tags (UDTs)

8. Click on the Add Tag icon on the top-left of window and select
Memory Tag.

9. Set the following:

Name: HighSP
Date Type: Integer
Value: 40

10. Click OK to save. Notice that each instance automatically gets the new
Tag.

©2019 Inductive Automation 123


Complex Tags (UDTs)

Overriding UDT Instances


We all know that not every motor is exactly the same, so there is a way to
make changes to individual Instances of a UDT. You can override any
property of a UDT by going into the Tag Editor and selecting the grey circle
next to any property value. This means that you can now change the value
in the instance so it will be different than the definition of the UDT. This also
means that any updates to the definition of the UDT will not override this
value.
You can use this to make lots of changes to your Tags, but if you need to
override every single instance of a UDT, then you should make that property
dynamic instead.

Nesting UDTs and Inheritance


When creating new UDTs, you can make them as simple or complex as you
want. In the example above, we have a simple UDT with just three Tags.
You can also include other UDTs inside a UDT. For example, you could have a
UDT for a conveyor where each conveyor has a motor attached to it. You can
re-use your motor UDT as a part of the Conveyor. This way when you update
the Motor UDT, all Conveyor UDTs will be automatically updated.
UDTs can also have parent-child relationships. You might have several types
of motors, where one is simple like the example above, and one is a VFD
(variable frequency drive) that has our simple motor as a parent and adds a
few other Tags that control the motor speed. This way when you update the
simple motor UDT, all VFD motor UDTs will be automatically.

124 ©2019 Inductive Automation


Chapter 9

Templates

Templates are a simple but a very powerful feature in Ignition that you can
use with the Vision windows. The power comes from the ability to modify
only the template in one location affecting all of the instances used
throughout the project.
HMI and SCADA systems typically have a lot of repetitions in their screens.
You might use a group of the same components over and over within your
project to represent different motors. The data driving each set of graphics
is different, but the graphics themselves are copies of each other. In our
example, there are four motors that are the same. You can make a single
template and use instances of the template over and over again.
Without templates, the only way to do this is to copy-and-paste the
components each time you want to represent a motor. This is simple, and it
works, but it can cause major headaches and time consuming corrections
later on. If you ever want to make a change to how motors are represented,
you're stuck making the change to each copy of the group.

©2019 Inductive Automation 125


Templates

Master Template and Template Instances


By using templates, you define the graphics to display a motor in one place,
called the master template. You can then use this template many times in
your project on multiple windows, these are called template instances.
Any changes made to the master template are then instantly reflected in all
of the template instances. Using templates early in your project
development for any repeating displays, can save a significant amount of
time later on.

Template Parameters
Because the primary use of templates are the ease of maintaining repeated
user interface elements, correct use of parameters is of high importance.
Parameters allow each template instance to reference different data
elements of repeated data configurations.

Parameters and Internal Properties


When you open the Custom Properties Customizer for a template master,
you'll notice it is different than all other components. There are two kinds of
custom properties: parameter properties and internal properties.

• Parameter property appears on each template instance, allowing each


template instance to be configured differently. Commonly, this is some
sort of indirection. For example, if your template is for representing
motors, you might have MotorNumber as a parameter property. Then
you can use that property as an indirection variable in other bindings
within the template.

Parameter properties are not bindable from within the template master
design. When you use the template to create a template instance, the
property becomes bindable. This ensures that the property only has a
single binding configured for it.

• Internal property cannot be used as a parameter. It shows up when


designing the template master, but it does not show up on the template
instances. Internal properties are bindable from within the template
master design. These properties are intended to be used for the internal
workings of the template.

126 ©2019 Inductive Automation


Templates

Indirection and UDT Tags


There are two primary ways to achieve indirection when using templates.
Let's continue to use the example of a motor. Your system has many motors
in it, and your template is used to display the status of the motors and
control the motor's running mode. The goal is to be able to drop instances of
the template onto your windows, and configure them in a single step to
point to the correct motor's Tags.
If the Tags representing the datapoints of each motor are arranged in an
orderly way in folders or with a consistent naming convention, you can use
standard indirection to configure your template. You can add a parameter
such as MotorNum to the template. Then you configure the contents of the
template using indirect Tag binding, where the value of MotorNum is used
for the indirection.
If your motors are represented by a custom Tag data type, you can save
some effort and use a property of that Tag type directly. Make your
indirection property the same type as your custom data type. Then you can
use simple property bindings to configure the components inside your
template. When you create a template instance, you can simply bind that
property directly to the correct Motor Tag, and all of the sub-Tags of motor
are correctly mapped through the property bindings.

The Drop Target Parameter


You may choose one of your parameters as the drop target. This lets you
drop Tags onto your windows to facilitate even quicker binding. For
example, let's say that you have a parameter that is an integer and you've
made it the drop target. If you drop an integer Tag onto a window, your
template appears in the list of components that it suggests you make.
Choosing your template creates a template instance and binds that
parameter to the Tag.
This also works for UDT Tags. Let’s say you have a custom data type called
Motor and a template with a Motor-typed parameter set as the drop target.
If you drop a motor Tag onto a window, it creates an instance of your
template automatically. If you have more than one template configured with
Motor drop targets, you have to choose which template to use.

©2019 Inductive Automation 127


Templates

Creating a Template
We are going to do the following:
• Create a template for the Motor.
• Use parameters in template instances.
• Add a component to the template and bind it to the UDT.
• Use the template on the window.

Create a Template for the Motor


1. In the Project Browser, go to the special item called Templates.

2. Right-click Templates and select New Template. Rename it to Motor


Template.

128 ©2019 Inductive Automation


Templates

Now you can see a checkered box in the design space where you design
your template. The checkered box let's you know that the template is
completely transparent. You can set a background color if you want.

Use Parameters in Template Instances


As the primary use of templates is ease of maintenance of repeated user
interface elements, proper use of parameters is of high importance.
Parameters let each template instance to reference different data elements
of repeated data structures. The parameter can be a simple data type
(integer, string, float, and so on) or a complex type (UDT).
UDTs and templates pair nicely together. Since we already have a UDT, let's
work with it.
First, let’s use the Motor UDT with the Motor template.

1. Right-click on checkered box of the Motor template and select


Customizers > Custom Properties.

As mentioned earlier, there are two types of properties: parameter


property and internal property.

We are going to add a parameter property so that it can exist on every


instance you put on the screens. Then each instance can bind the
parameter property to a Tag.

©2019 Inductive Automation 129


Templates

2. In the Custom Properties window, click the Add icon to add the
template parameter values.

Name: MotorData
Type: MotorUDT (Double-click to get the drop-down list and
select User Defined/Tags/MotorUDT)
Drop Target: Check the box (When this box is selected, you can drop
Tags onto your template instances to facilitate even quicker binding.)

3. Click OK.

Now in the Property Editor under the Template Parameters, you can
see the MotorData property.

130 ©2019 Inductive Automation


Templates

Add a Component to the Template and Bind it to Parts of UDT


1. Add an LED Display component and a Label component onto the
template. We’ll used these for the AMPs.

2. Change the text property for the Label to "Amps".

Now we can bind the Value of the LED Display to the AMPS Tag of
MotorUDT.

3. Select the LED Display component.

4. On the Value property, click on the Binding icon.

5. Select the Property binding type.

6. In the property tree, expand MotorData and select the AMPS tag.

7. Click OK to complete the binding.

You will notice that the LED Display doesn’t update it’s value. That’s
because the value in this Template definition is NULL. We are not linked to
a specific Motor yet.

©2019 Inductive Automation 131


Templates

8. Add a Label to the top of the motor to show the motor's name. Change
the Font property to size 14 and bold.

9. Set the Horizontal Alignment property to Center.

Ignition displays some meta information so you know exactly which Tag
the UDT is pointing to, we will bind to that.

10. On the Text property, click on the Binding icon.

11. Select the Property binding type.

12. In the property tree, expand MotorData and Meta, and select the
TagName property.

13. Click OK to complete the binding.

You will notice the Label goes blank. Again, that’s because the value in
this Template definition is NULL. We are not linked to a specific Motor yet.

132 ©2019 Inductive Automation


Templates

Now we need an image. We can use Symbol Factory to get an SVG.

14. Open Symbol Factory.

15. Select any motor in the Motors folder and drag it to the template.

Symbol Factory components are made up of several subcomponets or


paths that make up a vector-based graphic. If you expand the component
in the Project Browser, you can see all the paths. You can also double-
click on the component in the design space to select the individual
subcomponents. We want entire component to be one color based on the
HOA value, so we use a special method as described here to apply a tint.

©2019 Inductive Automation 133


Templates

16. Select the motor image component and from the Designer menubar
choose Edit > Duplicate, or press Ctrl-D.

17.With the new image selected, click on the Union icon in the toolbar or
select Shape > Union.

This flattens the duplicated shape into a single shape.

18. In the Property Editor, click the Edit icon of the Stroke Paint property,
then select the No Paint icon. This removes the outline.

19. Next, click on the binding icon next to the Fill Paint property.

134 ©2019 Inductive Automation


Templates

20. Select the Property Binding type and then select the HOA Tag in the
MotorData UDT.

When binding a color property to a Tag, you can set a color for each state
of the Tag in Number-to-Color Translation. We’ll set three color
options.

21. Click the Add new row icon so that there are three rows.

22. Double click in the color area for the 0 value, then select a red color from
the palette. Set the 1 value to green and the 2 value to yellow.

©2019 Inductive Automation 135


Templates

23. We need to make sure each color is semi-transparent so you can see the
actual symbol behind it. Click on the color wheel and set the alpha
channel at the bottom to 40. Press the Enter key if you type the value in.

24. Click the x icon in the upper right, then click OK to submit the color
change.
25. We can repeat this process for the other two values: 1=Green, 2=Yellow.

26. Click OK when you are done with the colors. The template now looks like
this:

136 ©2019 Inductive Automation


Templates

Notice when you clicked OK, the graphic became black. That is because
the MotorUDT property is not bound. We bind it to a Tag when we create
an instance of the template. The template definition here is generic and
points to nothing. You can see that if you view the motor UDT property.

To keep the two image components exactly on top of each other, we can
Group them.

27. Select both components in the Project Browser.

28. Click the Component > Group option from the menubar or the
Combine icon in the toolbar.

Now they are one component.You can verify this in the Project Browser.

©2019 Inductive Automation 137


Templates

Use the Template on the Window


Now that the template is created, we can use it on a window. There are two
ways to bring a template on the window:
• Drag the template to window.
• Drag Tag to window and select template (only if drop target is selected).
Because we have checked the box for Drop Target, let’s drag a Tag to
window.

1. From Tag Browser, drag the Motor 1 Tag onto the Components window.

Ignition knows there is only one template with that type, so it creates it
automatically for you. If there were more than one template, Ignition will
then let you select the template from a dropdown list.

138 ©2019 Inductive Automation


Templates

2. Now drag more motors on the window. You can drag in the Template from
the Project Browser and then drag Tags onto the Template instance.

Now that we have a few Motors on a window, we want to be able to control


the HOA state of each. Let's make a quick change to the template.

1. Open the Template definition again.

2. To add an HOA button to the template, drag a Multi-State Button


component from the Component Palette.

3. Set the Display Style property to Row.

4. Stretch the component to be wide and short so the buttons look nice.

The Multi-State button has a few special properties to make it work. We


need to bind both the Control Value and Indicator Value properties to
the HOA Tag of the UDT property.

5. Click on the binding icon for the Indicator Value property and select the
Property binding type.

6. Select the MotorData -> HOA tag and click the OK button. Now the
Multi-State button will show the current HOA value.

©2019 Inductive Automation 139


Templates

7. To get the write-back to work when clicking on a button, we need to bind


the Control Value property. Make the same binding in the previous step
but before you click OK, check the box for Bidirectional. This ensures
that when the Control Value property changes, the binding writes back to
the HOA Tag.

8. Click OK. You may need to move the components around slightly to make
them all fit.

Now let's go back to the Components window. You will notice that all of
the templates have been updated to include the HOA button.

140 ©2019 Inductive Automation


Templates

You now have a template that can control the motor.

Creating Indirect Tag Bindings


Indirect Tag bindings are an important part of Ignition and the binding
system. This means that which Tag is bound to can be changed based on the
value of something else. For example, you can have a selection from a drop-
down list to choose which Tags to look at on the screen.
We have several motor UDT Tags and a motor template. Let's create a drop-
down list with an attached motor template. The drop-down list gives the
option of which motor to look at. The motor Tags look like this:

Motors/Motor 1
Motors/Motor 2
Motors/Motor 3
Motors/Motor 4
The only difference between each motor is the number.

Create an Indirect Motor Template


1. In Designer, open the Components Window.

2. From Project Browser, under Templates, drag in the Motor Template.

©2019 Inductive Automation 141


Templates

3. From the Input tab of the Component Palette, drag a Dropdown List
component.
Now we need to setup the options for the dropdown list in the Property
Editor. The drop-down component has the Data property which is a dataset.
There are multiple ways to set up the dataset, but the default is to use an
integer and a string column. The format is as follows:

Two Column [Integer, String] (Default)


201 Apples
202 Oranges
203 Bananas

• Dropdown displays values from second column.


• Selected Value represents value from first column.
• Selected String Value represents value from second column.
• Selected Label represents value from second column.

4. Select the Dropdown List component and click the Dataset view icon
next to the Data property.

5. On the right side of Dataset Viewer window, click the Add Row icon
four times to add four rows.

6. Set the rows to the following values:

Value Label
1 Motor 1
2 Motor 2
3 Motor 3
4 Motor 4

7. Click OK to submit your changes.

142 ©2019 Inductive Automation


Templates

8. Set the Selected Value property to 1. Notice the values for Selected
String Value and Selected Label fill in for you.

We want to use the Selected Value in an indirect binding on the


template to dynamically select which motor to look at.

9. Select the new Motor template on the window and bind the MotorData
UDT property using an Indirect Tag binding type.

The easiest way to use the indirect Tag binding is to select a Tag as a
starting point and then make it dynamic.

©2019 Inductive Automation 143


Templates

10. Click the Tag icon on the right of Indirect Tag Path and select the
Motor 1 Tag as the reference. Make sure you don’t select one of the tags
in the Motor 1 UDT instance.

The dropdown list contains which motor number to look at. So we need to
link the Motor Tag number to the dropdown’s selected value.

11. Highlight the number 1 (in Motors/Motor1) in the Indirect Tag Path and
delete it. Then click on the Insert Property icon to the right to bring
in the dropdown's Selected Value property. Make sure you leave the
space in between Motor and 1.

144 ©2019 Inductive Automation


Templates

12. Ignition inserts {1} and links it to the dropdown. That means Ignition
substitutes {1} with the value of the dropdown allowing it to select which
motor Tag to look at.

©2019 Inductive Automation 145


Templates

13. Set the Bidirectional checkbox at the bottom and click OK.

Now you can try it out, and clicking the HOA button will change your Tag
values.

14. Save your project and open the Client.

You can change the drop-down list and it will select a different motor.

It is as easy as that to setup Tag indirection. You can apply this to popups
or anywhere in Ignition.

146 ©2019 Inductive Automation


Chapter 10

Tag History

Storing history in Ignition is powerful and simple to use. There are two main
ways to store history: using the Tag Historian or logging data with the
SQLBridge module. This chapter focuses on the Tag Historian.
Logging data is easy to do with Tag historian. Once you have a database
connection, all you do is set the Tags to store history and Ignition takes care
of the work. Ignition creates the tables, logs the data, and maintains the
database.
The historical Tags values pass through the store-and-forward engine before
ultimately being stored in the database connection associated with the
historian provider.
The data is stored according to its datatype directly to a table in the SQL
database, along with its quality and a millisecond resolution time stamp.
The data is only stored on-change, according to the value mode and
deadband settings on each Tag, thereby avoiding duplicate and unnecessary
data storage. The storage of Tag Group execution statistics ensures the
integrity of the data.

©2019 Inductive Automation 147


Tag History

Log the Data


Let's log the Realistic Tags.

1. Select every Tag in the Realistic folder, right-click and select Edit Tag.

The Tag Editor window is displayed.

In this window, you can edit the Tag and change the name, data type,
scaling options, metadata, permissions, history, and alarming.

2. In the History section of the Tag properties, set the History Enabled
Property to true. You will see more properties appear.

148 ©2019 Inductive Automation


Tag History

3. Select your Database connection from the Storage Provider Dropdown.


The Sample Mode property determines how often the Tag values are
stored in the database. We will use the On Change option which means
the Tag History will match the Tag's main Tag Group execution rate.

Note: Generally in a real project, you will want to see live data at a fast
rate and store history at a slower rate. For that, you can change the
Sample Mode to Tag Group and select a Historical Tag Group, or Periodic
and enter a static Sample Rate. It is preferred to use a Historical Tag
Group in case you want to change many Tags at once, later.

©2019 Inductive Automation 149


Tag History

4. Click OK. Now in the Tag Browser, to the right of each Realistic Tag that is
storing history, a Tag History icon appears letting you know it is set
up.

150 ©2019 Inductive Automation


Tag History

If you were to look in your database, you would see all the tables and data
Ignition has created for you.
Let's also log data for the motors we created. Since we created the motor
from a UDT, we only have to edit the UDT and not each individual instance.

Logging Data for the Motor


Let’s log data for the Motor UDT.

1. Right-click on the Motor UDT and select Edit Tag.

2. In Tag Editor, click the AMPS Tag, and under History set History Enabled
to true.

3. Set the following in Tag Editor and click Apply:

Storage Provider: MSSQL


Sample Mode: On Change

4. Do the same for the HOA Tag and the HighSP Tag. Make sure to set both
of these to use the Discrete Deadband Style.

©2019 Inductive Automation 151


Tag History

5. Click OK to save.
That's it. Now every motor instance automatically starts logging data.

152 ©2019 Inductive Automation


Tag History

Data Storage
Ignition uses an algorithm for pre-compressing the data (trimming
unnecessary values).
While advanced users can change the table according to their database to
be more efficient (for example, using a compressed engine), Ignition does
not perform binary compression or encrypt the data in any way.
Ignition uses the Sliding Window algorithm to compress data. There is more
information about it in the user manual, but basically that means Ignition
will check each new possible data point to see if it fits the trend of the last
few data points (based on the Deadband). If it fits, Ignition does not store
the new data. If the new data point falls outside of the recent trend, then
the previous data point is stored and a new recent trend is started.

©2019 Inductive Automation 153


Tag History

154 ©2019 Inductive Automation


Chapter 11

Display Historian
Data

Now we will look at the information we have logged with the Tag Historian.
To do so we will:
• Create a graph
• Add subplots to the graph
• Allow users to change the graph mode (realtime or historical) in runtime
• Allow users to add and remove pens in runtime

©2019 Inductive Automation 155


Display Historian Data

Create a Graph
Before we create a chart for historical data, we need a new window to
display it.

1. Create a window called History by duplicating your Components Window


and renaming it.

2. Delete all of the components on the window except the header


components.

3. Change the text of your Header Label to History, and set a new image.

4. Add a link to your History window on the Navigation screen like the
previous window. Open the Navigation window, right-click on the Tab
Strip component, select the customizer, and add a new tab pointed to this
window.
Now we can add our chart.

1. From the Charts tab of the Component Palette, drag in the Easy Chart
component.

2. Right-click on the chart and set the layout to Anchored and select all 4
sides. This way it will stretch when the Client does.

156 ©2019 Inductive Automation


Display Historian Data

We can add the Tags to the graph the same way we created the status
and control windows, that is, through drag and drop.

3. Drag the first five Realistic Tags from Tag Browser to the Easy Chart.

©2019 Inductive Automation 157


Display Historian Data

The Tags are displayed on the History Window, but because we have just
started logging data, not much data shows up.

4. To show more data, go to the Property Editor and change the Chart Mode
property of the Easy Chart to Realtime. This will show you the most
recent 5 minutes instead of a time range.

Now, let's configure the chart some more by adding subplots.

Add Subplots to the Graph


1. Right-click the chart and select Customizers > Easy Chart Customizer.

158 ©2019 Inductive Automation


Display Historian Data

The Easy Chart Customizer window is displayed. Here you can change the
pens, axes, subplots, and dynamic groups.

2. To add another subplot, click the Subplots tab, and click the Add icon.

There are two plots now and you can assign a Relative Weight for each
plot.

3. Make Plot 1 three times bigger than Plot 2 by setting the relative weight
of Plot 1 to a value of 3 and Plot 2 to a value of 1.

Next, let’s make our Realistic0 Tag part of Plot 2.

4. Go to the Pens tab, select Realistic0, and click the Edit pen icon to
the right.
5. In the Edit Pen window, change the Subplot to 2, and click OK.

©2019 Inductive Automation 159


Display Historian Data

Customize the Easy Chart


The Easy Chart component has many properties that change the way it
behaves and looks. For example, if you set the Auto Apply property to
true, you don't have to click the Apply button every time you select or
deselect a pen. The Easy Chart component also has a lot of built-in
functions like saving the data to excel, printing, and more.

You can make changes to the Easy Chart component in runtime through
binding. For example, you can change the mode (between Historical and
Realtime) from a drop-down list.

Change the Graph Mode (Realtime or Historical) in Runtime


1. Drag a Dropdown List component from the Input tab of Component
Palette.

2. Set the Dropdown component’s layout to Anchored so it doesn’t move


over the Easy Chart in the Client.

3. To set the items to select from, click on the Dataset View icon to the
right of the Data property.

160 ©2019 Inductive Automation


Display Historian Data

4. Add two rows by clicking the Add Row icon.

5. Set the data to the following values:


1 Historical
2 Realtime

The Value is used behind the scene and Label is what is displayed to the
user at runtime.

6. Click Preview icon in the Designer to interact with the window as if it


was a client.

You can then see the options in the dropdown list.

Once you select an option, the values are displayed as properties on the
drop-down list.

©2019 Inductive Automation 161


Display Historian Data

The Selected Value property lets you change the Easy Chart’s mode.

7. Put the Designer back in Design mode, then select the Easy Chart.

8. In the Property Editor, click the binding icon to the right of the Chart
Mode property.

9. Select the Property binding type.

10. Select the Dropdown -> Selected Value property and click OK.

Now in the runtime, the user can change the chart's mode on the fly.

162 ©2019 Inductive Automation


Display Historian Data

Using a Tag Browse Tree with the Easy Chart


The Tag Browse Tree component allows the user to view and interact with
Ignition’s Tags from a Client. For example, the user can select and drag
Historical Tags from the Tag Browse Tree into the Easy Chart to display the
Tag history.

Add a Tag Browse Tree Component


1. From the Component Palette, drag the Tag Browse Tree component into
the left side of the window.

2. Set the Layout on this component to Anchored and select only top,
bottom, and right.
Since we're using the Tag Browse Tree in combination with the Easy
Chart, we only want to show Tags that have been historized. One options
would be to set the Tag Tree Mode to Historical Tag Tree, which would use
our Historical Tag Providers to drive the tree. However, we have a
different way in mind.

3. To filter out the Realtime Tags, deselect Include Realtime Tags from the
Tag Browse Tree Property Editor.

©2019 Inductive Automation 163


Display Historian Data

4. In the Tag Browser, find the Realistic folder inside the GenSim folder.
Then right-click on the folder and select Copy Tag Path.

5. Paste this Tag path into the Root Node Path property on the Tag Browse
Tree component.

This filters the component to display only the Tags and subfolders inside
the Realistic folder.

164 ©2019 Inductive Automation


Display Historian Data

The Tags inside the Realistic folder are now displayed and the Tag
History icon next to the Tags show that they are Historical Tags.

6. Set the Designer to Preview mode then select and drag the additional
Realistic tags (5-9) from the Tag Browser Tree to the Easy Chart.

Tags are added as pens and historical data is displayed in the Easy Chart.

©2019 Inductive Automation 165


Display Historian Data

Creating Tables
In addition to the graphical display of historian data, we can also show the
logged data in tables.

Display Historian Data in Tabular Form


1. Drag the Table component onto the bottom of the History window.

2. Set the Layout to Anchored, and select only the left, right, and bottom
buttons.

166 ©2019 Inductive Automation


Display Historian Data

The table displays information through the Data Dataset property. A


dataset property can have multiple columns and rows of data. When
binding to a dataset property, Ignition provides three extra binding types:
• Tag History
• Cell Update
• Functions

The Tag History binding type allows you to bring back historian data to
any component in a variety of ways.

3. Bind the Data property using the Tag History binding type.

4. In the Available Historical Tags box, navigate to the folder with the
Tags that you are logging historically.

©2019 Inductive Automation 167


Display Historian Data

5. Select several of the Realistic Tags from the Available Historical Tags
box and drag them to the Selected Historical Tags box on the right.

This lets Ignition know which Tags you want to query from.

168 ©2019 Inductive Automation


Display Historian Data

6. In the Property Binding window, set the following options:

Date Range: Realtime


Most Recent: 30 sec (to bring back most recent 30 seconds of data for
the Realistic Tags)
Aggregation Mode: Time-weighted Average
Return Format: Wide (the default value)
Sample Size: Fixed - 15
Polling Mode: Off (so it only runs once)

The date range, aggregation mode, sample size, return format, and
polling options let you specify how you want to bring back the history for
the selected Tags. A description of these settings and their options
follows.

©2019 Inductive Automation 169


Display Historian Data

7. Click OK.

Now you can see raw data coming back in the table.

170 ©2019 Inductive Automation


Display Historian Data

Settings on the Property Binding Page


Date Range - The date range lets you choose either a Historical or Realtime
query.

• Historical queries use a date range that must be bound-in from other
components on the screen, typically a Date Range or a pair of Calendar
components.

• Realtime queries always pull up a range that ends with the current time,
so all you specify is a length, for example 30sec, which is the last 30sec
up to current time.
Aggregation Mode - You use the aggregation mode when the data is
denser than what you asked for. This happens when using fixed or interval
return sizes, as there are often multiple raw values for the window interval
defined. Another common operation is to set the return size to 1 in order to
use these aggregate functions for calculation purposes.

• Min/Max returns two entries per time slice, the min and the max
entries.

• Time-weighted Average returns the time-weighted average value of


all samples in that time slice.

• Closest Value returns the most recent actual value to the end of the
window.

• Basic Average returns the simple mathematical average ((V1+ V2+...+


Vn) /n) of the values.
Return Format - The Return Format lets you choose the format that Tag
history data returns in a dataset.

• Wide returns the dataset columns in the following order: timestamp is


the first column and each subsequent column is the name of the Tag.
The Wide format is compatible with the charts.

• Tall returns the dataset columns in the following order: first column is the
path to the Tag, followed by a column for value, then quality, and finally
timestamp. The Tall format is not compatible with the charts.
Sample Size - The sample size determines how the underlying data is
aggregated and/or interpolated.

• Natural calculates a return size based on the rate of the logging


historical Tag groups. For example, if you query 1 hour of data for a scan
class logging every minute, the natural return size is 60.

©2019 Inductive Automation 171


Display Historian Data

• On Change means that you'll get an entry whenever any of the Tags
under consideration changes.

• Fixed specifies the number of rows in the resulting dataset.

• Interval lets you define a window size instead of defining a Fixed return
size. For example, if you want to bring back one data point for every 15
minutes, you can use the Interval sample size.
Polling Options - Polling has three binding mode options.

• Off executes once when the window is opened and then it only executes
again if it changes. The typical example of a binding that can change is a
SQL query binding where it uses the brace-notation ({}) to include
dynamic information inside the query. When this dynamic information
changes the query, it runs again.

• Relative executes at a regular rate which is based on a delta off of the


project's base polling rate. This is usually a good idea so that you can
speed up or slow down an entire client's polling system in one place.

• Absolute executes at an absolute rate that you specify instead of one


that is based on the relative rate.

172 ©2019 Inductive Automation


Chapter 12

Transaction
Groups

Transaction Groups are the heart of the Ignition SQL Bridge Module.
Transaction Groups are units of execution that perform a variety of actions,
such as storing data historically, synchronizing database values to OPC
items, or loading recipe values. A wide variety of group types, items types,
and options mean that Transaction Groups can be configured to accomplish
many different kinds of tasks.

©2019 Inductive Automation 173


Transaction Groups

The Transaction Execution Cycle


All Transaction Groups follow a similar execution cycle. The core evaluation
may differ, but the general cycle is the same. Main actions are bold, but the
execution cycles perform the following steps:

1. Timer executes, group enters execution.

2. Is Paused? Break execution.

3. Is cluster master? If not, break execution.

Transaction groups only execute on the master.

4. Evaluate "run-always" items: OPC items, Tag references, and


Expression items set to ignore the trigger.
5. Evaluate trigger. If there is a trigger defined, but it is not active, break
execution.

6. Evaluate "triggered" items: Expression items not set to ignore the


trigger.

7. If applicable, read values from the database.

8. Execute a comparison between items and their targets.

9. Execute any writes to other Tags or the Database that result from
execution.

10. Report alarms.

11. Acknowledge the trigger, if applicable.

12. Write handshake value, if applicable.

Types of Transaction Groups


There are four types of transaction groups that you can use in your projects.
Each type offers a different functionality, they are as follows:
• Historical
• Standard
• Block data
• Stored Procedure

174 ©2019 Inductive Automation


Transaction Groups

Historical Group
The historical group makes it easy to quickly log data historically to a SQL
database.
The historical group inserts records of data into a SQL database by mapping
items to columns. With full support for triggering, expression items, hour
and event meters, and more, you can set up complex historical
transactions.
Unlike the standard group, the historical group cannot update rows, it can
only insert. Also, it cannot write back to items, except for trigger resets and
handshakes.

Standard Group
The standard group is called such because it's a flexible and general use
group that can be adapted to a variety of situations. The data model is
row-based, with items mapping to columns and the data corresponding to a
specific row of a table.
The standard group contains items who may be mapped to the database or
used internally for features such as triggering or handshakes. Items who are
mapped to the database target a specific column of a single specific row,
chosen according to the group settings. Items can be mapped in a one-way
fashion or bi-directionally in which the value of the database and the item
will be synchronized.
The group may also insert new rows instead of updating a specific row. In
this way, data can be inserted for historical purposes based on a timer, with
an optional trigger.

Block Data Group


The block data group is so named because it writes "blocks" of data to a
table, consisting of multiple rows and columns.
A block data group contains one or more block items. Each block item maps
to a column in the group's table. Then it defines any number of values (OPC
or Tag items) that will be written vertically as rows under that column.
Block groups are very efficient and they can be used to store massive
amounts of data to the database. For example, 100 columns each with 100
rows, that is 100,000 data points which will often only take a few hundred
milliseconds to write, depending on the database.
Like the standard group, the block group can insert a new block or update
the first, last, or a custom block. Additionally, the group can be set to only
insert rows that have changed in the block.

©2019 Inductive Automation 175


Transaction Groups

Stored Procedure Group


The stored procedure group is similar to the other groups in terms of
execution, triggering, and item configuration. The primary difference is that
unlike the other group types, the target is not a database table, but instead
a stored procedure.
Items in the group can be mapped to input or output parameters of the
procedure. They can also be bound to output parameters, in which case the
value returned from the procedure will be written to the item. Items can be
bound to both an input and output at the same time.

Common Settings
The following are the common settings in transaction groups:

• Update Rate - Is how often the group is evaluated. For a number of


reasons, the group may not execute during the evaluation, the most
common reason being the trigger.

• Data Source - Is the data connection to use for the group. It can be
"Default", which will use the default connection for the project.

• Update Mode - For groups that support it, sets the default for how data
moves in relation to their targets.

• Store Timestamp - Stores a timestamp along with the data any time
the group executes.

• Store Quality Code - Stores an aggregate quality for the group along
with the regular data. The aggregate quality is a bit-wise AND of the
qualities of the items in the group.

Group Items
Items are the core elements of a group. When items are executed, the
values are then used by the group (for logic purposes), by other items, and
to write to the database.
Items can be written to, from the database or from other items. The
following are the group items types:
• OPC Item
• Expression Item (Run-Always)
• Expression Item (On-Trigger)
• Tag Reference

176 ©2019 Inductive Automation


Transaction Groups

OPC Item
An OPC item, directly subscribes to an OPC server at the rate of the group.
Executed by the group, so alarms are evaluated when the group is
executed. These items are executed even when the trigger isn't active.

Expression Item (Run-Always)


Run-Always expression items are much like an expression Tag, they can be
either a static value, an expression, or a database query. Run-Always
expression items are evaluated at each group interval before the trigger
state is evaluated.

Expression Item (On-Trigger)


On-Trigger expression items are the same as Run-Always expression items,
except that they are only executed after the trigger has been evaluated and
is active.

Tag Reference
This is a reference to a Tag. Allows a Tag to be used in a group like any other
item type, except that the Tag is evaluated by its Tag Group instead of by
the group.
It is easy to confuse the definition and purpose of Tags and OPC items in
transaction groups, though they have distinct benefits.
Tags may be referenced inside of groups, however it is critical to remember
that they are executed by the Ignition Gateway, according to their scan
classes and independent of the group. Adding a Tag into a group is like
creating a shortcut to that Tag.

Triggers
The trigger settings determine when a group will actually execute. They are
examined each time the group evaluates according to the update rate of the
group. If they pass, the group will run and perform its action.
The trigger settings are the same for all group types. They are found in the
right side of the Transaction Group workspace, on the second tab, labeled
Trigger.
There are two types of triggers:
• Executes group only on change - Async Trigger
• Executes group on a specific item in the group

©2019 Inductive Automation 177


Transaction Groups

Handshaking
Group handshakes are also defined on the Trigger tab. You can specify both
a success and failure handshake.
The success handshake will write the specified value to the given item when
the group has finished all other triggered execution without error.
The failure handshake, on the other hand, will be written when the group
execution is cut short due to an error, such as an error writing to the
database or an item.

Creating a Basic History Group


The historical group makes it easy to quickly log data historically to a SQL
database.

Create an Historical Group


Let's create an historical group that logs a few Tags to the database every
10 seconds.

1. In the Designer, from the Project Browser, select the Transaction


Groups item.

The workspace is changed to the Transaction Groups view.

2. In Project Browser, right-click the Transaction Groups item and select


New Transaction Group > New Historical Group. A new Group is
added.

3. Name the group Basic History.

178 ©2019 Inductive Automation


Transaction Groups

Now we need to drag in the Tags we want to log.

4. Drag all the Ramp Tags from Tag Browser into the Basic OPC/Group Items
table.

©2019 Inductive Automation 179


Transaction Groups

You will notice that each Tag is automatically mapped to the database
table under the Target Name column. So when the group inserts a new
record Ignition knows where to put the values.

Next, we need to setup the group rate and which database table to log to.

5. On the Action tab on the right, set the following:

Execution Scheduling: Timer and 10 second(s) group rate. You can


execute the group from a timer or a schedule.

Data Source: <default>


Table name: history (Ignition automatically creates the table if it doesn't
exist.)
Store the timestamp to: check the box
Delete records older than: check the box and set 90 days.

Since the data is being logged to a single table, you don't want the table
to grow forever so you can check the box to delete records older than a
time period.

Almost done. We need to enable the group and save the Designer.

6. Click on the Enabled button above the Basic OPC/Group Items table
and save the project in the Designer.

180 ©2019 Inductive Automation


Transaction Groups

You will notice the group will have a green arrow in the Project Browser
letting you know the group is running.

Let's look at the database to see the data.

7. Click on the Database icon to the right of the table in the Action tab.

The Database Query Browser is displayed showing you the data logged so
far.

8. Click the Auto Refresh button to see the new data come in every 10
seconds.

©2019 Inductive Automation 181


Transaction Groups

Creating a Recipe Group


You can use Transaction Groups to log data as well as to load recipes down
to the PLC.
Let's create a complete example of a recipe management system. We store
all of our recipes in the database and create a transaction group to load a
recipe to the PLC.
To create this recipe management system, we perform the following steps:
• Create a database table of all the recipes.
• Create some Tags to write the recipe value.
• Create a standard Transaction Group to load the recipe values to PLC.
• Configure group to write to Tags based on recipe ID.

Create a Recipes Table in the Database


First, we need to create a database table of all the recipes. Each recipe has
a unique id, a name, and two setpoints (sp1, sp2). Since the recipes are
stored in the database, you can have as many recipes as you would like.

1. Before we get started, verify that the Designer’s Comm Mode is set to
Read/Write.

182 ©2019 Inductive Automation


Transaction Groups

2. Next, open up the Tools menu at the top of the Designer, and select
Database Query Browser to open it up.

3. In the query input on the Database Query Browser, enter the following
query, then click Execute:
CREATE TABLE recipes (
id INT PRIMARY KEY,
recipe_name VARCHAR(50),
sp1 FLOAT,
sp2 FLOAT
)
This will create the table that will house our recipe list and setpoints.

©2019 Inductive Automation 183


Transaction Groups

4. Now that our table is created, we can add records to the table. Each row
in our table corresponds to a single recipe. Enter the following query into
the Database Query Browser, then click Execute:
INSERT INTO recipes (id, recipe_name, sp1, sp2 )
VALUES (1, 'Recipe 1', 10, 0)
Feel free to use any values for the recipe_name, sp1, and sp2 fields that
you’d like. Once you’ve run the query, you can double click on the recipe
table on the right side of the Database Query Browser, then click Execute
to view the table.

5. Now that we have a row in the table, we can use some special features of
the Database Query Browser to populate the table with more records. At
the bottom of the Database Query Browser, click the Edit button.

184 ©2019 Inductive Automation


Transaction Groups

6. After clicking the Edit button, right click on the existing row in the table,
then click Add Row. Do this a few times, to add 4-6 rows to the table.

7. Once the rows are set up, you can double-click cells in the table to change
the value in that cell. Set up the values in the id column to be sequential
numbers starting at 1, and enter in any recipe names and setpoints that
you’d like.

©2019 Inductive Automation 185


Transaction Groups

8. Once finished, click the Apply button at the bottom of the Database
Query Browser. This will commit the changes you’ve made to the table.

Create Some Tags to Write the Recipe Value


Next we need some Tags to write these recipe values to.

1. In the Tag Browser in the Designer, expand the Tags folder.

2. Right-click the Tags folder, create a new folder, and call it “Recipe”.

3. Open up the OPC browser, and navigate to the Writeable folder inside the
GenSim device.

4. Drag the WriteableFloat1, WriteableFloat2, WriteableInteger1, and


WriteableString1 OPC items into the Recipe folder in the Tag Browser,
to create corresponding Tags for each item.

186 ©2019 Inductive Automation


Transaction Groups

5. Rename the WriteableString1 Tag to Recipe Name.

6. Rename the WriteableInteger1 Tag to Recipe ID.

7. Rename the WriteableFloat1 Tag to SP1.

8. Rename the WriteableFloat2 Tag to SP2.

©2019 Inductive Automation 187


Transaction Groups

Create a Standard Transaction Group to Update Tags


Now that we have our Tags, the best way to load the recipe values is with a
Standard Transaction Group.

1. In Designer, from Project Browser, select the Transaction Groups item.

Your Designer will switch to the Transaction Groups workspace.

2. Right-click on Transaction Groups item and select New Transaction


Group > New Standard Group.

188 ©2019 Inductive Automation


Transaction Groups

3. Give the group the name Recipe. And click Create Group.

4. From the Tag Browser on the left side, drag all four recipe Tags into the
Basic OPC/Group Items table of the group.

These are the items the group needs to work with.

Next, we need to setup the mapping between the database and the items.

Notice that the Recipe ID item is set to read-only since we only need it as
the trigger and for the where clause.

5. On the Action tab on the right side of the workspace, set the following:

Update rate: 1 sec


Update mode: DB to OPC (Very Important!)
Data source: <default>
Table name: recipes

©2019 Inductive Automation 189


Transaction Groups

Automatically create table: uncheck the box


Use custom index column: check the box, and enter id
Store timestamp to: uncheck the box
Table action: update/select and key/value pairs
Column: id
Value: Recipe ID (use dropdowns to populate fields)

190 ©2019 Inductive Automation


Transaction Groups

Here the group will run every 1 second taking the values from the recipes
table where the id equals the current recipe Tag to write them down to
the Tags. Right now the group runs every 1 second. However, we only
want the group to run when the Current Recipe ID Tag changes. For that
we need to configure the Trigger tab.

6. Go to the Basic OPC/Group Items table and select the Target Name for
each item. Single-click in the target name for a dropdown list. Set the
following:
Recipe ID: Read only
Recipe Name: Recipe_name
SP1: SP1
SP2: SP2

7. Go to the Trigger tab and use the following parameters:

Execute this group on a trigger: check the box


Trigger on item: Recipe ID
Only Execute once while trigger is active: check the box
Reset trigger after execution: uncheck the box
Trigger Conditions: Active on value change

©2019 Inductive Automation 191


Transaction Groups

8. Lastly, click on the Enabled button above the tables and save the project
by pressing Ctrl-S or selecting File > Save from the menu.

The group is now running.

192 ©2019 Inductive Automation


Transaction Groups

Right away SP 1-2 will get the values from recipe 1 of the database.

Also see the Status of the group, notice the fact that it is running and
total number of executions.

Now we need to change the Current Recipe value to load a new recipe.

©2019 Inductive Automation 193


Transaction Groups

Test the Recipe Group


Now that the ground work is in place, you can add windows to an interface
that changes the recipe value and runs the group. For example,

1. Go to the Tag Browser, double-click the value for Recipe ID, and change
it to 2.

Now the group will run and recipe 2 values get loaded.

Note: The Designer needs to be in Read/Write mode to edit the Tags


value.

2. Go back to the Vision space in the Designer.

3. Open the Main Windows -> Empty window.


4. From the Tab Browser, drag the Recipe ID tag onto the window and
select a Numeric Text Field.

5. Multi-Select the SP1 and SP2 Tags and drag them onto the screen as LED
Display components.

6. Drag the Recipe Name Tag onto the window as a Label.

7. Put the Designer in Preview mode and edit the value in the Numeric Text
Field to load a new recipe. You can choose any value that exists in the ID
column in the database table.

194 ©2019 Inductive Automation


Chapter 13

Alarming

Alarming is a core feature of the Ignition platform. Alarms are conditions


that are evaluated with respect to a specific numeric datapoint. Most
commonly, alarms are configured on a Tag or a Transaction Group item.
Any number of alarms can be attached to a datapoint. When the alarm
condition becomes true, the alarm is considered to be "active". For example,
on an analog Tag you might add a high-level alarm that goes active when
the Tag's value is over 50.0. You could add another alarm on the same Tag
for a high-high-level when the value is over 75.0. On a discrete Tag, you
might configure an alarm to be active when the value is non-zero. Each
alarm has its own name, priority, and many other settings.
When the alarm condition becomes false after it has been true, the alarm is
said to have "cleared". Each alarm has a numeric deadband and time delay
deadbands that can affect when the alarm goes active and clear, this is to
prevent frequent oscillations of an alarm between active and clear when the
value is hovering near the setpoint. At some point, an operator can
acknowledge an alarm, confirming that they have seen the event.

©2019 Inductive Automation 195


Alarming

The history of alarms is stored in any configured alarm journals. These will
journal all state changes on each alarm, as well as acknowledgments, to an
external SQL database of your choosing.

Alarm Journal
An Alarm Journal stores historical information about alarms in a database. It
can store basic data about alarms that have occurred, such as their source
and timestamp, along with associated data on the alarm, and the values of
the alarm’s properties at the time the event occurred. The Alarm Journal
storage is used by the Alarm Journal Component and can also be accessed
through scripting functions and direct database queries.

Alarm Notification
Alarm notification is the act of sending a message to a group of people when
an alarm becomes active or clear. In Ignition, this functionality is enabled by
having the Alarm Notification Module installed.

Alarm Properties
Every alarm you configure has many properties that can be set. These
properties can change the behavior of the alarm. It is important to
understand what each property is.

Alarm Name
Each alarm has it's own name. For example, if the Tag is representing a
level, the alarm name could be "High Level".

Enabled
This boolean determines whether or not the alarm will be evaluated. A
disabled alarm's condition is not evaluated and thus does not generate any
alarm events.

Priority
Can affect how it appears in an alarm status table, or can affect how it is
escalated through a pipeline. The following are the priorities, which can be
referenced by their integer equivalent in scripts and expressions: Diagnostic
[0], Low [1], Medium [2], High [3], Critical [4].

196 ©2019 Inductive Automation


Timestamp Source
Chooses where the timestamp for the alarm event should come from: the
system time of when the event was generated, or the timestamp of the
value that tripped the event.

Label
This string value is used to display alarm information to the operators.

Display Path
This string value is used to display the alarm to the operators. If this value is
blank, the operator will see the path to the Tag instead. Use the forward-
slash character to separate hierarchy levels in the path, for example: Eas t
A rea/Boilers/Boiler5

Ack Mode
Dictates how acknowledgment works for the alarm.

• Unused - Acknowledgment is not used for this Tag. Any alarm that is
generated will automatically be marked as acknowledged.

• Auto - The alarm is acknowledged automatically when the alarm


becomes cleared.

• Manual - The alarm is never set to acknowledged by the system, it is up


to the user to manually acknowledge alarms.

Notes
A place for any free-form documentation about the alarm that can be
displayed to operators.

Ack Notes Required


If this setting is true, the operators can not acknowledge this alarm without
entering some notes.

Shelving Allowed
If this setting is true, the shelving feature is Available for this alarm.

©2019 Inductive Automation 197


Alarming

Mode
Sets the condition that the alarm is evaluating. The following are the
different mode options:

• Equal - Active when the Tag's value equals the alarm's setpoint.

• Not Equal - Active when the Tag's value is not equal the alarm's
setpoint.

• Above Setpoint - Active when the Tag's value is above the alarm's
setpoint.

• Below Setpoint - Active when the Tag's value is below the alarm's
setpoint.

• Between Setpoints - Active when the Tag's value is between the low
and high setpoints. If any change is true, an event is generated for each
value change between the setpoints.

• Outside Setpoints - Active when the Tag's value falls outside the low
and high setpoints. If any change is true, an event is generated for each
value change outside the setpoints.

• Out of range - Same as Outside Setpoints, but uses the Tag's


Engineering High and Engineering Low as the high and low setpoints.

• Bad Quality - Active if the Tag value becomes a bad quality, for
example, on communication loss.

• Any Change - Generates an alarm event every time the Tag value
changes. Note that this alarm will never be "active" because each active
event is paired with a matching clear event, instantly.

• Bit State - Active when a specific bit out of an integer Tag becomes
high. You must specify which bit position to use, with zero being the least
significant bit. The On Zero property is used to invert the logic and
alarm when the bit is low.

• On Condition - Use this free-form mode when you want to specify the
condition using an expression or another Tag. To do this, bind the Is
Active property to an appropriate expression or Tag.

198 ©2019 Inductive Automation


Alarming

Setpoint / Low Setpoint / High Setpoint


The setpoint properties are used for many alarm modes to specify the range
for which the alarm becomes active.

Inclusive / Low Inclusive / High Inclusive


The inclusive properties correspond to a setpoint. If true, the range will be
active if the value is exactly equal to the setpoint, not only above or below
it.

Deadband Mode
The following are the two deadband modes:
• Absolute - The deadband setting is considered to be an absolute value.
• Percent - The actual deadband is calculated as a percent of the Tag's
engineering unit span.

Deadband
The deadband value is interpreted according to the deadband mode. Note
that all alarms are only evaluated after the Tag's value changes, which
means that the Tag's own deadband is considered first.
When the deadband is positive, an active alarm condition needs to clear it's
setpoint(s) by the amount of the deadband for the alarm to clear. For
example, suppose you had a Between Setpoints alarm with a low
setpoint of 50 and a high setpoint of 70, with a deadband of 2. The alarm
goes active if the value is between 50 and 70, but will only clear if the value
falls below 48 or rises above 72.

Active Delay
The time, in seconds, before the alarm will be considered active after the
alarm's condition becomes true. Also known as a "rising edge time
deadband".

Clear Delay
The time, in seconds, before an active alarm will be considered clear after
the alarm's condition becomes false. Also known as a "falling edge time
deadband".

©2019 Inductive Automation 199


Alarming

Ack Pipeline
The name of an alarm notification pipeline to put this alarm into when the
alarm becomes acknowledged.

Active Pipeline
The name of an alarm notification pipeline to put this alarm into when it
becomes active. This is the primary source for sending out alarm messages.
Many alarms may share a single pipeline.

Clear Pipeline
The name of an alarm notification pipeline to put this alarm into when it
becomes clear.

Custom Subject
A string that is used as the subject line of an email notification message. If
blank, the message settings defined on the notification block that sent the
email out is used instead.

Custom Message
A string that is used as the body of this alarm's email notification message.
If blank, the message settings defined on the notification block that sent the
email out is used instead.

Configure a Digital Alarm


First let's create an alarm where the Tag goes into alarm when the value is
equal to true. Once we have Tags created, it is easy to set up alarms on
those Tags.

1. Go to the Designer.

2. In the Tag Browser, right-click on the WriteableBoolean1 Tag in the


Writeable folder and select Edit Tag.

200 ©2019 Inductive Automation


Alarming

3. Scroll down to the Alarms property, and click the Edit icon to configure
an alarm.

©2019 Inductive Automation 201


Alarming

We can configure one or more alarms on a given Tag.

4. To add an alarm, double-click on the + New Alarm... link or click on the


Add icon on the right of the Alarms list

When you double-click the new alarm, all the configuration settings are
displayed on the right side. Every alarm must have a name and a priority.
The priority is a way to rank how important an alarm is. The name simply
describes what this alarm is.

5. When the alarm occurs we want the operator to see "Test Alarm" and a
"Medium" severity. Set the following alarm properties:

Name: Test Alarm


Priority: Medium

6. To select the condition for when the alarm is active, enter the following:

Mode: Equal
Setpoint: 1

202 ©2019 Inductive Automation


Alarming

7. Leave the rest of the settings alone for now and click Commit to save the
changes.

8. Click OK to save the Tag.

An Alarm icon is now displayed to the right of the Tag to let you know
an alarm is configured on it.

9. Set the value of the Tag to true and the Tag will be in alarm.

Alarm Summary
Let's now look at displaying the current status of our alarms. There’s already
an alarm screen created for you by the project template. It has a header
and an Alarm Status Table component that is showing all alarms. In the
Project Browser, select the Main Windows folder and open the Alarms
window.

©2019 Inductive Automation 203


Alarming

Adding Multiple Alarms Concurrently


Before we talk more about the Alarm Status Table, lets add a few more
alarms to make it interesting.
You can select multiple Tags and add the same alarm to all of them at once.
Lets add alarms to all of the Realistic Tags.

1. In the Tag Browser, expand to the GenSim/Realistic folder.

2. Shift-select all of the Realistic Tags. Right-click on one of them and select
Edit Tags.

3. Click on the Edit icon for the Alarms property.

4. Click on the + icon to add a new alarm state and fill in the following
properties:

Name: High Alarm


Priority: Critical
Mode: Above Setpoint
Setpoint: 35
5. Click Commit in the lower left, then click OK.

Alarm Summary
The Alarm Status Table is a built-in component that is highly customizable
an exists to display current Alarm information. Just drop one on a window
and it will start showing data immediately. Operators can also show/hide
information on the alarm status component in the runtime.

204 ©2019 Inductive Automation


Alarming

An operator can select an alarm and click the Magnifying Glass icon to
view the details of the alarm.

You can press the Acknowledge button to acknowledge the alarm. The
Current State will change.

You can shelve the alarm to temporarily silence the alarm. To view shelved
alarms, click the Shelve icon.

©2019 Inductive Automation 205


Alarming

An operator can right-click on the table header to add/remove columns. You


can also resize the columns and move change the order of the columns.

Lastly, once you have an Alarm configured and the Tag is stored in the
historian, you can click the Graph icon on the Alarm Status Table to view
a quick trend.

206 ©2019 Inductive Automation


Alarming

Change Alarm Status Table Behavior


It is also possible to change how the table behaves. For example, all
exposed buttons in the table can be shown or hidden, based on exposed
Alarm Status table properties. These are boolean properties that can be
statically turned on or off, or bound to the output of Tags or expressions. For
instance, it is easy to show or hide the Acknowledge button based on which
user is logged in.

Additionally, it is possible to change how alarm states look in the table.


Right-click on the Alarm Status table, find Customizers, and select Alarm
Row Styles.

©2019 Inductive Automation 207


Alarming

This interface allows us to configure a list of expressions – the first


expression that returns True for a given alarm will decide how that alarm is
styled in the table.
For example, in the default configuration, an alarm with a Diagnostic priority
will be configured to have a dark grey background, while all other alarms
will proceed to the second expression, and so on, until their properties allow
them to match one of the conditions. It is possible to configure custom
conditions, as well as change the row styles across different conditions.

Show or Hide Alarms


There is a set of properties for filtering alarms. Using the Source Filter and
the Display Path Filter properties, you can filter out cleared alarms, filter
for alarms in a particular Tags folder, and filter for alarms matching a certain
display path. This field accepts wildcards (* and ?) to help match groups of
alarms.

208 ©2019 Inductive Automation


Alarming

For example, if the Alarm Status Table is displaying all our existing
alarms, and you only want to display the Boolean alarm, then you can add
*Boolean* to the Display Path Filter property as follows:

©2019 Inductive Automation 209


Alarming

And now only the WriteableBoolean alarm is shown in the Alarm Status
Table.

Dynamic Alarm Filtering


You can also allow your users to set the alarm filters on the fly by adding a
component and a simple binding.

1. Drag a Text Field component onto the window.

2. Set the name of the Text field to Search.

The Alarm Status Table layout is set to anchored to all 4 sides. Set your
Text Field’s layout to anchored and adjust it so they never overlap.

3. Select the Alarm Status Table and click on the binding icon for the
Display Path Filter property.

4. Select the Expression binding type and enter the following:

"*" + {Root Container.Search.text} + "*"

210 ©2019 Inductive Automation


Alarming

5. Click OK.

Now you can put the designer into Preview Mode to test it out.

Alarms in UDTs
User defined types in Ignition are great because you can specify the
configuration of your type in a single location. Every instance of the Tag will
automatically inherit the configuration. This is great when configuring
alarms because the alarms typically have to be configured in a certain way.
The developer can configure the alarm in the UDT and every instance will
automatically have the alarms.

Add an Alarm to a UDT


Let's edit the motor UDT we created earlier and add an alarm to the AMPS
Tag. Our alarm on our AMPS Tag will look at the AMPS High Setpoint Tag
we've already configured, and the alarm will trigger when the Amps value
exceeds the configured setpoint.

1. Double-click on the Motor UDT in the Data Types folder to edit the UDT.

©2019 Inductive Automation 211


Alarming

2. Click on the AMPS Tag.

3. Scroll down to the Alarms property, and click the Edit icon to configure
an alarm.

4. Add an alarm and configure the following properties:

Name: AMPS High Alarm


Priority: High

212 ©2019 Inductive Automation


Alarming

Now there is a problem here. The problem is that the name of the alarm is
AMPS High Alarm. This means that every instance of the UDT will have an
alarm with the same name, and we'll have no way to tell them apart.

Since the configuration is in the UDT, we need to make sure we


dynamically change any property that must be different for each instance.
We can use the UDT parameters for that purpose.

Rather than setting the display path, we can bind the property to an
expression involving the UDT parameter InstanceName and the alarm
property name. Notice that you can bind the property to a Tag,
expression, and UDT parameter. You can also use UDT parameters in the
expression. This is only available in UDTs.

5. Bind the Display Path to the following expression (note the spaces):
{InstanceName} + " " + {name}

6. Click the Back link in the upper left to save the changes to your
expression.

7. Lastly we want to set the alarm mode. Change the Mode property to
Above Setpoint.

8. We can set the setpoint dynamically with a binding. Click on the binding
icon for the Setpoint Property.

9. Select the Tag button for our binding type.

©2019 Inductive Automation 213


Alarming

10. You will notice that there are two tabs available, UDT and Tags. Select
UDT to see the list of selectable items in the UDT.

11. Select the HighSP Tag and click the Back link just above. This means for
each instance of the UDT, the alarm will be bound to the corresponding
HighSP tag in that instance.

12. Click Commit in the lower right to save the alarm.

13. Click OK to save the new alarm configuration in the UDT.

Take a look at the Tag Browser and every instance of a motor will
automatically have the alarm configured on the AMPS Tag.

Associated Data
Sometimes you might want to have more data than just your alarm
setpoints and values when an alarm goes off. Ignition alarms can carry any
extra data you may want as Associated Data. Associated Data is like custom
properties on Vision components; each alarm can have as many Associated
Data Properties as you want, and these properties can be bound.
For example, if your Motor Amps goes into its high alarm state, you might
want to know what the HOA value was when the alarm happened. Instead of
having to check Tag history and hope the value was recorded, you can add
the HOA value directly to the alarm.

214 ©2019 Inductive Automation


Alarming

1. Double-click on the Motor UDT in the Data Types folder to edit the UDT.

2. Click on the AMPS Tag.

3. Scroll down to the Alarms property, and click the Edit icon to edit our
alarm.

4. Select Amps High Alarm.

5. At the top of the alarm property list, click on the Add icon. This adds a
new Associated Data property to the bottom of the list.

6. Scroll down to the New Data property and double-click it to edit the
name. Set it to HOA.

7. Click on the binding icon on the right.

8. Select the Tag button, and the UDT tab to select one of the UDT
members.

9. Select the HOA tag.

©2019 Inductive Automation 215


Alarming

10. Click the Back link at the top left, then click the Commit button, then the
OK button in the lower right to save.
Now any new Motor alarms will check the HOA value when they go active or
cleared, and they will hold onto the additional data as long as they are in the
system.

216 ©2019 Inductive Automation


Chapter 14

Alarm History

So far, we have been working only with the Alarm Status Table, which is
showing us a live list of the alarms our Gateway is storing in memory.
However, this system does not keep track of information forever -- if we
want to keep a persistent record of Alarm events, we'll need to set up an
Alarm Journal.

View Alarming History


1. Login and go to the Config tab of the Gateway Webpage.

2. Select Alarming > Journal from the menu.

©2019 Inductive Automation 217


Alarm History

Here we can create a new profile to log alarms to the database.

3. Click on Create new Alarm Journal Profile....

New Alarm Journal Profile window is displayed.

4. Set the profile name and the database connection as the following:

Name: Journal
Database: MSSQL

You can also specify filters and enable data pruning to delete records
older than a certain time period.

218 ©2019 Inductive Automation


5. Click Create New Alarm Journal Profile to save the profile.

The next time the alarm occurs, Ignition will create two tables in our
database (alarm_events and alarm_event_data) and starts logging alarm
history. Ignition also has a built-in component that is highly customizable
to fit your needs called Alarm Journal Table.
6. Drag in the Alarm Journal Table from the Alarming tab of the Component
Palette into our Alarm Testing window.

If any alarms have changed states since the journal was created, right
away you will see the history of all of your alarms.

©2019 Inductive Automation 219


Alarm History

Just like the Alarm Status component you can show/hide columns,
rearrange columns, and select an alarm to view more information about
the alarm.

The Alarm Journal table will default to showing the last 8 hours of alarm
events, and it will only update when the window is first opened. Rather
than using this default behavior, we'll make the date range user-
selectable.

7. Drag in the Date Range component from the Calendar tab of the
Component Palette and put it above the alarm journal table.

220 ©2019 Inductive Automation


Alarm History

Now, we need to link the alarm journal table to the date range
component.

8. Select the alarm journal component and bind the Start Date property to
the date range's start date property.

9. Click OK to save the binding.

10. Do the same thing for the End Date property, binding it to the End Date
of the Date Range component.

11. Click OK to save the binding.

Now you can change the start and end date to view all of the events in the
time period.

If you have more than one journal profile added to Ignition, you can set
the Journal Name to the name of the profile you want to query.

Focus on a Specific Alarm or Search an Alarm


There are two extra features the alarm journal table provides you: focus on
alarms and searching.
The focus feature is very handy. Typically, you are seeing history for a bunch
of alarms. The focus feature allows you to focus in on a specific alarm to just
view the history for that alarm.

©2019 Inductive Automation 221


Alarm History

To use it in the runtime, simply click on the Focus icon in the bottom
right and select Target Alarm Source.

Now you will only see those alarms.

When you are done, simply click the Focus icon again to remove the
focus.
Also, the operator in the runtime can search for specific alarms using the
Filter icon in the bottom right. When you click it, a dialog pops up with
the search options.

222 ©2019 Inductive Automation


Alarm History

Alarm Status Table - Journal Entries


Once you have an Alarm Journal profile configured and the Tag is stored in
the historian, you can click the Graph icon on the Alarm Status Table to
view the trend with markers for when the alarm became active, cleared, and
acknowledged.

©2019 Inductive Automation 223


Alarm History

224 ©2019 Inductive Automation


Chapter 15

Alarm Notification

Alarm Notification Overview


Alarm notification is the act of sending a message to a group of people when
an alarm becomes active or clear. In Ignition, this functionality is enabled by
having the Alarm Notification Module installed. You can also add the Voice
and SMS notification modules for additional ways to notify users.

Alarm Notification Profiles


A notification profile defines a delivery channel through which an alarm
notification message may be sent to a user. The Alarm Notification Module
comes with one-way and two-way email notification profiles.
The one-way email notification profile simply sends an email containing the
alarm notification message. The two-way email notification profile sends an
email that contains links that allow that user to acknowledge the alarm(s).
Additional modules may be added to Ignition to enable more ways to send
alarm notification messages. The Phone Notification Module adds the ability
to notify users by calling them on the phone. The SMS Notification Module
adds the ability to send text messages to users to notify them of alarms.

©2019 Inductive Automation 225


Alarm Notification

Schedules
The alarm notification system in Ignition uses the built-in user scheduling
system. Alarm notification messages will only be sent to users whose
schedule is currently active. When an alarm notification message reaches a
notification block in a pipeline, that block's on-call roster will be used to find
the users to notify. Of the users in the roster, only those users whose
schedule is currently active will receive the alarm notification message.

On-Call Rosters
An on-call roster is an ordered grouping of users. These are used as a way
to group users together so that alarms can be sent out. Depending on the
alarm notification profile used, the users may be notified one at a time
(sequential), or all at once (parallel). You can create and manage on-call
rosters from the Gateway configuration page or a component.

Alarm Notification Pipelines


These pipelines define the logic of what should happen between an alarm
becoming active (or acknowledged or clear) and people being notified.
Pipelines are configured in the Designer.

Alarm Notification - User Information


The first part of our alarm notification system we'll work on is our users. We
need to give users contact details, so that when we link them into our
notification scheme, Ignition will know how to reach them.
Relevant user settings are stored in authentication profiles in Ignition.

Edit the User Authentication Profile in the Gateway


1. Login and go to the Config tab of the Gateway Webpage.

2. Select Security > Users, Roles from the menu.

The User Sources page is displayed.

Here we can either edit the profile that comes with Ignition, called
default, or add a new authentication profile. Let's just use the default
profile that comes with Ignition.

3. Click on the manage users button to the right of the default


authentication profile.

226 ©2019 Inductive Automation


4. Find the admin user and click Edit on the right side.

5. Click Add Contact Info at the bottom of the page, choose a type of E-
mail and a value of [email protected].

6. Click Save on the right, then click Save Changes at the bottom of the
page.

©2019 Inductive Automation 227


Alarm Notification

Alarm Notification — On-Call Rosters


An on-call roster is an ordered grouping of users. These are used as a way
to group users together so that alarms can be sent out to them. Depending
on the alarm notification profile used, the users may be notified one at a
time (sequential), or all at once (parallel). You can create and manage on-
call rosters from the Gateway configuration page.
You want to create a different On-Call Roster for each group of people that
receive alarms. Typically customers create groups for Managers or
Operators or create groups by area of the plant. There is no limit on the
number of rosters you can create.
Rosters can be configured in the Ignition Gateway configuration and in the
runtime.

Create On-Call Rosters in the Gateway


1. Go to the Config tab of the Gateway Webpage.

2. Select Alarming > On-Call Rosters from the menu.

3. Click on the Create new On-Call Roster….

228 ©2019 Inductive Automation


Alarm Notification

4. Set the name to User Group 1.

5. Click Create New On-Call Roster.

Now you need to add users to the roster.

6. Click on the manage link to the right of the roster.

©2019 Inductive Automation 229


Alarm Notification

You can add users from any authentication profile, and rosters can be
made up of users from multiple profiles.

7. Select the default profile from the drop-down list.

8. Select the admin user and click the right-arrow to move it to the On-Call
Roster. Click Save.

You will notice the Email icon to the right of the users. That lets you
know what contact information the user has.

230 ©2019 Inductive Automation


Alarm Notification

Alarm Notification — Email Notification


To send out email notifications, we need to add an email notification profile
to Ignition.

Add an Email Notification Profile


1. On the Config tab of the Gateway Webpage, select Alarming >
Notification from the menu.

2. To add a profile, click on the Create new Alarm Notification Profile…


link.

3. Choose the Email Notification option and click Next.

You may have several options available here, they are dependent on what
modules you have installed.

©2019 Inductive Automation 231


Alarm Notification

To send out email notifications, you have to specify an SMTP server that
Ignition can use. You can use your company's server or any public SMTP
server like Gmail or Yahoo.

You can also specify an email server in the Networking section of the
Gateway. If you do, you would select Use SMTP Profile? here.

4. Inside the Email Notification profile, configure the following settings:

Name: Email
Hostname: localhost
Two-way Enabled: True
Gateway (under Two-way settings): localhost:8088

The two-way settings allow users receiving the e-mail notifications to


acknowledge the alarm from the notification. When using this
functionality, it's important to make sure that the Gateway property is set
to a domain or IP address that can be reached from wherever the alarm
notifications are being sent.

232 ©2019 Inductive Automation


Alarm Notification

©2019 Inductive Automation 233


Alarm Notification

5. Click Create New Alarm Notification Profile to add.

That's it! You can now use the profile in notification pipelines.

Alarm Notification - Pipelines


Now that we have configured our user contact information, rosters and
alarm notification profiles, we can create a pipeline to bring everything
together.
Pipelines are a graphical mechanism for building up logic, providing an easy
to use drag and drop mechanism for creating complex notification scenarios.
Using pipelines, it is possible to accomplish many tasks, such as alarm
escalation, notification consolidation, and conditional dispatch.
When you create a new pipeline or select one to edit, the Designer switches
to the pipeline workspace. The workspace is effectively a blank canvas,
upon which you arrange and connect various pipeline blocks. Each pipeline
block has an input and potentially has outputs. Using the mouse, you can
draw connectors between the output of one block into the input of another.
The starting block is the only fixed part of the workspace. It represents the
entry point for alarm events into the pipeline and is treated like an output
block.
Multiple outputs can be connected to a single input. Also, it is perfectly
acceptable to write the output of a downstream block back to the input of an
earlier block, creating a loop. Of course, some care should be taken when
doing this, as it can easily result in unexpected behavior, like sending out
many emails for one event!

234 ©2019 Inductive Automation


Alarm Notification

Pipeline Blocks
Blocks are described individually in the next section, but here is a brief
overview.

• Notification delivers a notification through the selected Notification


Profile.

• Delay blocks the alarm event for the specified amount of time.

• Splitter forwards a single event concurrently to multiple other blocks.

• Switch evaluates a non-boolean expression and forwards to an output


based on the result.

• Expression evaluates an expression that results in either true or false,


and forwards the event to that output.

• Set Property evaluates an expression and sets the result as a runtime


property on the alarm event.

• Jump forwards the alarm event to a different pipeline.

• Script executes a task outside the pipeline.

Pipeline Properties
The pipelines have very few settings but they are important. You can see
and modify the settings in the Pipeline Block Editor when you click anywhere
in the pipeline workspace that isn't a block.

©2019 Inductive Automation 235


Alarm Notification

• Dropout Condition
There are three possible conditions: Acknowledged, Cleared, and
Shelved. These dictate when alarms fall out of the pipeline. If any of the
selected conditions become true for an event in a pipeline, it will "drop
out" entirely, no matter where it is at. No further action will be taken for
that event.

• Pipeline Enabled
The Enabled setting specifies whether or not the pipeline is allowed to
receive events.

Event Flow
Understanding how events flow through pipelines is crucial to leveraging
them fully. Alarms are configured on individual Tags, and each alarm can
specify a target pipeline for active, clear or acknowledge conditions. When
the condition for that alarm is met a new alarm event is generated and sent
to the entry point of the associated pipeline. The alarm event then moves
through the different logical elements of the pipeline until it finally reaches a
pipeline endpoint, or until the alarm matches the pipeline's dropout
condition, upon which it then exits the pipeline. There can be multiple alarm
events in a pipeline at any given point in time and you can view the current
status of the pipeline from the Alarm Pipelines status screen in the Ignition
Gateway. It is possible to forward events from one pipeline to another,
making it possible to create multipurpose and reusable pipelines.
Each alarm event progresses sequentially through the blocks of a pipeline.
However, multiple alarm events can exist in parallel in the pipeline, and new
events may enter the pipeline at any time. Some block settings may result
in alarm events being held up, such as consolidated notification, but one
alarm event cannot affect other events in the pipeline. In this particular
case, when multiple events will be collected together for notification, the
events that don't drop out of the pipeline after notification are individually
forwarded to the output of the block.
At every transition, and occasionally inside of the block execution as well,
the dropout conditions will be evaluated. If the event no longer meets the
conditions, it will drop out of the pipeline. It is crucial to understand how this
works in order to understand pipeline execution. For example, a common
scenario is to place a Delay block directly in front of a Notification block. If
the delay is 5 minutes and "Clear" is one of the pipeline drop out conditions,
it effectively means that only events that stay active for longer than 5
minutes will actually result in notifications. If acknowledge is one of the

236 ©2019 Inductive Automation


Alarm Notification

dropout conditions, it would mean that operators (or anyone viewing alarm
status) would have five minutes to acknowledge them, and only then would
notifications be sent.

Create a Simple Email Notification Pipeline


1. Go back to the Ignition Designer.

Here you can create one or more pipelines. Let's create a simple pipeline
to send out email notifications when alarms occur.

2. In the Project Browser, right-click on the Alarm Pipelines folder and


select New Alarm Pipeline.

3. Name the pipeline “Basic Pipeline” and click Create Pipeline.

4. Drag a Notification block into the pipeline.

This block actually notifies an on-call roster via a notification profile when
an alarm event enters the block.

5. Drag the output pin from the Start block to the IN of the Notification
block.

©2019 Inductive Automation 237


Alarm Notification

We are almost done. Now we need to set what alarm notification profile
the block is going to use and who we are going to send the notifications
to.

6. Click on the Notification block.

7. In the Pipeline Block Editor, under the Notification tab, set the
notification block to use the Email Notification profile.

Additionally, you can set the from address, subject, and message for the
email.

238 ©2019 Inductive Automation


Alarm Notification

8. Select the Contacts tab and select the roster name you want to notify. In
our case, we’ll use User Group 1. You can select a roster directly, or
create an expression that returns a roster name. You can also use a
Calculated Roster, which allows you to write a Python script to indicate
who to notify. This third approach can be used without any On-Call
Rosters configured.

Note: You must first Save your project in the Designer to make the
pipeline work.

Our basic pipeline is now done. When an alarm occurs, Ignition will send
an e-mail to everyone in the User Group 1 roster.

©2019 Inductive Automation 239


Alarm Notification

Our finished pipeline looks like this:

Right now this pipeline is not being used.

The last step is to specify which alarms are going to use this pipeline
when they become active. For that we just need to edit the alarms we
configured on the Tags already.

9. Edit the WriteableBoolean1 alarm Tag.

10. Enter the alarm configuration interface for the Tag, and find the Active
Pipeline property.

11. Set the Active Pipeline property to the Basic Pipeline pipeline we just
created.

12. Click OK to save, then save the project.

Now when the WriteableBoolean1 alarm becomes active, it will go into the
START block of the pipeline.

240 ©2019 Inductive Automation


Alarm Notification

13. Because we don't have a working SMTP server set up already, we'll use a
program to "catch" the e-mails Ignition is sending. From the Windows
Start Menu, find and open the Papercut application.

14. With Papercut open, try toggling the WriteableBoolean1 Tag on. You
should see an e-mail coming through into Papercut, complete with the
configured message and acknowledgment link.

15. If you want to see the status of a pipeline, go to the Status tab of the
Ignition Gateway. Click on the Alarm Pipelines link on the left side.

16. You will see a list of your pipelines. Click the Details button for more
information. If nothing is active the list is empty.

©2019 Inductive Automation 241


Alarm Notification

17. Trigger the WriteableBoolean1 alarm, and you will see exactly where
the alarm is in the pipeline.

Alarm Notification - Escalation Pipeline


Pipelines can have a pretty complex logic to loop and to escalate alarms
when they are not being taken care of. Let's create a pipeline that will call
users three times, and if nobody acknowledges the alarm, it gets escalated
to another roster.

Create an Escalation Pipeline


1. In the Designer, we will create a new pipeline called Complex Pipeline.

242 ©2019 Inductive Automation


Alarm Notification

2. First we need to introduce a counter to keep track of how many times we


have called our users. Drag in the Set Property block to the pipeline
window.

This block creates a variable that is scoped to that pipeline only.

3. Connect the START to the IN of the Set Property block.

4. In the Pipeline Block Editor, set Property Name to numCalls and


initialize the Property Value to 0 .

Note that the Set Property block has a Scope setting. A setting of local will
limit the variable's scope to be for the current run of the pipeline, while a
setting of global will make the variable's value persist across all alarm
events coming through the pipeline.

Now we can notify our users.

5. Drag a Notification Block into the pipeline.

6. Set the block to use the Email Notification profile and set the roster to
User Group 1.

7. Connect the OUT of the Set Property block to the IN of the Notification
block.

©2019 Inductive Automation 243


Alarm Notification

If no one acknowledges the alarm, the alarm will reach the output pin of
the notification block. If nothing is connected to the OUT, the pipeline
drops out. We don't want that to happen. Instead, we'd like to wait a few
minutes for the users to respond to the notification, and then either notify
them again, or escalate the alarm.

8. Drag a Delay block into the pipeline, and connect the OUT of the
Notification block to the IN of the Delay block. Set the delay value to 300
seconds (5 minutes). If our users respond to the e-mail within the 5
minute interval, no further action will be taken.

9. Given that the delay block's time has passed, we want to increment our
counter, then decide whether to notify again. Drag in another Set
Property block and connect the OUT of the Delay block to the IN of the
Set Property block.

Note: You can flip the orientation of IN and OUT by right-clicking the
block.

10. In the Pipeline Block Editor, set Property Name to numCalls again.
11. This time, set the Property Value (expression) to the previous value plus
one as:
{numCalls} + 1

244 ©2019 Inductive Automation


Alarm Notification

Now we need to check to see how many times we will loop through this
pipeline. We will use an expression to check if the value is less than 3.

12. Drag in an Expression block into the pipeline.

13. In the Pipeline Block Editor, set the expression to {numCalls} < 3

The expression block will send the signal to the TRUE pin when the
expression is true and FALSE when it is false.

14. Connect the OUT of the last Set Property block to the IN of the Expression
block.

Tip: You can right-click on the block to reverse the orientation of the IN/
OUT pins of a block.

So if the number of calls is less than three, we need to notify again.

©2019 Inductive Automation 245


Alarm Notification

15. Connect the TRUE pin of the Expression block to the IN of the Notification
block.

Lastly, if the number of calls is equal to 3, we need to escalate to another


pipeline. This other pipeline could email managers, or make phone calls,
or anything else the pipelines are capable of.

16. Drag in a Jump block and set it to use the Basic Pipeline.

17. Connect the FALSE pin of the Expression block to the IN of the Jump
block.

That’s all we need to set up our pipeline.

246 ©2019 Inductive Automation


Chapter 16

Security

Ignition uses a role-based security scheme to lock down gateway and


project resources. In effect, this means that users within Ignition are
assigned roles, and their ability to access resources is dependent on the
roles they are assigned. This abstraction allows users to be reassigned,
removed, and added without affecting the logic of the security policy.
The users and their roles are defined in authentication profiles. An Ignition
Gateway can have many different authentication profiles defined, each
governing the security of different aspects of Gateway. For example, logging
into the Gateway configuration web interface might be governed by one
authentication profile, while another profile governs the security for a
project.

©2019 Inductive Automation 247


Security

Authentication Types
The following are the different types of an authentication profile:
• Internal Authentication Profile
• Database Authentication Profile
• Active Directory Authentication Profile
• AD / Internal Authentication Profile
• AD / Database Authentication Profile

Security Policies
Security policies can be defined for many different parts of the system. For
example:
• You can alter the roles required to log into the Gateway configuration
section or the Designer.
• You can define roles the users must have in order to login to the Client.
• You can define roles required to write to or even read from a Tag.
• You can define roles required to view a Component, Container, or
Window.
• You can access the security system in a script to restrict the operation of
the script to authorized users.

Enabling SSL Encryption


To enhance security in Ignition, you may decide to enable Secure Sockets
Layer (SSL) encryption. This will affect all communications to and from the
Gateway that is done over the HTTP protocol. This includes not only
browsers interacting with the Gateway's web interface, but all Vision Client
communications as well.
Turning on SSL will encrypt all data sent over HTTP. This protects your
installation from any one "snooping" the data as it passes over the network.
This may be important if data transferred between Gateway and Clients is
sensitive in nature. This also helps to prevent a security vulnerability known
as "session hijacking."

Basic Security Setup


Ignition's security is all role-based security, and the requisite usernames,
and passwords, and roles all come from an authentication profile.
By default, Ignition comes with an authentication profile called "default". It
contains the admin/password user that you use for the Gateway
configuration and Designer. You can create as many profiles as you would
like.

248 ©2019 Inductive Automation


Security

Change the Default Profile


Let's just change the default profile by adding more roles and users.

1. Log into the Ignition Gateway configuration page.

2. Under the Configure section of the Gateway Webpage, select Security >
Users, Roles.

3. Click manage users to edit the default profile.

Add a New Role


Let's add a new role called "Operator".

1. Click on the Roles tab and click the Add Role... link.

©2019 Inductive Automation 249


Security

2. Set the role name to Operator.

3. Click the Add Role button.

250 ©2019 Inductive Automation


Security

Adding New Users


Now, we’ll create a user called oper.

1. On the Users tab, click Add User.

2. On the Add User window, set the following

Username: oper
password: password
Roles: check the Operator box

3. Click the Add User button.

©2019 Inductive Automation 251


Security

4. Finally, we’ll add a "guest" user with no roles. Click on the Users tab and
click the Add User link.

5. On the Add User window, set the following:

Username: guest
password: password
Roles: Leave both role boxes unchecked.

252 ©2019 Inductive Automation


Security

6. Click the Add User button.

Component Security
Now that we have some users to work with, let’s configure some security on
a window.

1. Go back to the Ignition Designer.

2. Open the Empty window, which came pre-created in our Project


Template.

3. Add four Multi-State buttons to the window from the Buttons tab. Any
other input component will do just as well.

©2019 Inductive Automation 253


Security

4. Right-click on one of the buttons and select Security.

A new Security Settings panel is displayed.

5. Uncheck Inherit Permissions to apply our own security.

6. In the dialog, you can choose which restrictions to place on the


component if the role requirement below is not met. Leave Disable and
Disable Events checked.

7. In the Exempt Role section, check the Administrator role to grant


clearance to that role.

The user must have the Administrator role in order to use the Button.

254 ©2019 Inductive Automation


Security

A Security icon is displayed next to the component indicating that the


security is set up.

Now the component will be disabled if the user does not have the
Administrator role.

8. Now configure security restrictions on the other three Multi-State buttons


as follows:

Button 2 - Hide - Operator


Button 3 - Access Denied Overlay - Administrator and Operator
Button 4 - Inherit Permissions (configure nothing)

©2019 Inductive Automation 255


Security

9. Save the project and launch the Client to test it out.

If the user doesn't have the Administrator role the first Button is disabled.
Try Switching users to one that doesn’t have the role. It's also worth
noting that only Operators will be able to see the second button --
Administrators will not. The Administrator role is no more powerful than
the Operator role, except in ways we explicitly configure.

Finally, signing in as a guest user will yield the Access Denied Overlay on
the third button, since the guest user has neither of the required roles. If
the guest had either of the roles, it would be able to access the resource.

Putting Security on a Window


You can also put security on windows and containers. If you put security on
containers, it will apply to all of the children inside of the container.
Containers can be a great way to lock down multiple components without
having to set up security on each one.
Let's put security on our History window.

256 ©2019 Inductive Automation


Security

1. Right-click on the History window and select Security.

2. Here you will notice the only restriction is Do Not Open. If we check "Do
Not Open" and the "Administrator" checkbox, only Administrators will be
able to access the window.

©2019 Inductive Automation 257


Security

3. Select File > Save.

4. Try it out in the Client. When you don't have privileges you get this
message:

Applying Security on the Whole Project


Another place to apply security is on the project as a whole.

1. Under Project > Properties in Designer, you can set the properties so
that the project requires certain roles to even allow login:

2. In the Project Properties window, select Project > General and you will
see a Required Roles setting.

3. Set the Required Roles setting to Administrator, Operator. Now you


must have either the Administrator or Operator role in order to log into
the runtime.

258 ©2019 Inductive Automation


Security

Gateway Security
The final place security is used is on the Ignition Gateway itself. In the
Ignition Gateway Config tab, there are settings under Config > Gateway
Settings that affect how people can log into the various pages of the
Gateway webpage, as well as the Designer.
One authentication profile controls access to all of these areas. By default,
the authentication profile called "default" is used.

If you were to change the Home Page Role(s) to Administrator, it would


force users to log in to view the Gateway homepage.

©2019 Inductive Automation 259


Security

Configuring SSL/TLS
By default, all requests made of the Ignition Gateway webpage (including
connections from clients and sessions) are unencrypted, meaning that
anyone with access to the Gateway’s network can eavesdrop on the
connection. For cloud-hosted Gateways, this can constitute a very serious
security vulnerability. Configuring connections to use the Gateway’s SSL
port encrypts this traffic and prevents third parties from listening in.
The Gateway is already configured to use SSL, but only on a different port
than the one we’ve been working with, the SSL port (which defaults to
8043). From Config > Networking > Web Server, it is possible to change
this port. There is also a Force Secure Redirect option, which pushes all
traffic hitting the Gateway Web Server to the SSL port, including requests
against the Gateway webpage, as well as requests made by clients and
sessions.
When using SSL, particularly on a publicly accessible Gateway, it is
worthwhile to import your own SSL certificate, available from a third party
Certificate Authority (CA for short). The built-in SSL certificate is self-
signed, which means that browsers accessing the Gateway webpage will not
trust it. Finding the SSL/TLS Certificate property on the Web Server page,
and clicking View Details, will provide a guided interface for viewing the
current certificate, and creating and importing your own.

260 ©2019 Inductive Automation


Security

Security Zones
A security zone is a group of gateways, computers, or IP addresses that
share unified security settings. Though Ignition relies heavily on a role-
based security model, it is possible to configure some high-level security
restrictions based on security zone, thereby controlling access based on
where a given resource request is coming from, rather than what user is
requesting it.
Security zones can be configured from Config > Security > Security
Zones on the Gateway webpage. From there, just click Create new
Security Zone…, give the security zone a name, and add IP addresses,
host names, and/or gateway names that should be matched on the zone.

©2019 Inductive Automation 261


Security

Any connections that don’t match any security zones will be dropped into
the Default zone.
To configure security by zone, navigate to Config > Security > Service
Security. From this page, you can configure a policy for each zone,
restricting Alarm, Historical Provider, and Tag access.

262 ©2019 Inductive Automation


Chapter 17

Popup Windows

In previous chapters, we created a template to show Tag data for our


motors. Further, we made the template dynamic, so that it could look at
data for any single motor, as opposed to being tied to a single one. In this
chapter, we'll explore a similar task, using a Popup window to dynamically
show more detailed information for a given motor.

Creating a Popup Window


In this exercise, we'll be configuring a Parametrized Popup window. That is,
a popup window that takes a parameter, and uses that parameter to decide
which of our items (areas, stations, motors, etc.) we want to show data for.
This approach, notably, will eliminate the need to create a new popup
window for each motor.

©2019 Inductive Automation 263


Popup Windows

Create a Detailed Motor Popup Window


1. In the Project Browser, expand the Windows/Popups folder and right-click
the Popup window. Select the Duplicate option.

2. Right-click on the new Popup (1) window and select Rename.

3. Give the new window a name of Motor Details, and hit enter.

4. With the window selected, set the Layer property to 1.

5. Edit the Header Label component to say Motor Details.

It’s important to know that when you pass a parameter into a window, the
value is passed into the custom properties of the destination window’s
Root Container. For example, if you pass a string parameter called
MotorName into a popup window, the popup window must have a string
property called MotorName as a custom property in its Root Container.
The Root Container is where Ignition places all pass-through parameters.

6. Right-click on the Root Container of the window and select


Customizers> Custom Properties.

264 ©2019 Inductive Automation


Popup Windows

7. In the Custom Properties window, click the Add icon to add a new
custom property.

8. Specify MotorName as the Name of the property and String as the


Type.

9. Click OK.

Now the MotorName is a custom property that appears in the window’s


Root Container.

©2019 Inductive Automation 265


Popup Windows

Note: Never bind the custom property on the popup window, because we
will pass in the value to it. If it’s bound, it will override the value passed
in.

10. Drag the Motor template into the window.

The Motor template is a good starting point for showing detailed


information about the Motor. Note that we need to bind the UDT
parameter that the template is expecting.

11. Click the binding icon on the MotorData property of the Motor
template. We need to bind the template to the correct Motor UDT
instance based on the MotorName parameter that the window is
passed. We can make use of an Indirect Tag binding to find the right
motor.

266 ©2019 Inductive Automation


Popup Windows

12. Select Indirect Tag from the Binding menu. The first part of configuring
the binding will be to select a sample motor Tag. After that, we'll make a
single part of the Tag path dynamic, as our structure requires.

13. On the right-hand side of the Indirect Tag interface, click the Tag icon.

14. Expand the Tags folder, then the Motors folder within. Select Motor 1
from within the folder, then click OK.

15. The only thing left to do is dynamically replace "Motor 1" in the Tag path
with the MotorName parameter passed into the Popup window.

16. Delete "Motor 1" from the Tag path, but leave the rest of the path
(including the "/"). Then with your cursor still located where the "Motor 1"
text was, click the Insert Property icon on the right-hand side. In the
Property tree, expand the Root Container, select the new MotorName
property, and click OK

You will see a {1} entered in the Indirect Tag Path, and a new entry in the
References table.

©2019 Inductive Automation 267


Popup Windows

17. Select the Bidirectional check box to allow writing back to the Tag and
click OK.

18. Drag a Numeric Text field from the Input tab of the Component Palette
below the template.

268 ©2019 Inductive Automation


Popup Windows

19. In addition to the data in our template, we want to provide a way to view
and control the High Setpoint Tag we configured in our UDT. Drag a Label
from the Display tab next to the Numeric Text Field.

20. Set the Text property to Amps High SP.

21. Select the Numeric Text Field component. In the Property Editor, set the
Number Type property to Float.

©2019 Inductive Automation 269


Popup Windows

22. Now we can bind the value of the HighSP component using an Indirect
Tag Binding just like the Motor template. Click on the binding icon for
the Value (Float) property.

23. Select Indirect Tag from the Binding menu.

24. On the right-hand side of the Indirect Tag interface, click the Tag icon.
Expand the Tags folder, then the Motors folder within.

25. Select the HighSP Tag from the Motor 1 UDT, then click OK.

26. Now replace the "Motor 1" text in the Tag path with the MotorName
parameter passed into the Popup window. Delete "Motor 1" from the Tag
path, but leave the rest of the path (including the two "/" characters).

27. Then with your cursor still located where the "Motor 1" text was, click the
Insert Property icon on the right-hand side.

270 ©2019 Inductive Automation


Popup Windows

28. In the Property tree, expand the Root Container, select the new
MotorName property, and click OK.

29. Select the Bidirectional check box to allow writing back to the Tag and
click OK.

30. Finally for our HOA button in the Motor template, we’ll add security, so
only Operators can make changes to a Motor’s HOA value. To do this, we
need to go back to the Motor Template definition. Double-click on the
Motor Template to open it.

31. Right-click on the Multi-State Button and select Security. Uncheck


Inherit Permissions, and make sure that Disable and Disable events
are checked under Restrictions. Under Exempt Roles, check the Operator
role to prevent our restrictions from applying to users with the role.

©2019 Inductive Automation 271


Popup Windows

32. You can also add the same restrictions to the Amps HighSP’s Numeric
Text Field on the Motor Details Popup, so only Operators can modify
setpoints.

33. We'd like to open the Popup window when a user clicks on a Motor
template. Open up the Motor template again.

34. To make it so the user must click on the image of a motor, we will add our
open popup script to the image. Right-click on Union component that is
tinting the motor and select Scripting....

35. In the Component Scripting [Motor] window, select mouseReleased


from the Event Handlers tree menu.

272 ©2019 Inductive Automation


Popup Windows

36. Choose the Navigation tab.

37. Select the Open/Swap radio button, make sure Open radio button and
the and Center checkbox are both selected.

38. From the Window drop-down menu, choose Popups/Motor Details.

39. Check the Pass Parameters box to pass in the required MotorName
parameter to the Popup window.

40. Click the Add icon on the right to add a new parameter.

41. The Parameter Name entry is a dropdown menu. Select the


MotorName from the dropdown list.

Note: The name must exactly match the parameter we added to the Root
Container of the popup window.

42. Next, we need to configure what value should be passed. We've opted to
use a MotorName parameter (as opposed to, say, a MotorNum
parameter) for a simple reason: the MotorName is already an exposed
property in our template.

With the parameter row selected, click the Insert Property icon on
the right-hand side.

In the property tree, find the MotorData parameter for the template, and
expand it. Inside, find and expand the Meta folder. This folder was created
automatically, and has some basic information about the UDT instance.
Select the TagName property, and click OK.

©2019 Inductive Automation 273


Popup Windows

43. Click OK in the Component Scripting interface.

That's it! Ignition now passes in the MotorName value to the popup
window when the user clicks on the appropriate motor from the overview
window.

Save your project and try it out in the client.

Opening Multiple Instances of a Popup Window


By default you can only have one instance of the Popup window opened at a
time. If the window is already open, Ignition will re-open it with a different
parameter. If you want to be able to open multiple instances at once, you
can simply change the script.

Opening Multiple Instances of a Popup Window


1. Go back to the Motor Template, right-click on right-click on Union
component that is tinting the motor and select Scripting....

2. Click the mouseReleased event.

274 ©2019 Inductive Automation


Popup Windows

3. To change the script to open a new instance of the window rather than
just opening the window, simply click the Additional Instance
checkbox.

Also, we should turn off the "and Center" checkbox so it leaves the open
instances alone.

You can now open the popup windows side by side.

©2019 Inductive Automation 275


Popup Windows

Creating an Indirect Easy Chart


Our popup window is working well. However, it would be nice to show some
historical data related to our Motor in a graph on the Popup window. Since
we only have one popup window, we have to make the graph indirectly point
to the correct history that corresponds to the previously selected motor.

Making the Indirect Easy Chart


Let’s add an indirect Easy Chart to the popup window.

1. Go back to the Motor Details window and make it bigger to allow room
for the graph.

2. Find the Easy Chart in the Charts section of the Component Palette, and
drag it into the window.

3. We’ll start by adding a couple Tag pens to the graph. In the Tag Browser,
find Motor 1’s AMPS Tag, and drag it onto the chart. Do the same for
Motor 1’s HOA Tag and Motor 1’s HighSP Tag.

276 ©2019 Inductive Automation


Popup Windows

4. In the Property Editor on the Easy Chart, set the chart mode to
Realtime.

We have three pens in our chart, an AMPS Tag, an HOA Tag, and a
HighSP Tag. However, the way they're being displayed isn't very useful.
The HOA Tag can be 0, 1, or 2, while the AMPS and HighSP Tags can be
potentially a very large, analog number. In order to display this data
meaningfully in the same easy chart, we'll have to break our Tag pens
into separate subplots.

5. Right-click on the Easy Chart, expand Customizers, and select Easy


Chart Customizer.

6. We'll start by adding a subplot for our HOA pen to use. Select the
Subplots tab, and click the Add icon to add a subplot.

7. Set the Relative Weight of Plot 1 to 3, while leaving the weight of Plot 2 at
1. This will make the AMPS subplot three times the size of the HOA
subplot.

©2019 Inductive Automation 277


Popup Windows

8. Next, we'll add an Axis for our HOA pen to use. Select the Axes tab, and
click the Add icon to add an axis.

9. The HOA value can be 0, 1, or 2, but displaying these numbers on the


axis might confuse our operators. What we would like is a way to show
"Hand", "Off", and "Auto" in the axis instead. We'll configure our axis to
do this.

Specify the following properties on the axis:

Name: HOA
Label: HOA
Type: Symbol
Symbols/Grid Bands: "Off,Auto,Hand"

10. There's one more change we can make to the Axis. Since Auto Range is
enabled, the Axis range will be 0 to 2. However, if the HOA status is 0 or
2, it will be difficult to see the pen in the chart, because it will sit on the
top or bottom edge.

To give the pens a little bit of padding, uncheck Auto Range, and
configure the following bounds:
Lower Bound: -0.1
Upper Bound: 2.1

278 ©2019 Inductive Automation


Popup Windows

11. Click OK to create the Axis.

12. Finally, we have to configure the HOA Tag pen to use the subplot and axis
we've configured. Open the Pens tab, select the HOA Tag pen under Tag
History Pens, and click the Edit icon to modify the pen.

13. Set the axis to HOA and the subplot to 2. Click OK to commit the
changes to the pen.

©2019 Inductive Automation 279


Popup Windows

14. Click OK to commit the changes to the chart. You should now see the
pens in different subplots on your chart.

280 ©2019 Inductive Automation


Popup Windows

15. Now that we have the chart looking nice, we want to make it dynamic.
Scroll down to the bottom of the Property Editor for the Chart component.
There are five properties that store the chart configuration:
• DB Pens
• Tag Pens
• Calculated Pens
• Axes
• Subplots

All of these properties are datasets, which allow the full range of
configuration details to be stored for each pen, axis, or subplot.

Since we dragged Tag pens onto the chart, the Tag Pens dataset now
contains data:

16. Click on the Dataset View icon to the right of the Tag Pens property
to see the columns we can change.

17. To disable the ability for the user to add or remove historical Tags from
the Easy Chart during runtime, deselect the checkboxes in the last
column labeled USER_REMOVABLE.

©2019 Inductive Automation 281


Popup Windows

18. One of the columns is TAG_PATH. You will notice that each Tag_path has
the full path to the Tag like this: [~]Motors/Motor 1/Amps

We need to dynamically change the Tag path for each pen. The only
binding type that allows us to do that is the cell update binding.

19. Now, click on the binding icon to the right of Tag Pens and choose
the Cell Update binding type. This binding type is available to us because
we are on a Dataset property. Cell Update bindings allow us to bind
individual cells in a dataset to other properties.

20. Select the AMPS row’s TAG_PATH cell then click the Add Row icon to
add a row in the Cell Bindings table pointing at that cell. Selecting a cell
first means the Row and Column fields will be populated for us.

282 ©2019 Inductive Automation


Popup Windows

21. Select the row in Cell Bindings dataset, click on the Insert Property
icon, and select the MotorName property from the Root Container of the
window.

©2019 Inductive Automation 283


Popup Windows

Almost there! The Tag path can't just be the string Motor 1 or Motor 2.
It needs to be the full path to the appropriate historical Tag.

22. Double-click on the cell to append to the Value field. Add to both the
beginning and end of it so it looks like the following:
[~]Motors/{Root Container.MotorName}/AMPS

23. Click OK.

Now Ignition will dynamically update that one cell based on the
MotorName parameter. We only want to complete one cell first so it is
easy to find any mistakes if there is an error.

24. Now, open the binding again to do the same thing for the HighSP Tag.
Select the TAG_PATH cell for the HighSP Tag, and click the green Add
icon to add a row in the Cell Bindings table for that cell. Copy and paste
the Value field from the reference we've already configured, and change
the end of the reference, so it looks like:
[~]Motors/{Root Container.MotorName}/HighSP
25. Lastly, we'll do the HOA Tag. Select the TAG_PATH cell for the HOA Tag,
and click the Add icon to add a row in the Cell Bindings table for that
cell. Copy and paste the Value field from the reference we've already
configured, and change the end of the reference, so it looks like:
[~]Motors/{Root Container.MotorName}/HOA
That's it! You now have an indirect Easy Chart. Save the project and
launch a client to test it out. Open each motor popup and see the graph
change.

Creating a Dynamic Alarm Display


The last thing we’ll add to our Popup window is a display that will show
the live alarms for our specified motor. For this, we’ll make use of the
Alarm Status Table we’ve worked with in previous chapters.

284 ©2019 Inductive Automation


Popup Windows

Configuring the Alarm Status Table


1. Find the Alarm Status Table component in the Alarming section of the
Component Palette, and drag it into the popup window.

2. Before we add a filter to the Alarm Status Table, we want to make it look
nicer. Put the Designer in Preview Mode so we can modify the headers.

3. You can right-click on the header and select or de-select each column
until you have only what you need. Show these four columns:
Active Time
Display Path
Current State
Priority

4. By default, the Alarm Status table will show all alarms on our system. We
need to configure a filter that will only allow alarms for the current motor
to be shown. In the Property Editor for the Alarm Status Table, find the
Display Path Filter property, and click the binding icon.

5. We want to configure a Display Path Filter that will only match alarms for
the specified motor. The easiest approach is to filter out any alarms that
don’t have our MotorName somewhere in the Display Path. Select a
binding type of Expression, and use the Insert Property icon on the
right-hand side to pull the MotorName property into the expression.
Then, modify the expression to read:
"*" + {Root Container.MotorName} + " *"

©2019 Inductive Automation 285


Popup Windows

This expression is appending asterisk characters to the MotorName;


without these, we would have to match the source path exactly. Note also
that an extra space has been added before the second asterisk – this is to
prevent Motor 1 from showing Motor 10’s alarms.

6. Click OK to save the expression. You should now only see alarms for the
current motor in the Alarm Status table.

286 ©2019 Inductive Automation


Chapter 18

Scripting

Scripting offers a significant degree of flexibility and customization where


the standard available options fall short. There are two major scripting
languages in Ignition: Python and Expression Language.
Let’s now focus on Python in Ignition.

What Is Python?
Most of the time, when we talk about "scripting", we're talking about Python
scripting. Python is a general purpose programming language that was
developed in the early 90's and has gained significant popularity in the
2000's. We like it because it is extremely readable, elegant, powerful, and
easy to learn.
As an added bonus, it gracefully interacts with Java, giving programmers an
extremely powerful tool when paired with Ignition, which is written in Java.
Python or Jython? You'll often hear Python referred to as "Jython"" by
advanced users of Ignition. Python is the language, Jython is the
implementation of the language that we use.

©2019 Inductive Automation 287


Scripting

In scripting, there are three two techniques as follows:


• Creating and accessing variables
• Using control flow statements
two most common forms of control flow are if statements, and for loops.

Learning Python
Python is easy to learn because its syntax is intuitive and easy to read.

Hello World
We will start off with the example that most modern programming
languages start with; displaying the words "Hello World". To do this we need
an environment to write our code in. The script console allows you to create
code and execute it within the tool. You will find it in the Tools menu.

Once open, we want to add some code to the left side of the console. The
following script will print out "Hello World" to the output console on the
right.
print " Hello World"
The print keyword is a handy tool in Python, allowing you to put text into
the output console. This is useful for debugging your scripts. You can print
multiple things by separating them with commas.

288 ©2019 Inductive Automation


Scripting

Comments
Comments are notes that you can leave in your code. While not a specific
technique in Python, they can be very useful in describing what the code
does, and why you chose to write the code in the way you did. Many times
your comments will help you remember what the script does when you
haven't gone through it in a long time.
Create a comment by using the hash sign before your comment. After the
hash sign (#), everything afterwards will be a comment. The comment can
be on its own line or be at the end of an existing line of code.
# This is a comment
print "Testing" # This is also a comment

Where Is Python Used?


Python is used in many places in Ignition. The most apparent place, is in
component Event Handlers. Project event scripts and script modules are two
other major places where Python is used.

©2019 Inductive Automation 289


Scripting

Event Handlers
Event handling enables you to use scripting to respond to a wide variety of
events that components fire. This lets you configure windows that are very
interactive and are an important part of project design in Vision and
Perspective.
An event can be many things, such as a mouse click, a key press, or simply
a property changing. Whenever these events occur, a script can be called to
"handle" the event. Different components can fire different types of events.
Events are organized into event sets. For example, the mouse event set or
type includes mouseClicked, mousePressed, and mouseReleased. Many
times the events in an event set share the same properties for their event
object.

Vision Script Builders


When creating an event handler in Vision, you can use one of the handy
"script builders" instead of writing the script by hand. In the Component
Scripting window, the script builders are accessible as tabs along the top.
The last tab, Script Editor, lets you write an event handler by hand. You
can also use it to view the script that was generated by the script builder,
which is a good way to get started learning how to write event handlers by
hand.

Creating and Accessing Variables


You create variables by simply assigning a value to them. You don't need to
declare the variables, because Python has a dynamic-type system. That
means Python figures out the type of the variable on the fly, when the script
is executed.

290 ©2019 Inductive Automation


Scripting

Variables are created by simply assigning a value to them. Variables do not


need to be declared, because Python has a dynamic type system. That
means Python figures out the type of the variable quickly when the script is
executed.
Accessing a variable is just as simple as creating it. Simply use the name of
the variable where you want to use its value.
While the script console is a great place to test out a script, the downside is
it wont save our work on a reset of the designer, nor can it interact with
components on a window. So we can instead put a script on a component in
a window so that we can come back to it later. The easiest component to
add a script to is the Button. We can use the Button's action performed
event for our script, which is when the button gets pressed."

1. Create a new main window. Don't forget to add a new tab to your
navigation window so that it can be accessed from the client.

2. Add a Button component to the window. Right click and select Scripting to
open up component scripting.

3. Select the actionPerformed event handler and switch over to the Script
Editor tab.

©2019 Inductive Automation 291


Scripting

4. Add the following script:


var=6
print var

var="abc"
print var

The above code will print out "6" and "abc" to the console when the
button is pressed.

5. Click OK to save the script.

6. Try it out by putting the Designer into Preview mode and then clicking the
button component.

Unlike the Script Console, where the output was displayed within the tool,
we don't have an Output Console open to see our printed values.

7. To open an Output Console in the Designer, select Console from the Tools
menu.

292 ©2019 Inductive Automation


Scripting

There are functions that are unique to each object that can be used to
manipulate the object in some way. For example, string objects have
functions that can change the case of the characters, or remove characters
from the string.
var = " my string"
print var
print var.strip()
print var.upper()
print var
Literal strings can be typed in using either double quotes or single quotes.
This can be handy when your string contains one quote or the other. You can
also use the back slash character to escape special characters.
Numbers can just be typed in normally, like 42 or 3.14159.
Booleans are either True or False (the first letter must be capital, case
matters).
x = "isn’t this grand"
y = 5.56
cond = True
print x, y, cond
Python has many arithmetic operators that you can use to combine values:
addition (+), subtraction (-), division (/), multiplication (*), and modulus
(%) just to name a few.
There are many comparison operators that you can use to construct your
condition, such as: equals (==), not equals (!=) greater than (>), and
greater than or equal (>=).
There are also logical operators that you can use to combine multiple
conditions: (and), (or), and (not).

Using Control Flow Statements


Control flow is another basic Python concept that follows logical statements
to execute code in a certain order or when certain conditions are met. The
two most common forms of control flow are if statements, and for loops.

if Statements
The if statements are well-known among programmers. The if
statements, make your script to execute a block of statement only if a
certain condition is true.

©2019 Inductive Automation 293


Scripting

There are many ways we can create a condition, but it is usually done with
the comparison operators. There are many comparison operators that you
can use to construct your condition: equals (==), not equals (!=)
greater than (>), and greater than or equal (>=) to name a few.
There are also logical operators that you can use to combine multiple
conditions: (and), (or), and (not). Let’s test this out.

1. Add a new Button component to the window and open up the script editor
for the actionPerformed event.

2. Add the following code, which you will see won't do anything:
var = 10
if var < 6:
print "var is less than 6"
The condition was never met so the print never executed. Try changing
the value of var to see how it changes the outcome.

You can use an else to do something when the condition that was laid out
in the if statement is false.

3. Replace your script with the script below. This script will print out "var is
greater than 6":
var = 10
if var < 6:
print "var is less than 6"
else:
print "var is greater than 6"

294 ©2019 Inductive Automation


Scripting

This time we get something to print because of the else allowing for some
logic on when the condition is not met. Lastly, you can use elif to add
multiple conditions. "elif" stands for "else if", and allows you to check
another condition when the first one is not met. This form can optionally
have a catch-all else clause at the end.

4. Replace your script with the script below. This script will print out
"var is 6":
var = 6
if var < 6:
print "var is less than 6"
elif var == 6:
print "var is 6"
else:
print "var is greater than 6"

Try changing the value of var to see how it impacts which condition is
true.

for Loops
For loops are another type of control flow that allow you to run code many
times in succession before continuing on with the rest of the code. In
Python, for loops will typically iterate over a list of objects one at a time,
with the ability to use that object in the looped code. A list can be created
using the range function using the example below.

1. Add a button to the window and open up the script editor for the
actionPerformed event.

©2019 Inductive Automation 295


Scripting

2. Add the following script:


for var in range(5):
print var
Notice how the script prints out 0, 1, 2, 3, and 4 when it executes. The
range function created a list with the items 0-4 in it, while the variable var
is assigned each value in the list in succession, executing the print
statement with each new value. Using a loop like this also provides the
benefit of allowing for a variable size list. If we pulled out each item and
added them together individually, we would need to know the number of
items in the list and add another value to our addition for each item. But
with a loop, the loop will automatically go through every value. So even if
our list was 100 items long, the only thing that would change about our
code would be the list itself.

You can also use a list that you create, with the list containing any
number of any type of objects.

3. Add the following script below your existing script:


for var in [1, "two", 3.3]:
print var
Notice how it prints out the list just like before, only the list contains
values other than integers.

String Formatting
Oftentimes, you may need to take multiple strings and combine them, or
push a variable into a string that will later be displayed to the user. There
are a few different ways of doing this: string concatenation and string
formatting. String concatenation simply concatenates strings together using
the plus symbol, while string formatting allows you to enter values into
specific points into the string. We go over both of these below.

296 ©2019 Inductive Automation


Scripting

1. Create a new Button component on the window and open the scripting
window.

2. Select the actionPerformed event handler and go to the Script Editor


tab.

3. Enter the following code that uses string concatenation:


temp = 65.8
city = "Folsom"
print "The temperature in " + city + " is
currently: " + str(round(temp, 1)) + " °F."
4. Test out the code. Once you have confirmed it works, add the following
line for string formatting below the original script:
print "The temperature in %s is currently: %.1 f
°F." %(city, temp)

Both prints will display the same sentence in the Console using different
methods to create them.

©2019 Inductive Automation 297


Scripting

While concatenation is pretty straightforward and will only work on stings,


the string formatting has many specifiers that you can use to input different
types of values into the string.

Format Meaning
Specifier
%% Inserts a % sign into the final string
%c A single character. Value must be a string of
length 1 or an integer
%d or %i Signed integer
%f Floating point, decimal format
%s A String, converts the value to a string using str()
%u Unsigned decimal
%x or %X Unsigned hexadecimal

Python in Ignition
System Functions
The Ignition scripting API, which is available under the module name
"system", is full of functions that are useful when designing projects in
Ignition. These functions are not part of the standard Python language, but
are instead built into Ignition to ease the execution of certain common tasks
and interact with various systems in Ignition. In the example below, we
cover some of the things that you can do with system functions.

1. Add a Button component on the window.

2. Open the script editor for the actionPerformed event.

3. Add the script below:


system.gui.messageBox("Hello World")

298 ©2019 Inductive Automation


Scripting

We can display simple messages using the message box function. Notice
how the message box keeps focus on the screen, and will not go away
until the user dismisses it. The message box, along with some other
functions, will block further execution of the script while it is up. These
typically wait for user input in some way. Let’s try adding another system
function that will grab the Gateway IP address.

4. Add the following script at the bottom of your code:


print system.util.getGatewayAddress()
Note how this line will not execute and print the Gateway address to the
console until the message box is dismissed.

You can also get Tag information or manipulate them in some way from a
script using system functions.
5. Add the following script at the bottom of your code (as all one line, no
breaks):
print system.tag.readBlocking
(["[default]_GenSim_/Ramp/Ramp1"])[0].value

©2019 Inductive Automation 299


Scripting

Component Scripting
In an event handler, the event object gives context to the event that fired
the script. For example, the event object for a mouse click will have the x
and y coordinates of where the click occurred. A key press event, on the
other hand, will have a key code, but not a coordinate. Through this event
object, we can travel through the window hierarchy to get values from
different components. To do this we need to create what is known as a
component path. Within Vision, you can only travel up or down the
hierarchy, but never side to side. This means that if you have two
components in the same root container, you can’t jump directly from one to
the other but must instead travel up to the common ancestor, and then back
down to the other component. Let’s take look at how this works in the next
example.

Fetching an Input
1. Add another Button to the window and add a Text Field right next to it.

2. Open up the script window on the Button and select the actionPerformed
event handler. Switch to the Script Editor tab.

3. Add the following script:


input = event.s ource.parent.getComp onent("Text Field"). text
system.gui.mess ageBox(input)
Note to get the component path, you can use the Insert Property
Reference icon in the upper right hand corner.

Notice how the component path jumps from object to object until it
reaches its destination of the text field’s text. We can then save this in a
variable and use it in a system function which displays our message.

Component Functions
In addition to getting the values from components on the window, many
components also have unique functions that you can call. One of the best
examples is the Power Table, which has a special function that lets you print
out the contents of the table.

1. Add a Button to the window, and add a Power Table component next to it.

2. On the Power Table, select the TestData property to add some test data
into the table.

300 ©2019 Inductive Automation


Scripting

3. Open the script editor window for the actionPerformed event on the
Button component.

4. Add the following script:


# print the table

# get the table


table = event.source.parent.getComponent('Powe r
Table')

# print
table.print()
5. Click OK.

6. Put the Designer in Preview mode and click the Button component.

When you run the script, a print dialog appears where you can select print
options before printing.

©2019 Inductive Automation 301


Scripting

These component functions are unique to each component and can enable
you to manipulate the components in interesting ways.

Using Extension Functions


In addition to adding scripts to existing event handlers, you can also modify
components by using Extension Functions. Rather than run these function
based on some external event, these are functions that the component itself
calls at certain times. You can modify what these functions do by using
scripting.
Many components have several Extension Functions that you can use to
make common changes to them. For example, the Power Table component
has Extension Functions to configure individual cells, respond to cell edit
events, create right-click menus, and more.
Let’s look at coloring whole rows in the Power Table component.

1. We can use the Power Table that we used in the previous example, so
select it.

2. Right-click on the Power Table component, select Scripting…, and select


the ConfigureCell extension function.

3. Click the Enabled option at the top of the window so you can modify your
custom function.

302 ©2019 Inductive Automation


Scripting

All of the purple text inside the triple quotes (""") are notes about how
this particular function works. Specifically, this function is called for each
cell to determine what it looks like. At the bottom, there are a few lines of
code that we will un-comment and see what it does.

4. Select all of the gray commented text, except for the first line, which is
actually a comment.

5. Press control + / to uncomment all of the code at once.

©2019 Inductive Automation 303


Scripting

6. Press OK to see it in action. You will notice that every other line in the
Power Table is now a light gray.

7. Return to the script to make some modifications. We want to change the


script so that it also will change the color of the row if the boolean value is
unchecked.

304 ©2019 Inductive Automation


Scripting

8. You will notice we no longer have the property selector button available to
us, and that is because these extension functions don't normally have an
event object, so we will need to build the path ourselves using the
provided self object. Add the two highlighted lines of code below:
if selected:
re turn {'background': self.selectionBackgr ound}
elif self.data.getValue At(rowView,'Boolean Column') == False:
re turn {'background': 'green'}
elif rowView % 2 == 0:
re turn {'background': 'white'}
else:
re turn {'background': '#DDDDDD'}

Client and Gateway Event Scripts


Client and Gateway events are special events not based around
components. Many times, these scripts can fire automatically, without the
user doing some action to trigger them. These special events also take a
look at the concept of scope, or where the script is run.

Client Events
There are a handful of different Client Events that are triggered by different
actions. Like scripts on components, each script can fire on each client that
is currently running this project. This means that for scripts that run
automatically like the Timer scripts, each client will be running the script at
a set rate. A script executing in the Client is considered to be in the Client

©2019 Inductive Automation 305


Scripting

Scope. Typically you want to be careful when interacting with global


resources like Tags from these scripts, as you can potentially have multiple
Client scripts writing to the same Tag at the same time!
If you take a look at the Timer section of the Client Events, you will notice
that there is already a script there. This was built for us by the project
template that we selected earlier in the week. It runs every five seconds,
and checks how long the client has been active for. If it has been inactive for
more than five minutes, then it locks the client. We can disable it by double
clicking on the script name and unchecking the Enabled checkbox.

Gateway Events
Gateway Events work a little differently than Client Events, even though
many of them seem similar. While the Client Events are triggered by things
happening in the Client, The Gateway Events are triggered by things
running in the Gateway. This also means that these scripts execute in the
Gateway Scope. By running in the Gateway Scope, these scripts can’t
directly affect objects within the Client such as windows and components.
Let’s look at the Tag Change Event, which is present as both a Client Event
and a Gateway Event. When the Gateway Tag Change Script fires, it runs
once on the Gateway sever. When that same Tag triggers a Client Tag
Change Script, that script is run on every currently open Client that is
running this project.

306 ©2019 Inductive Automation


Scripting

Project Script Library


The Project Script Library is a place where you can create your own script
functions. Think of script functions like templates, where you can create it
once, and then use it over and over again. Below, we have a simple example
to put one together.

1. In the Project Browser, open the Scripting folder.

2. Right click on the Project Library and select New Script. Give it a name
of “myScripts”.

3. Copy the code below into the script.


def myMessage(message):
system.gui.messageBox(message)

©2019 Inductive Automation 307


Scripting

4. Go back to the scripting window and add a button to the screen and go
into its script.

5. Call the function by first referencing the name of the script and then the
name of the function, as in the script below:
myScripts.myMessage("This is my Project Script ")

308 ©2019 Inductive Automation


Chapter 19

Perspective

Perspective is a module that allows you to create resources that allow a user
to easily transition from viewing the project on a computer to viewing it on a
mobile device. Everything is based around web technologies such as HTML
and CSS, which allow you to build screens that are displayed in the web
browser and can easily respond to changing screen sizes. Perspective is a
different visualization system than Vision, utilizing different layouts that
determine where components are on the screen, and how they resize.
Because Perspective is launched in the web browser, you essentially build
web pages that the user can navigate to with a URL. These Pages can then
have many views on them, where each view has components that move
around according to the layout of the view.

Creating a View
A View allows us to visualize components on the screen and display data
similar to how we would in the Vision system. We can create a View and see
how we can add components to it.

©2019 Inductive Automation 309


Perspective

1. Create a new View by right clicking on the Views folder in the Perspective
section of the Project Browser.

Name: Coordinate
Layout: Coordinate
Page URL: Enabled, with a URL of "/"

2. Drag a Cylindrical Tank onto the View. Similar to the Vision Cylindrical
Tank component, it also has a lot of properties in common.

3. Drag a Slider onto the View. It is also similar to the Vision Slider
component and we want to bind the two together.

4. Select the Tank and set up a binding on the value property by clicking on
the binding icon to the left of the property name.

310 ©2019 Inductive Automation


Perspective

5. In the Edit Binding window, select the Property type and then click on the
Insert Property icon on the right. Find slider.props.value and
select it for the binding.

6. You can place your Designer into Preview mode to move the slider and
see the tank value change.

©2019 Inductive Automation 311


Perspective

Tag Bindings
Tag bindings work the same way that they do in Vision, and we can utilize a
lot of the drag and drop functionality that we are used to. Simply add a
component to the View and drag and drop a Tag onto it to automatically set
up the binding on the property.

Deep Selection
With so many different container types to nest within one another to achieve
the desired layout, it is possible to deep select into components to interact
with any of its children. To deep select a component, double click it and a
few things will change.

• In the Project Browser, the component will now have a Crosshair


icon next to it rather than the root, indicating it is the current deep
selected component.

• The rest of the view will be grayed out, while the component will not be.
Any children of the component can then be interacted with. When
nesting containers within one another it is a very useful tool, allowing
you to reach into the container and configure its children components.

312 ©2019 Inductive Automation


Perspective

While deep selected inside a container, if there is another container nested


inside, you can deep select further simply by double clicking on the child
container. Deep selection allows you to select into containers as far as you
need to go.
To leave deep selection and move up a level, simply click outside of the
bounds of the deep selected container.

Coordinate Layout Scaling


The coordinate container uses a layout system that works much like Vision
windows do. It is by default in a Fixed mode, which works similarly to
Vision’s anchored mode. The component will have a set x and y location with
widths and heights that do not change, regardless of the size of the view.
In Percentage mode, the layout works similarly to Vision’s relative mode.
The components will be give x, y, width, and height that is a percentage of
its position on the view, which allows it to grow and shrink with the view.

Page Configuration
Pages are what get opened in the web browser when you launch a
Perspective project. Pages have a URL and views that get displayed on the
page.

To configure Pages, click on the Settings icon (gear) at the bottom left
corner of the Designer.

©2019 Inductive Automation 313


Perspective

Here in the settings section, you will find Page Configuration on the left. You
will notice there is already a Page configured with the URL of ‘/’, which was
created for us automatically when we created the View with the Page URL
option is enabled.

New Pages can be created manually by clicking the Add icon. Each Page
then needs to be given a URL and a Primary View. It can then have views
docked around the edge of the Page.

Launching a Session
Launching a session simply involves navigating to any of the Pages set up in
the Project. This involves adding the Page URL to the end of a base URL. The
base URL will look something like this:
G at ewayIP:8088/data/perspective/client/projectName
So a page with a URL of ‘/’ simply needs to put that at the end of the base
URL.
Perspective Sessions can also be launched from the Gateway Webpage in
the Home tab. This will open the session to the page defined with the URL
of ‘/’. This means you will want to have a page defined with a URL of ‘/’.

314 ©2019 Inductive Automation


Perspective

Finally, you can also open the session from in the designer. Simply go into
the tools menu in the Perspective section, select Launch
Perspective…>Launch Session. You can also right click on a Page in the
Page Configuration section and select Launch Url to launch the URL for that
specific Page.

©2019 Inductive Automation 315


Perspective

Perspective Templates
While there is no section in Perspective for Templates like there is in Vision,
Views can be embedded in other Views much like you would put a template
in a window.

Motor Template
Let’s put together a Motor Template in Perspective much like we did in
Vision.

1. Create a new View that we will use for our template.

Name: MotorView

Layout: Flex

Page URL: false

2. In the Property Editor, change the size of the View to have a width and
height of 200x200.

316 ©2019 Inductive Automation


Perspective

3. In the Project Browser, select the root and ensure that its direction
property is set to column.

4. Add a Label component to the View and set the basis to 50px

5. Add a Multi-state Button. Edit the properties as follows:

orientation: row
grow: 1
basis: 70px

6. Add a Flex Container. Edit the properties as follows:

name: Row Flex


direction: row
grow: 0
basis: 50px

©2019 Inductive Automation 317


Perspective

7. Deep select into the new container so we can add components to it. Add a
Label into the Row Flex container. Edit the properties as follows:

text: Amps
alignVertical: center
grow: 1

8. Add an LED Display component to the Row Flex container as well, and set
grow to 1.

9. Set your Deep selection back to the Root container then add a Coordinate
Container component to the MotorView. Edit the properties as follows:

name: SVG Container


mode: Percent

10. Deep select into the SVG Container so we can add a motor graphic to it.

11. Go to Tools > Symbol Factory. In the search box, enter "motor".

318 ©2019 Inductive Automation


Perspective

12. Drag the Simple motor 4 symbol onto the container.

13. Right-click on the motor image and select Flatten. This creates an outline
of the image. You’ll see in the Project Browser that there are now two
Simple motor components.

14. Select Simple motor 5. In the Property Editor, expand the elements
property. Then expand the 0 property and the fill property.

©2019 Inductive Automation 319


Perspective

15. Next to the paint property, click the Color Selector square. Use the color
wheel to choose a yellow color, or set the value on the Palette to
FFFF0066.

Styles
Styles in Perspective give you a way to alter how a component is displayed
by applying CSS. Styles are set on each component, and any combination of
CSS settings can be applied. Things like altering the text size or font, or
setting background colors, or margins.

Adding a Style to the Motor View


1. In the MotorView, deep select the Flex Container and select the Amps
label.

2. In the component properties, click on the Modify Style icon next to


the style property.

320 ©2019 Inductive Automation


Perspective

3. A style editor opens with several sections. Expand the Text section to
make changes to the text styles. Here you can change things like the text
color, font, size, and more.

4. Set the following properties in the text section:

Font Size: 18px


Font Family: Arial
Text Align: center

5. Click OK. Save your project.

©2019 Inductive Automation 321


Perspective

Style Classes
Style classes give you a way to create a re-usable set of style rules and
apply them across a large set of components. Like Vision templates, they
can then be altered and each component using that style will be updated
automatically. When developing a project, we want to make sure our look
and feel is consistent across all views. It is a good idea to start your project
with a small list of the font settings that will be used everywhere. This way
your project will be easier to read.

Creating a Header Style Class


1. In the Project Browser under the Perspective object, right-click on the
Styles folder and select New Style….

2. Name your new style Header.

3. Set the following properties in the text section:

Color: blue (#234077)


Font Size: 26px
Font Weight: bold
Text Align: center

322 ©2019 Inductive Automation


Perspective

4. Click OK.

5. Select the MotorView’s Title Label component.

6. In the component properties, expand style and click the Expand icon
next to the classes property to see all available Style Classes.

You can select as many of the style classes as you want, and all CSS
settings will be used from each selected class as long as they don’t
overlap.

7. Select the Header class.

©2019 Inductive Automation 323


Perspective

8. You will see the Label update to the Header style.

324 ©2019 Inductive Automation


Perspective

9. Let’s make a change to the style class. You can add additional element
states, like a mouseover, to show something different when the mouse
moves over the component. Open the Header style class from the Project
Browser.

10. Under Style Rules, click the Add icon on the right and select the
Element State option.

11. Select the new Element State from the list on the left and change the
Element State dropdown to hover.

12. You can now change any of the CSS elements to different states.
Anything not set will use the Base Style. To reverse the test and
background colors, set the following properties:

Text color: white (#FCFCFC)


Background Color: blue (#234077)

©2019 Inductive Automation 325


Perspective

13. Now mouse over the Title to see the updates.

Parameters and Bindings


Now that we have the Motor View set up to look good, we can add bindings
to make everything dynamic. Just like in Vision, we need to know which
motor we are looking at to set up our bindings. To do that, we have view
parameters to allow us to pass values into the view.

Create a Parameter
1. Select the MotorView in the Project Browser.

2. Under the properties in the PARAMS section, click on the Add View
Parameter… link and select the Value option. This will give you a
key:value pair that we can edit.

326 ©2019 Inductive Automation


Perspective

3. To the right of this Parameter there is an Arrow icon that indicates the
parameter direction. You can click this arrow to make the parameter an
Input, Output, or InOut parameter. Leave it pointing left (Input). This
allows us to pass information into this view when it is embedded in a
larger view.

4. Double-click on the PARAMS key and enter "motorNum".

5. Click on the value and type in a valid motor number like "2".

©2019 Inductive Automation 327


Perspective

Creating Property Bindings


Now we can use this property to create indirect bindings on all the
MotorView components. Bindings in Perspective are very similar to bindings
in Vision. Each property has a binding icon, and every binding has
several types like Tag, property, and so on.

Title Binding
For the Title Label we just want to see the motor name. We have only
passed in the motor number, but we can construct the name using an
Expression binding.

1. Select the Title Label component.

2. On the text property, click on the binding icon on the left.

3. Select the Expression Binding Type.

4. In the Expression field, click on the Insert Property icon on the right.

5. From this dialog, expand the view and then params folders, then select
the motorNum param and click OK.

328 ©2019 Inductive Automation


Perspective

6. To add the word Motor to the beginning, update the expression to the
following:
"Motor " + {view.params.motorNum}
7. Notice that there is a Binding Preview at the bottom of the screen. From
here we know that our expression is correct, and we can see what the
result will be when we finish. Click the OK button at the bottom.

HOA Binding
The Multi-State button needs to use the motorNum PARAM to bind to a
dynamic HOA value. We will use an Indirect Tag binding.

1. Select the Multi-State Button component and click on the binding icon
for the controlValue property.

2. Select the Tag Binding type.

3. Select the Indirect radio button.

4. You can build the Tag Path by using the Tag and Property Selector buttons
on the right. Click on the Browse Tags icon and select the Motors/
Motor 1/HOA Tag.

©2019 Inductive Automation 329


Perspective

5. Delete the "1" in the Tag Path, and while leaving your cursor there, click
on the Insert Property icon.

6. Select the view -> params -> motorNum property. Click OK. You will
see a {motorNum} reference added to the Tag Path.

7. Check the Bidirectional checkbox.

330 ©2019 Inductive Automation


Perspective

8. Click OK.

9. In the Property Editor, right-click on the controlValue property and choose


the Copy Binding option.

10. Right-click on the indicatorValue property and choose the Paste Binding
option.

Amps Binding
Similarly, we want the Amps LED to be bound indirectly to the AMPS Tag. We
will bind the Amps LED in the same way.

1. Deep select the Flex container and select the LED component.

©2019 Inductive Automation 331


Perspective

2. In the Property Editor, click on the binding icon for the value
property.

3. On the Edit binding window, select the Tag Binding type and the Indirect
radio button.

4. Click on the Browse Tags icon on the right and select the Motors/
Motor 1/AMPS Tag. Click OK.

5. Delete the "1" in the Tag Path, and while leaving your cursor there, click
on the Insert Property icon.

6. Select the view -> params -> motorNum property. You will see a
{motorNum} reference added to the Tag Path.

7. Click OK to submit.

Image Tint Binding


We will bind the Motor color in the same way as the Multi-State Button, but
this time we will change the HOA value into a color using the Binding
Transforms.

332 ©2019 Inductive Automation


Perspective

1. Deep select the Coordinate container and select the top motor image
component.

2. In the Property Editor, expand into the elements property to find


elements[0].fill.paint.

3. Click on the binding icon for the paint property.

©2019 Inductive Automation 333


Perspective

4. On the Edit Binding screen, select the Tag Binding type and the Indirect
radio button.

5. Click on the Browse Tags icon on the right and select the Motors/
Motor 1/HOA Tag.

6. Delete the "1" in the Tag Path, and while leaving your cursor there, click
on the Insert Property icon.

7. Select the view -> params -> motorNum property. Click OK. You will
see a {motorNum} reference added to the Tag Path.

8. Now that we have the value, we can change it with a Transform. Click the
Add Transform + button below the binding.

9. Select the Map transform type and click Add Transform >. This allows
us to map inputs and outputs in a table.

10. In the Map table, click on the Add icon on the right three times to add
rows to the table in addition to the Fallback row.

334 ©2019 Inductive Automation


Perspective

11. In the Input type column, type in a value for each row: 0, 1, and 2.

12. The input and output columns can change types if necessary. In the
Output column header, click on the word Value or the triangle to the right
of it. Select Color to map numbers to colors.

13. Click on the colored cell for the row with a 0 value to change the color.
Select red.

14. Now for the same row, click on the color wheel. At the bottom, drag the
horizontal slider (alpha or transparency) to 40.

©2019 Inductive Automation 335


Perspective

15. Repeat for the other colors. 1 is green, and 2 is yellow. All should have a
transparency of 40.

16. Set the Fallback color in the same way to black and 40 transparency.

17. Click OK to submit.


You can now select the MotorView and change the motorNum parameter to
see everything update. Put the Designer into Preview Mode and change the
HOA value to verify.

Embedding Views
Now that we have a reusable view, we can add it to any other views in the
project. In order to add it to a larger view, we need to embed it. There are a
few ways to embed views, and we will look at two ways to do it with
components: the Embedded View component, and the Carousel component.

Embedded View Component


When we want to include a small view inside a larger view, we can use the
Embedded View component. This simple component allows you to select one
view and display it. We will use it to add a few MotorViews to the large
Coordinate view.

1. Open the Coordinate view.

2. Drag an Embedded View component onto the Coordinate view.

3. In the Embedded View properties, set the path property to MotorView.


You can select it from the dropdown list.

4. Click OK.

336 ©2019 Inductive Automation


Perspective

This shows you the MotorView details, but you will notice that there is no
way to select a motor. To do this we need to add a parameter.

5. Expand the params property, click the Add Object Member icon, and
select value.

©2019 Inductive Automation 337


Perspective

6. Double-click on key and enter "motorNum". This must match exactly to


the MotorView parameter name.

7. Click on value and type in a valid motor number like "1". You will now see
the MotorView filled in with data from Motor 1.

8. You can copy/paste this component several times and change the
motorNum property to show multiple motors on your view.

338 ©2019 Inductive Automation


Perspective

Carousel Component
Another way to display multiple views inside another view is to use the other
embedding components. One good example is the Carousel component.
This is focused around a mobile experience and allows users to swipe
through a list of views or set it to be an auto-rotating marquee. Let’s set up
a Page that is useful primarily on a smart phone.

1. In the Project Browser, right-click on the Views folder and select New
View….

2. Enter the following values for the new view, make sure to check the Page
URL checkbox:

Name: Carousel
Layout: Flex
Page URL: /carousel

3. Click the Create View button.

We have selected the Flex view because we only need one component and
it is the easiest way to force a single component to use the entire view.

4. Drag a Carousel component into the view.

5. In the Carousel component’s POSITION properties, set grow to 1.

6. Now we can start adding views to the Carousel. In the views property
there is a 0 object with parameters inside it. Expand the views[0]
property.

©2019 Inductive Automation 339


Perspective

7. Set the viewPath property to MotorView. Click OK.

This shows the default motor, but we can change it in the same way as
the Embedded View in the previous example.

8. Expand the viewParams property, click on the + Add Object


Member… button, and select value.

9. Double-click on key and enter "motorNum". This must match exactly to


the MotorView parameter name.

10. Click on value and type in "1". You will now see the MotorView filled in
with data from Motor 1.

11. To add another motor view, click on the Add icon next to the views
property.

340 ©2019 Inductive Automation


Perspective

You will have to set the viewPath and viewParams properties for each
element, but you can copy/paste them in since they are so similar.

12. Right-click on the view[0] element that we already set up, and select
Copy.

©2019 Inductive Automation 341


Perspective

13. Right-click on the new view[1] element and select Paste. You will see
the viewPath and viewParams are now filled in.

14. Expand the viewParams property and change the motorNum property
value to 2.

15. Put the Designer into Preview Mode and move between Motor 1 and Motor
2 by clicking the arrows, dots, or click-dragging (swiping) left and
right.

16. Now repeat steps 12-15 to fill in the rest of the motors.

17. You can now launch the /carousel page from the Perspective Page
Configuration to test it out.

342 ©2019 Inductive Automation


Perspective

Breakpoint Layout
Now that we have both large and small sized views, we can talk about
another type of view layout: Breakpoint. The idea behind the Breakpoint
layout is that a user will see different views based on the size of their
device. Specifically, one view when the width is small, and another when the
width is large. The views do not need to be the same, so they can have
completely different components or layouts. Let’s create a page that shows
the Coordinate view when using a large device like a computer monitor, and
the Carousel view when using a small device like a phone.

Creating a Breakpoint Page


1. In the Project Browser, right-click on the Views folder and select New
View….

2. Enter the following values for the new view, make sure to check the Page
URL checkbox:

Name: Breakpoint
Layout: Breakpoint
Page URL: false

3. Click the Create View button.

©2019 Inductive Automation 343


Perspective

4. The Breakpoint view will open and you can see there is nothing in it. In
the top of the Property Editor, there is a single Breakpoint setting and the
ability to select between two children: Small and Large. Select the
Large option by clicking on it.

You can only have one component in the Large breakpoint and one in the
Small breakpoint in a Breakpoint view. To enable us to view more than
one thing, we're going to pull in an Embedded view.

5. Drag an Embedded View component into the Breakpoint view.

6. In the Property Editor, set the path property of the Embedded View to
Coordinate. Unlike the MotorView, we have no parameters to set.

344 ©2019 Inductive Automation


Perspective

7. Click OK.

8. Select the Small child from the breakpoint settings at the top of the
Property Editor. You will notice that the Breakpoint view changes back to
the original empty screen.

9. Drag another Embedded View component into the Breakpoint view.

©2019 Inductive Automation 345


Perspective

10. In the Property Editor, set the path property of the Embedded View to
Carousel. There are no parameters to set for this view.

11. Now that our Breakpoint view is set up, we need a way to launch it. Go to
Perspective Page Configuration by clicking the Settings icon (gear) at
the bottom left corner of the Designer.

12. In the Page Configuration list, right click on the root page "/" and select
Launch URL.

This page is currently using the Coordinate View as its Primary View.

13. Back on the Page Configuration, change the Primary View dropdown to
our new Breakpoint view.

346 ©2019 Inductive Automation


Perspective

Now when you open the project, it will default to this view.

14. Launch a Session again. Change the size of your window to see your
breakpoint change when the when the window goes below 640px or
above 640px.

Perspective Security
With Perspective running in the web browser, security is handled differently
than the Vision Clients. Identity Providers are used to authenticate users in
a Perspective Session. An Identity Provider (IdP) is a system that maintains
user information and can authenticate users across multiple applications.
There are two main systems that IdPs use: OpenID and SAML. Each IdP
uses one of those systems and Ignition can connect to either type.
While Ignition can be connected to third party IdPs, Ignition’s User Sources
can also be used as an IdP. If you go into the Identity Providers page in the
Gateway Webpage, you will notice that an IdP already exists called default.
This IdP is linked to the User Source called default, and will authenticate all
of the users in that User Source.

©2019 Inductive Automation 347


Perspective

Security Levels
Security Levels are a new security system that works with the user
information provided by the IdP to grant users certain permissions that can
then later be applied to a Perspective project. One advantage of Security
Levels is that they are not solely role based, and can instead utilize other
information to determine what permissions a user should have. However,
because Security Levels are not connected to an IdP, we need to create the
different Security Levels that user information from the IdP can match into.

1. Go to the Config tab of the Gateway Webpage. Scroll down to the


Security Levels page in the Security section. We want to add levels for the
roles our users might have, so that we can then use those levels for
security.

2. Navigate to the Roles node of the tree and click the Add Security Level
button in the bottom right corner of the screen. Give the level a name of
Administrator.

3. Select the Roles node again and Add another level. Give the level a name
of Operator.

4. Click the Save button at the bottom of the screen to save the new levels.

348 ©2019 Inductive Automation


Perspective

Security in the Perspective Project


Now that we have Security Levels set up, we can use them within the
project. First, the project needs to have an Identity Provider set.

1. Open the Project Properties.

2. In the Project General section, click the Expand icon and select an
Identity Provider that the project will use.

©2019 Inductive Automation 349


Perspective

Now that you have chosen an IdP, there are then three places where
security can be enabled.

Securing the Project


Perspective Projects by default do not require a user to log in, but you can
require certain Security Levels. In the Project Properties, navigate to
Perspective Permissions section and you can pick and choose which levels
are required to use the project.

Securing a View
Each individual View can also be secured using Security Levels. Simply right
click on the View and select Configure View Permissions. Here you can
configure permissions for a View much like you would for the whole project.

350 ©2019 Inductive Automation


Perspective

Securing Scripts
Finally, script actions that are triggered based on component events can
also be secured. To add a script action to a component event, simply right
click on the component and select Configure Events. After selecting an
event, click the plus button to add a script action. After writing a script, you
can click on the Security Settings button at the bottom of the window to
require certain security levels to run the script, much in the same way that
security levels can be required to access a project.

©2019 Inductive Automation 351


Perspective

352 ©2019 Inductive Automation


Chapter 20

Reporting

The Reporting module creates rich, dynamic PDF reports from any data. The
Ignition Reporting Module is a standalone reporting solution that simplifies
and enhances the reporting process from beginning to end.
You can generate reports from existing files or create them from scratch.
Pull data from a variety of sources, and design reports with a simple to use
interface. Add charts, graphs, tables, crosstabs, shapes, and other
components for visual impact. Save your reports in PDF, HTML, CSV, and
RTF file formats, and set up automatic scheduling and delivery.

©2019 Inductive Automation 353


Reporting

Creating a Basic PDF Report


The Reporting Module lets you create dynamic PDF reports.

Creating a Report
Let's create a report that displays history stored by a Transaction Group.

1. In the Designer, from the Project Browser, select the Reports item.

The workspace will change to the Reports view.

2. In Project Browser, right-click the Reports item and select New


Report.

3. Right-click on the New Report, choose Rename or press F2, and name
it Basic Report.

354 ©2019 Inductive Automation


Reporting

You will see five sections to the report: Report Overview, Data, Design,
Preview, and Schedule:

Report Overview: This page is a collection of useful information about


your report. It will fill in as the report is generated and used.
Data: This page is where you define the data that goes into your report.
You can add as many basic data type parameters, and dataset type Data
Sources for use in the report. Data can be dependent on other parameters
as well as nested in datasets.
Design: Create your reports by adding charts and tables to your pages.
Group Tables and insert data any way you’d like. Calculations on Data
Sources are automatically generated.
Preview: View your report in progress. Display your Data and Design
information to preview inside the designer. There is an automatically
applied query limit to prevent asking for too much data.
Schedule: Set up schedules on your report to automatically print, save,
email, and more.

Adding Data to Your Report


Let’s add some Data from the database to our report based on start and end
times.

1. Click on the Data tab in the Designer.

The StartDate and EndDate are already created for you. By default,
they make a time range starting 8 hours ago, and ending now.

2. Because our data is being stored at a very fast 1 second rate, change the
StartDate expression to show 8 minutes instead of 8 hours.
dateArithmetic(now(), -8, "min")
3. Click the Add icon to add a new Data Source. Select SQL Query to
add a new Query source type.

Note: This query type allows us to use the query Builder to generate
queries for us.

©2019 Inductive Automation 355


Reporting

4. Change the Data Key name in the upper right to history.

5. Under SQL Query Builder, set the dropdown to MSSQL, this will tell the
builder what syntax to use.

6. Click the Show Builder button to start designing your query.

7. Click on the history table name on the right and drag it into the SQL
Query Builder panel.

You can see a Query that is being generated for you at the bottom.

356 ©2019 Inductive Automation


Reporting

8. Click on the checkboxes next to each of the Ramp columns and the
t_stamp to bring each into the query.

9. You could set each column to be a part of the Where clause by editing
the table in the middle, but we need something a little more complex for
this report. Click the Apply button so we can modify our query to include
the Start and End timestamps.

©2019 Inductive Automation 357


Reporting

10. Modify the existing query to select from our history table.
SELECT history.t_stamp,
history.Ramp1,
history.Ramp2,
history.Ramp3
FROM history
WHERE history.t_stamp BETWEEN ? AND ?

You’ll notice parameter boxes pop up at the bottom when you add the
question marks. Clicking in one of those boxes will highlight the
corresponding "?".

11. In the Parameter 1 box, click on the Report Parameters button and
select StartDate.

358 ©2019 Inductive Automation


Reporting

12. In the Parameter 2 box, click on the Report Parameters button and
select EndDate.

13. Click over to the Preview tab to check that your query is correct. You will
notice an error across the bottom if there is a problem.

You now have data in your report! The next step is to Design it.

©2019 Inductive Automation 359


Reporting

Designing Your Report


Let’s add a display to show off the Data we collected from the database.
Click on the Design tab in the Designer. This screen is very similar to the
Windows section of the Designer. The Report module has its own collection
of components and properties.

Add a Title
1. Click on the Text component and then click and drag on the top of the
page.

2. In the Property Inspector, enter "My First Report" and click on the Text
icon to change the font size to 36 Bold.

3. You can alter the size and location of the Text Shape by selecting (click
away and back if the outline is red) it and then dragging the gray handles.

4. Drag the component to the gray border of the report page. You will see it
snap into the corner. Expand the component to be the entire width of the
report.

360 ©2019 Inductive Automation


Reporting

Add a Date Range


1. In the Key Browser, expand the Parameters folder.

2. Drag the StartDate onto the screen under the title.

3. Stretch out the component to the entire width of the report.

4. Click over to the Preview tab. You will see your StartDate, but it doesn’t
include the timestamp.
5. Go back to the Design tab and select the StartDate component.

6. In the Property Inspector, click on the Properties tab.

7. Change the Date Format property to add a timestamp. To do this, you


can either type in a value, or click on the Calendar icon on the right to
open a list of options. Let’s enter our own: "MMM d, y h:mm a"

©2019 Inductive Automation 361


Reporting

8. Go back to the Preview tab to see the change.

9. In the Design tab, we can now add the EndDate to the report. With the
StartDate component still selected, click on the Edit Text tab in the
Property Inspector.

10. You can add text directly or drag in keys from the Key Browser. Drag the
EndDate into the Edit Text area.

11. Now we can add text between the two keys, enter:
"@StartDate@ to @EndDate@"

Add a Page Number


1. The report has several built-in keys that we can use. In the Key Browser,
expand the Built In folder.

2. You will notice several Page options in the Keys. These will tell you a lot
about the page of the report that you are currently looking at. Drag the
Page of PageMax key onto the report. Move it to the lower right corner
of the report.

3. Go to the Preview tab to see the Page of PageMax value. You will
notice that it is not in the lower right corner. This is because every new
Text Shape is left justified by default.

4. Go back to the Design tab and select the Page of PageMax component.

362 ©2019 Inductive Automation


Reporting

5. In the Property Inspector, click on the Properties tab and set the
Horizontal Alignment property to Right. Go back to the Preview tab
to verify your changes.

Add a Chart
1. Click on the Timeseries Chart component and drag it onto the page. You
will see the Property Inspector in the lower left change to show
information for it.

©2019 Inductive Automation 363


Reporting

2. Drag the history Dataset onto the Timeseries Chart’s Data Key.

3. Drag the Ramp1, Ramp2, and Ramp3 Tags from the Key Browser on to
the three Pens in the Property Inspector.

4. Now click on the Preview tab to see your chart!

Add a Table
1. Click on the Table component and drag it onto the page. You will see the
Property Inspector in the lower left change to show information for the
table.

364 ©2019 Inductive Automation


Reporting

2. In the Key Browser, expand the Parameters folder and Datasources


objects to see our data.

3. Drag the history dataset into the Table’s Data Key field.

©2019 Inductive Automation 365


Reporting

4. Now we can drag columns into the table. Drag Ramp1, Ramp2, Ramp3,
and t_stamp onto the table.

5. Click on the Preview tab to see your table! You will notice that your
Timestamp column is only showing the date. You can change that in the
same way as the StartDate component in the previous example.

In the Design tab, select the @t_stamp@ cell of the table. In the
Property Inspector, select the Properties tab and change the Date
Format property by clicking on the Calendar icon. Choose any format
that you like.

Now let’s add a Header and Summary row to the Table.

6. Select the Table and go to the bottom of the Property Inspector. Click
on the Header and Summary checkboxes to activate these rows.

7. Type into the header columns to give each a name.

366 ©2019 Inductive Automation


Reporting

8. In the Key Browser, click the Show Calculations checkbox. Now each
column in the dataset will have value, total, etc.

9. Drag each of the following into the Summary row of our table. Then click
in the cell and type to add text to each. Enter the following:

Ramp 0: Total @total.Ramp1@


Ramp 1: Average @average.Ramp2@

Ramp 2: Max @max.Ramp3@

10. Click on the Preview tab to see your table!

Schedule
You can add as many schedules as you want to your report. Schedules allow
you to make your report automatically save, email, and more.
Let’s save our report every day at 1am.

1. Click over to the Schedule tab and click the Add icon in the upper
right to add a new schedule to the table.

©2019 Inductive Automation 367


Reporting

2. Below our table are three tabs. On the lower Schedule tab, you can set
how often the report is run using a CRONTAB scheduling system. Set the
text fields to the following:

Minutes: 0
Hours: 1
Days: *
Months: *
Weekdays: *

This gives us a time of 1AM, every day.

3. On the Parameters tab, you can change the parameter values away
from their defaults. In this case, we want a daily report to show the entire
day, not just the last 8 minutes. Uncheck the Default boxes and enter
the following. This returns midnight to midnight for the prior day.

StartDate:
addDays(midnight(now()), -1)
EndDate:
midnight(now())

368 ©2019 Inductive Automation


Reporting

4. On the Actions tab, you can set a number of actions to happen each time
this schedule is run. Click on the Add icon and select New Save File
Action.

5. In the Folder Path field, you can enter any path (on the Ignition
computer or a shared drive). Ignition will create this folder if it doesn't
exist. Enter the following folder path and select PDF as the Format type.
C:\Reports
6. You can change the FileName expression to anything you want. The
dateFormat function uses the same format string that we saw when
designing the report. If your report happens daily, you don't need the
hours in the timestamp, but if it is running every 30 minutes, you should
add minutes to the filename to prevent files from being overwritten.

©2019 Inductive Automation 369


Reporting

7. Try clicking on the Run Selected Action Immediately button to test it out.

Client Reports
You can allow your users to dynamically view reports on any window in your
client. Adding a report is very quick and simple, let’s add a new report
window.

1. Go to the Window section of the Designer and create a new main window
called Report.

2. Select the Report Viewer component and add it to your window.

3. Select your Report from the Report Path property. You will see it
populate immediately with 8 minutes of data.

370 ©2019 Inductive Automation


Reporting

4. To make the report time range dynamic, we will add a Date Range
component to the window.

5. On the Report Viewer component, simply bind the StartDate and


EndDate properties to the Date Range component’s Start Date and
End Date properties.

©2019 Inductive Automation 371


Reporting

372 ©2019 Inductive Automation


Chapter 21

Gateway Network

The Gateway Network allows us to connect Gateways to each other so that


they can share data such as Tags, alarms, and history. Making a Gateway
Network Connection is easy.

Connect to a Gateway
Let’s set up a connection to the instructor’s Gateway.

1. Go to the Config section of the Gateway Webpage and navigate to the


Gateway Network page of the Networking section on both Gateways that
will be connected.

©2019 Inductive Automation 373


Gateway Network

One Gateway will make an outgoing connection, while the other Gateway
will accept the incoming connection. In class, you will be making the
outgoing connection to the instructor’s Gateway while they will accept the
incoming connection.

2. On the Gateway receiving the incoming connection (Instructor Gateway),


in the General tab set Require SSL to false. The Instructor will do this on
their Gateway.

3. On the Gateway making the outgoing connection (your Gateway), select


the Outgoing Connections tab near the top.

4. Select Create new Outgoing Gateway Connection…

374 ©2019 Inductive Automation


Gateway Network

5. Set the Host to the IP Address of the Gateway accepting the incoming
connection, the Port to 8088, and Use SSL to False.

6. Scroll to the bottom of the page and click the Create New Outgoing
Gateway Connection button.

7. The last step is to approve the incoming connection on the other


(instructor) Gateway. Again, the instructor will do this. Once the
instructor approves the connection, your Gateway should now be
connected.
And that is all there is to it.

©2019 Inductive Automation 375


Gateway Network

Set Up a Remote Tag Provider


Now that the Gateways are connected through the Gateway Network, you
can check the status of the connection in the Status section, as well as
share data by setting up a Remote Provider.
A Remote Tag Provider allows you to pull a Tag Provider from one Gateway
into another, as long as both are connected through the Gateway Network.

1. In the Config section of the Gateway Webpage, navigate to the Realtime


page of the Tags section.

2. Click Create new Realtime Tag Provider.

3. Select the Remote Tag Provider (Gateway Network) option.

4. You should see an option for the instructor’s Gateway that is connected
through the Gateway Network.

5. Provide a name for the Tag Provider, and this will pull the instructor’s Tags
into your Gateway in a new remote provider.

376 ©2019 Inductive Automation


Gateway Network

6. Go into your Designer and find the Tag Browser. Expand the All Providers
folder and you should see your new Tag Provider.

©2019 Inductive Automation 377


Gateway Network

378 ©2019 Inductive Automation


Chapter 22

Backups

There are two types of backups in Ignition. Gateway Backups consist of


everything in Ignition except the activation status. This means all projects,
Tags, connection configurations, alarm notifications configurations and
more. Gateway Backups consist of all projects, Tags, connection
configurations, alarm notifications configurations and more. Generally, the
only items not included in a Gateway Backup are licenses, modules, and
files stored externally to Ignition, such as database tables, or PLC programs.
Gateway Backups are ideal when transferring an Ignition installation from
one server to another. Restoring from a Gateway backup is considered a
replacement operation, in that the backup copy will overwrite all resources
on the target Gateway.
Project Backups are far less inclusive. These only contain project scoped
resources, such as Templates, windows, transaction groups, or an entire
project. Tags are not included in a Project Backup, except for Client Tags,
which are project scoped. While smaller in scope, Project Backups can be
merged into an existing project, allowing you to easily add resources from
one project into a different project.

©2019 Inductive Automation 379


Backups

Gateway Backup/Restores
Gateway Backup
Backups can be made by going to the Configure section of the Gateway and
selecting System > Backup/Restore on the Ignition Gateway. Click the
Download Backup button and save the file somewhere safe, ideally
somewhere that DOES NOT reside on the same machine running the
Gateway.
Backups save the user data inside the Ignition Gateway server. This includes
all projects, drivers, images, and configuration, but not the modules.

Gateway Restore
Restoring from a backup is done from the System > Backup/Restore on
the Ignition Gateway. Click Choose File, navigate to your backup file, and
then click Restore. The Gateway will restart itself to apply the restored
settings.

380 ©2019 Inductive Automation


Backups

Creating a Scheduled Backup


Any time you are developing in Ignition, it is a good idea to take regular
backups. Ignition can even do this for you automatically with the Scheduled
Backup Settings.

1. To activate the Scheduled backups, in the Config section of the Gateway


Webpage go to the Gateway Settings page.

2. Scroll down to the Scheduled Backup Settings section.

3. Select the Enabled Scheduled Backups option.

4. Fill in a folder path for the Backup Folder option. This can be a local folder
like C:\Backups, or a shared network drive like:
\\StorageComputer\IgnitionBackups

©2019 Inductive Automation 381


Backups

It is always recommended to store backups away from the computer


Ignition is installed on. This way if the Ignition computer crashes, you still
have access to your backups. In a pinch, you can install Ignition again and
load the most recent backup to get running quickly.

Project Backup/Restore
You can also backup your Projects individually. When doing this, remember
that Gateway scoped resources are not part of the project. These backups
do not include Tags, Device connections, Database connections, etc.
To make a Project backup, go to System > Projects on the Ignition
Gateway. Click the More button and the export option. This produces a
*.zip backup file that can be imported directly into another Gateway from
the same page.

You can also make a project backup from the Designer. Click on File >
Export and a window will open that allows your select which resources to
export.

382 ©2019 Inductive Automation


Backups

Importing from the Designer uses the same resource selection window as
the Export window, and it will cause a merge directly into the currently open
project.

©2019 Inductive Automation 383


If you are making a project backup, you will most likely want to back up
your Tags as well. From the Designer, select the Tags folder (or any other
combination of Tags/folders) in the Tag Browser. Then click on the Tag
Export button to export all of your Tags.

384 ©2019 Inductive Automation


©2019 Inductive Automation 385
386 ©2019 Inductive Automation

You might also like