1/103
Flashcards about Ignition Scripting, Python, Perspective, and Reporting
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Scripting
Offers flexibility and customization where standard options fall short in Ignition.
Python and Expression Language
Two major scripting languages in Ignition.
Python in Ignition
A general-purpose programming language developed in the early 90s, widely used and interacts gracefully with Java, which is essential for Ignition as it is written in Java.
Jython
An interpreter that converts Python to Java.
Python 2.7
The version of Python used in Ignition, due to Jython's current version.
Monty Python
The 70s-era British comedy group, the language Python is named after.
Script Console
A simple interactive editor in Designer for writing and executing Python code.
Print Keyword
A handy tool in Python for displaying text in the output console, useful for debugging scripts.
Syntax
The grammar of a programming language, ensuring the interpreter understands the code's instructions.
Basic Syntax Rules
Case sensitive and whitespace sensitive.
Comments
Notes left in the code to describe its function, ignored by Python but useful for understanding and maintaining the code.
Keywords
Vocabulary of a programming language; coding environments in Ignition highlight these in bold and blue, and they are case sensitive.
Event Handling
Enables scripting to respond to a wide variety of events, crucial for interactive windows Vision and Perspective projects.
Variables
A way to store a value for later use, identified by a name.
Data Types
Used to differentiate between values in Python; includes Strings, Integers, Floats, and Booleans.
Strings
Any sequence of characters, usually text.
Integers
A whole number.
Floats
Decimal numbers.
Boolean
A value that is either True or False.
Loosely Typed Language
A language where you do not need to declare the data type when you define the variable. Instead, Python will look at the value you assign and decide on the data type for you.
Variable Names
Must begin with a letter or underscore and can contain letters, underscores, and numbers after the first character.
Camel Case
A method of writing multi-word variable names, removing spaces and capitalizing the first letter of every word except the first.
Script Console Limitations
Won’t save our work if you close Designer, cannot interact with components on a window.
Button
It is a simple component that does not do anything on its own until you write script of some kind to get a Button to work.
Navigation Tab
Allows us to navigate somewhere–most often, another window—when the button is clicked.
Set Tag Value
States a specific Tag will hold a given value upon button click.
SQL Update
Triggers a query to the database to update values on clicking the button.
Set Property
Changes the property of a component to a different value when clicking the button.
Script Editor
The tab is where you write your own code.
OK Button
Saves the changes made in the dialog and closes it.
Apply Button
Saves the changes in the dialog but leaves it open.
Non-Modal Dialog
A dialog box that can stay open because we can still interact with the rest of the program.
Console Panel
Can display the results of executing a print statement, and also display errors if they occur.
Modulo
This is the remainder of a division problem.
If Block
In Python, you can create it to perform basic binary logic; that is, evaluate a value and do something if that evaluation is true, and something else (or possible nothing) if it is false.
Else Statement
Needs to be at the same level of indentation as if, and the statement to execute on else needs to be indented the same amount as the statement to execute when the if statement is true.
Elif
Short for “else if”, allows you to check another condition when the previous one is not met. This form can optionally have a catch-all else clause at the end.
Lists
Allow us to store multiple data points in a single object that can be then be referenced as a whole, but also still referenced as individual pieces as well.
Square Brackets
Used whenever we are creating a list.
Referencing Items in a List
You can reference an item in a list by using its index number. Python uses zero-indexing, meaning that the first item in the list is at index 0, and second at index 1, and so forth.
Adding to the List
You can add items to a list with the append() function. This function is called on the list using dot notation: you type the name of the list, then a period (dot), and then the function.
For Loop
Has one purpose: looping over a list.
String Concatenation
Adding several strings together using the plus symbol.
String Formatting
Allows you to enter values into specific points into the string.
Type Casting
Forcing Python to convert a variable from one type to another.
System Functions
Full of functions that are useful when designing projects in Ignition; built into Ignition to ease certain common tasks and interact with various systems in Ignition.
Message Box Function
Opens a modal message box on the screen, which is a fancy way of saying a dialog box that we must deal with before we can do anything else.
system.tag.readBlocking()
Function that reads from a Tag in Ignition using its path.
Documentation Appendix
A complete reference to Ignition components, Expression Functions, System Functions, and Reference Pages.
Component Extension Functions
Are pre-defined functions used to expand on the functionality of the component.
Client and Gateway Event Scripts
Are special events not based around components.
Project Script Library
A place where you can create your own script functions. These functions can be called from anywhere in the project, and are helpful when you have scripts that you need to use repeatedly.
Perspective
A module that allows you to create resources that enable a user to easily transition from Viewing the project on a computer to Viewing it on a mobile device
View
The basic thing we create in Perspective - Similar conceptually to both Windows and Templates in Vision
Page
A View in Perspective with an assigned Page URL, viewable directly from a web browser
Session
When we launch Perspective in the browser, we launch this - Conceptually similar to the Client in Vision
HTML
Hypertext Markup Language - Used to define the structure of a web page
CSS
Cascading Style Sheets - the standard for formatting on the web - All formatting, positioning, sizing, and layout of components and Views in Perspective is done with this
JavaScript
A scripting language, conceptually similar to Python, that is widely used on the web
JSON
JavaScript Object Notation - a lightweight, plain-text format for describing data
Coordinate Container
This container allows you to place components in arbitrary locations in the View and freely move and resize them.
Breakpoint Container
The Breakpoint Container allows you to embed Views at specific screen widths, and have the browser automaticlaly switch between them.
Flex Container
Allows you to create Views that can work on the widest variety of screen sizes
Smart Guides
A feature in Perspective that includes red guides as you drag a component in the View, that will help you to line up components with each other and with the View as a whole.
Anchor
The point around which an component will rotate.
Props
Basic properties of the components.
Position
Properties needed to position the component.
Custom
You can add custom properties to components.
Meta
Other properties, such as the Name of the component, can be found here.
Binding Preview
A feature in Perspective that you can always check to make sure that the binding is working before clicking OK.
Flexbox
A CSS technology that creates flexible layouts that can rearrange and resize parts of a page to fit on larger or smaller displays
Grow
This property allows a component to grow along the main axis, both in initial sizing and if the container grows in response to being displayed in a larger window.
Shrink
Works the same as Grow, but in the opposite direction: if the container gets smaller, the space for the components will be redistributed based on this value.
Basis
The starting size of the component, before remaining space is distributed
Deep Selection
Which container we want to set properties on and add new components to - Displayed as a crosshair icon
Perspective Custom Property Types
These are the choices because the underlying data for all properties in Perspective is JSON
Perspective Edit Binding Dialog Box - Binding Preview
Lets you confirm that your binding is correct before you close the dialog box.
Resizing the Coordinate Container
If you resize the MotorView, we will see that the components inside Flex containers resize based on the properties we set. The motor image, however, is in a Coordinate container with a fixed size, so it does not resize.
Breakpoint
The process where modern web designers create layouts to fit one screen, and then as that screen gets bigger or smaller, there will be points where the layout breaks
Classes
Components are defined in Perspective as style definitions.
Naming Classes
How you should name classes - Based on how they will be used rather than how they look
Element State
In CSS, this will define a set of style properties that we can have the browser automatically apply when a state is met
Identity Providers
Are used to authenticate users in a Perspective Session.
Security Levels
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
Client Reports
Allows users to dynamically view reports on any Window in your Client.
Reporting Module
Simplifies and enhances reporting from beginning to end.
Report Overview
A tab that is a collection of useful information about your report.
Data Tab
A tab where you define the data that goes into your report.
Design Tab
A tab that is the primary workspace when creating a report. You will add components such as tables and charts here, as well as static text elements like headers and page numbers
Preview Tab
A tab that is how you make sure the data is displaying correctly, during the design process.
Schedule Tab
A tab where you set up schedules so your report can automatically be printed, saved, or emailed.
Named Query
Use this to save SQL statements into the project for reuse.
SQL Query
Directly write SQL to query the database through this.
Basic SQL Query
This also allows you to directly write SQL to query the database. But it is an older method for writing queries that is maintained for legacy use.
Tag Historian Query
Use this to retrieve that data in a simpler way.
Tag Calculation Query
This query also relies on the Tag Historian, but allows you to perform calculations such as sum, average, and the like.
Alarm Journal Query
While the tables created for the Alarm Journal can be queried directly, this provides a simpler interface for working with that data.
Script
It’s possible to write a Python script to retrieve data. This can be used if you need to get data from multiple sources or pre-process the data.
Static CSV
Rather than retrieving data from a database, you can import a static CSV file, such as a file created in Excel, and use it for reports.
SQL Query Builder Tool
An interactive visual interface that which allows us to create most of the query.