Ignition Core Manual
Ignition Core Manual
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.
Welcome ..................................................... 1
About this Training . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
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
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.
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.
Installation and
Activation
3. Click Next.
4. Click the I have read and agree with the terms and conditions
button and click Next.
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.
Commissioning
Once the Ignition service starts, a web browser will open and you will be
prompted to start the commissioning process.
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: ____________________
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.
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.
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.
2. On the Gateway home page, click on the Config button in the top left
corner.
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.
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.
When an individual module is in trial state, Ignition shows the trial time
remaining at the top of the Gateway webpage.
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.
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.
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.
2. From the menu on the left, select OPC UA > Device Connections.
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.
7. Now we can set the program for the simulator. On the right, click on the
More dropdown and select edit program.
9. You will see many instructions appear. This is how the simulator creates
Tags and sets their values. Click the Save Program button.
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
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.
The Device details page is displayed showing the available settings for AB
Logix v21+ devices.
Name: CLX
Hostname: 172.16.3.103
Slot Number: 0
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.
The Device details page is displayed showing the available setting for AB
MicroLogix.
Now you have installed 3 devices that are all connected as shown below:
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.
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)
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.
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.
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.
The first screen that opens allows you to create a desktop shortcut. Click
Next to continue.
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.
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.
11. Enter the username and password that you created when installing
Ignition.
Creating a Project
Now, the Open/Create Project window is displayed. Initially, we have
no projects so we must create one.
2. In Project Name, enter a name for your new project (no spaces).
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!
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.
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.
2. Click on the Download for Windows button at the top of the page.
4. First decide whether you want a desktop shortcut and click the Next
button.
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.
8. If your Gateway does not show up, click on the Add Vision Client 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.
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.
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.
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.
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.
Renaming a Window
To rename a window, from the Project Browser panel, right-click on a
window and choose Rename or press F2.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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.
You can choose between two layout modes: relative and anchored.
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.
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.
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.
3. Select the Top and Left layout options, and make sure the other options
are deselected. Press OK.
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.
5. This is more noticeable if you make the Designer window small and the
Client large.
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.
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.
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).
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
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:
2. On the Fill Paint property, click on the Edit icon on the right of the
Property Editor to open the color wheel.
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.
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.
1. No Cycle - The first and last stops are continued forever after the edge of
the paint bounds.
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.
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 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.
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.
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.
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.
8. Expand the property tree and select the Slider -> Value property.
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.
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.
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}
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.
Tags
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.
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
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.
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.
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.
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.
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:
• Value - This section is where the Tag gets its data from. For an OPC Tag
like the simulators, that means the OPC path data.
• 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.
2. Drag the Ramp 1 Tag from the Ramp folder onto the window (which is
the Root Container).
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.
The Property Binding window is displayed showing you that the Value
property is bound to the Ramp1 Tag.
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.
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.
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.
• OPC Tag - An OPC server and address which drives values. The OPC
address is subscribed at the rate of the Tag's Tag Group.
• 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.
• 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.
1. From Tag Browser, right-click on Tags or a folder of your choice and select
New Tag > New Standard Tag > Memory Tag.
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.
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.
4. This Tag type has both Read and Write expressions. Find the Read
Expression property and click on the Edit icon on the right.
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.
Now when we write to the Tag, it will send a modified value back to the
source Tag.
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.
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:
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.
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.
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.
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.
1. In the Tag Group Editor, click on the Add icon to add a new Tag Group.
3. Click OK to save.
4. Set the Tag Group on the Tags to use this new Leased Tag Group.
5. To test your Tag Group, Edit an Ignition Tag to use this group and drag it
onto a window.
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.
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:
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.
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.
• 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.
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.
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.
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.
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.
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.
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.
You can create a single instance of the motor or use the multi-instance
wizard to rapidly create all four at the same time.
2. Right-click on the Motors folder and select New Tag> Data Type
Instance> Multi-Instance Wizard.
Note: you will have to make the Instance Creation Wizard window taller to
show the Parameter Pattens table.
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.
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.
8. Click on the Add Tag icon on the top-left of window and select
Memory Tag.
Name: HighSP
Date Type: Integer
Value: 40
10. Click OK to save. Notice that each instance automatically gets the new
Tag.
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.
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.
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.
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.
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.
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.
Now we can bind the Value of the LED Display to the AMPS Tag of
MotorUDT.
6. In the property tree, expand MotorData and select the AMPS tag.
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.
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.
Ignition displays some meta information so you know exactly which Tag
the UDT is pointing to, we will bind to that.
12. In the property tree, expand MotorData and Meta, and select the
TagName property.
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.
15. Select any motor in the Motors folder and drag it to the template.
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.
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.
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.
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:
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.
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.
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.
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.
4. Stretch the component to be wide and short so the buttons look nice.
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.
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.
Motors/Motor 1
Motors/Motor 2
Motors/Motor 3
Motors/Motor 4
The only difference between each motor is the number.
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:
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.
Value Label
1 Motor 1
2 Motor 2
3 Motor 3
4 Motor 4
8. Set the Selected Value property to 1. Notice the values for Selected
String Value and Selected Label fill in for you.
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.
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.
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.
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.
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.
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.
1. Select every Tag in the Realistic folder, right-click and select Edit Tag.
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.
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.
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.
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.
2. In Tag Editor, click the AMPS Tag, and under History set History Enabled
to true.
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.
5. Click OK to save.
That's it. Now every motor instance automatically starts logging data.
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.
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
Create a Graph
Before we create a chart for historical data, we need a new window to
display it.
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.
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.
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.
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.
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.
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.
3. To set the items to select from, click on the Dataset View icon to the
right of the Data property.
The Value is used behind the scene and Label is what is displayed to the
user at runtime.
Once you select an option, the values are displayed as properties on the
drop-down list.
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.
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.
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.
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.
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.
Creating Tables
In addition to the graphical display of historian data, we can also show the
logged data in tables.
2. Set the Layout to Anchored, and select only the left, right, and bottom
buttons.
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.
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.
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.
7. Click OK.
Now you can see raw data coming back in the table.
• 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.
• Closest Value returns the most recent actual value to the end of the
window.
• 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.
• On Change means that you'll get an entry whenever any of the Tags
under consideration changes.
• 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.
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.
9. Execute any writes to other Tags or the Database that result from
execution.
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.
Common Settings
The following are the common settings in transaction groups:
• 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
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.
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
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.
4. Drag all the Ramp Tags from Tag Browser into the Basic OPC/Group Items
table.
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.
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.
You will notice the group will have a green arrow in the Project Browser
letting you know the group is running.
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.
1. Before we get started, verify that the Designer’s Comm Mode is set to
Read/Write.
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.
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.
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.
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.
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.
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.
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:
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
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.
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.
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.
5. Multi-Select the SP1 and SP2 Tags and drag them onto the screen as LED
Display components.
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.
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].
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.
Notes
A place for any free-form documentation about the alarm that can be
displayed to operators.
Shelving Allowed
If this setting is true, the shelving feature is Available for this alarm.
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.
• 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.
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".
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.
1. Go to the Designer.
3. Scroll down to the Alarms property, and click the Edit icon to configure
an alarm.
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:
6. To select the condition for when the alarm is active, enter the following:
Mode: Equal
Setpoint: 1
7. Leave the rest of the settings alone for now and click Commit to save the
changes.
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.
2. Shift-select all of the Realistic Tags. Right-click on one of them and select
Edit Tags.
4. Click on the + icon to add a new alarm state and fill in the following
properties:
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.
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.
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.
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:
And now only the WriteableBoolean alarm is shown in the Alarm Status
Table.
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.
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.
1. Double-click on the Motor UDT in the Data Types folder to edit the UDT.
3. Scroll down to the Alarms property, and click the Edit icon to configure
an alarm.
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.
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.
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.
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.
1. Double-click on the Motor UDT in the Data Types folder to edit the UDT.
3. Scroll down to the Alarms property, and click the Edit icon to edit our
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.
8. Select the Tag button, and the UDT tab to select one of the UDT
members.
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.
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.
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.
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.
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.
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.
10. Do the same thing for the End Date property, binding it to the End Date
of the Date Range component.
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.
To use it in the runtime, simply click on the Focus icon in the bottom
right and select Target Alarm Source.
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.
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.
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.
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.
You can add users from any authentication profile, and rosters can be
made up of users from multiple profiles.
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.
You may have several options available here, they are dependent on what
modules you have installed.
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.
Name: Email
Hostname: localhost
Two-way Enabled: True
Gateway (under Two-way settings): localhost:8088
That's it! You can now use the profile in notification pipelines.
Pipeline Blocks
Blocks are described individually in the next section, but here is a brief
overview.
• Delay blocks the alarm event for the specified amount of time.
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.
• 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
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.
Here you can create one or more pipelines. Let's create a simple pipeline
to send out email notifications when alarms occur.
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.
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.
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.
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.
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.
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.
Now when the WriteableBoolean1 alarm becomes active, it will go into the
START block of the pipeline.
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.
17. Trigger the WriteableBoolean1 alarm, and you will see exactly where
the alarm is in the pipeline.
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.
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.
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
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.
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.
15. Connect the TRUE pin of the Expression block to the IN of the Notification
block.
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.
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.
2. Under the Configure section of the Gateway Webpage, select Security >
Users, Roles.
1. Click on the Roles tab and click the Add Role... link.
Username: oper
password: password
Roles: check the Operator box
4. Finally, we’ll add a "guest" user with no roles. Click on the Users tab and
click the Add User link.
Username: guest
password: password
Roles: Leave both role boxes unchecked.
Component Security
Now that we have some users to work with, let’s configure some security on
a window.
3. Add four Multi-State buttons to the window from the Buttons tab. Any
other input component will do just as well.
The user must have the Administrator role in order to use the Button.
Now the component will be disabled if the user does not have the
Administrator role.
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.
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.
4. Try it out in the Client. When you don't have privileges you get this
message:
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.
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.
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.
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.
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.
Popup Windows
3. Give the new window a name of Motor Details, and hit enter.
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.
7. In the Custom Properties window, click the Add icon to add a new
custom property.
9. Click OK.
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.
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.
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.
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.
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.
21. Select the Numeric Text Field component. In the Property Editor, set the
Number Type property to Float.
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.
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.
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.
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....
37. Select the Open/Swap radio button, make sure Open radio button and
the and Center checkbox are both selected.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
14. Click OK to commit the changes to the chart. You should now see the
pens in different subplots on your chart.
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.
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.
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.
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
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.
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} + " *"
6. Click OK to save the expression. You should now only see alarms for the
current motor in the Alarm Status table.
Scripting
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.
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.
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
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.
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.
var="abc"
print var
The above code will print out "6" and "abc" to the console when the
button is pressed.
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.
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).
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.
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"
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.
You can also use a list that you create, with the list containing any
number of any type of objects.
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.
1. Create a new Button component on the window and open the scripting
window.
Both prints will display the same sentence in the Console using different
methods to create them.
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.
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.
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
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.
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.
3. Open the script editor window for the actionPerformed event on the
Button component.
# 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.
These component functions are unique to each component and can enable
you to manipulate the components in interesting ways.
1. We can use the Power Table that we used in the previous example, so
select it.
3. Click the Enabled option at the top of the window so you can modify your
custom function.
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.
6. Press OK to see it in action. You will notice that every other line in the
Power Table is now a light gray.
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 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
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.
2. Right click on the Project Library and select New Script. Give it a name
of “myScripts”.
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 ")
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.
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.
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.
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.
• 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.
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.
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 ‘/’.
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.
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.
Name: MotorView
Layout: Flex
2. In the Property Editor, change the size of the View to have a width and
height of 200x200.
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
orientation: row
grow: 1
basis: 70px
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:
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".
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.
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.
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.
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.
4. Click OK.
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.
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:
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.
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.
5. Click on the value and type in a valid motor number like "2".
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.
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.
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.
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.
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.
8. Click OK.
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.
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.
1. Deep select the Coordinate container and select the top motor image
component.
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.
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.
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.
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.
4. Click OK.
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.
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.
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
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.
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.
This shows the default motor, but we can change it in the same way as
the Embedded View in the previous example.
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.
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.
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.
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.
2. Enter the following values for the new view, make sure to check the Page
URL checkbox:
Name: Breakpoint
Layout: Breakpoint
Page URL: false
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.
6. In the Property Editor, set the path property of the Embedded View to
Coordinate. Unlike the MotorView, we have no parameters to set.
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.
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.
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.
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.
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.
2. In the Project General section, click the Expand icon and select an
Identity Provider that the project will use.
Now that you have chosen an IdP, there are then three places where
security can be enabled.
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.
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.
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.
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.
3. Right-click on the New Report, choose Rename or press F2, and name
it Basic Report.
You will see five sections to the report: Report Overview, Data, Design,
Preview, and Schedule:
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.
5. Under SQL Query Builder, set the dropdown to MSSQL, this will tell the
builder what syntax to use.
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.
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.
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.
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.
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.
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.
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@"
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.
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.
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.
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.
3. Drag the history dataset into the Table’s Data Key field.
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.
6. Select the Table and go to the bottom of the Property Inspector. Click
on the Header and Summary checkboxes to activate these rows.
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:
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.
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: *
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())
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.
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.
3. Select your Report from the Report Path property. You will see it
populate immediately with 8 minutes of data.
4. To make the report time range dynamic, we will add a Date Range
component to the window.
Gateway Network
Connect to a Gateway
Let’s set up a connection to the instructor’s Gateway.
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.
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.
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.
6. Go into your Designer and find the Tag Browser. Expand the All Providers
folder and you should see your new Tag Provider.
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.
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
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.
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.