9 Perspective Tips for Ignition Developers
Ignition 8.0 with the Perspective module is now in public beta. It is a good time to explain some of the differences in the Perspective environment in terms of the Vision module. Perspective has a lot of the same features as Vision implemented in a slightly different way given the new web-based architecture. It also has some improvements on Vision to make development easier.
Let’s dive into things, and please let us know if you have any questions about Perspective! We have built a handful of applications already with plenty more on the docket. We have also worked closely with Inductive Automation to fully understand the current implementation, and where they are headed.
You probably use some form of Software as a Service (Saas) application now, or have used a web browser to access your email before. If you think of Perspective as a web-based version of a Vision client you will be in the right ballpark. Instead of accessing your email you are interacting with Ignition, and the same concepts as any SaaS application apply here.
A major difference between Vision and Perspective is the ability to use Identity Providers in Perspective. This allows Perspective to be more in line with a typical web-based system. These include OpenID and SAML providers, which are in use in many SaaS applications currently. These Identity Providers are in addition to the built-in Ignition and Active Directory user sources you are already familiar with.
More information on using Identity Providers in Perspective is available here.
The concept of a client in Perspective is known as a Session. When you navigate to a Perspective page in a browser or in the Perspective Mobile app, you are using a Session. Each session is made up of individual web pages similar to any SaaS application. You can load the pages by navigating to them in various ways, and each page will be made up various views, each made up of components. This is very similar to how windows are structured in Vision.
For more information on Sessions in Perspective, check out the Ignition docs available here.
Pages in Perspective are analogous to the windows in a client in Vision. Each page will contain the various views and components you will interact with in your application. You navigate to pages similar to how you would navigate to a window in a Vision client.
Each page is accessible via a URL in your browser, and form the basis of everything you will build in Perspective.
More information on Pages is available here.
Views in Perspective are sort of a hybrid of windows and templates in Vision. They can be the foundation of an entire page in the Perspective application, either as a primary, docked, or popup View, or you can embed them inside of another view similar to Templates in a Vision application. Each view has a root container similar to a window in Vision, and allows you to place components in the view to build your application.
Views, like root containers in Vision, have custom parameters you can use for all components in the view. You can also set properties use to manage the appearance of the view, and parameters you can use to interact with pages or other views.
Views and containers cannot be covered completely in a post like this, and are the meat of what you will develop in Perspective. More info is available here.
Containers are a special type of component in Perspective. They handle the various layout strategies available to you, enabling Perspective to be a responsive mobile application. Containers make it possible to build a single page you can use on any device without having to reconfigure everything for different size displays. Of course you include different views according to display sizes, but Perspective automatically manages what the user sees based on their device.
Containers make Perspective a truly mobile friendly experience, much as you would expect from any web-based system in 2019. More info on Containers is available here.
6. Styles and Themes (CSS)
In addition to Containers, one of the most powerful additions to Perspective is the inclusion of CSS for styling. CSS is a very powerful tool in the web development world, allowing you to build a global style to your entire application. It allows you to go well beyond a similar approach we take with color palettes and style tags, and gives you a global setting for any and all styles on any components, views, pages, etc.
Perspective allows you to apply styles globally using Style Classes, as well as on a per-component basis with In-Line styles. This gives you a very flexible way to handle anything you might want to build.
More information on styles in Perspective can be found here.
7. Message Handling
If there is a “killer app” function in Perspective, it is the Message Handling system. We covered it in more detail than we will here in our First Look at Perspective. Basically you build messages, and components listen for these messages and execute code when they receive the messages from other components. You can then execute the messages similar to executing code in a Vision action on a component and build very complex systems with simple building blocks.
This allows you to keep scripts simple by executing code on a component directly, instead of updating it from another component. Think about a table showing data from a database. In Vision you would write a script on a button to refresh the table when it is clicked. If you want to see what is happening on the table you need to look at the button scripts. This can be complicated for development and maintaining applications. In Perspective you would simply execute a “RefreshData” message when you click the button, and have a “RefreshData” Message Handler on the table. Now you can simply look at the table’s scripts to see what is happening with it. This streamlines development and troubleshooting immensely.
Read more about Message Handlers here.
8. Session Properties
Session properties are the Perspective Equivalent to Vision’s Client Tags. They allow you to have global variables you can use across all pages and views in a session. These are important in a Perspective project as web-based systems are usually “stateless” and require you to send any relevant information as part of the request when you access a page. This goes well beyond the scope of an overview article like this, but suffice to say Session Properties are something very useful to have in Perspective when bridging the gap from standard Ignition programming to a more web-centric mindset with Perspective.
9. URL Navigation
You can navigate to any page in Perspective with a URL in a browser. Since Perspective is a web-based platform, you can also use the standard concept of URL parameters. Using parameters as part of a URL you can pass values into a page when opening it. This is useful when you are using a standardized architecture, and would allow you to specify a particular equipment ID to view many pieces of equipment using a single page similar to using a template in Vision.
Using URL Navigation, you can also easily build links into other systems to pull up a relevant Perspective page directly from any other piece of software.
These are the major differences when moving from Vision to Perspective. If you have used Vision before Perspective will feel very familiar. While you will have to think of a couple things in a different way, you will pick it up quickly. If you have any experience with web development it will gel even more quickly. You will see the essence of any web-based development methodology in Perspective, and how it seamlessly integrates with the platform as a whole.
Perspective is a powerful tool in the Ignition arsenal, and will enable powerful solutions when integrating plant floor systems with other web-based systems like ERPs and warehouse management systems.
We are very excited to see Perspective gain wide adoption across the Ignition landscape, and are happy to help you learn how to get the most out of it once you start rolling it out yourself!
Want to see more Ignition? Check out our Ignition Explained video series!