Programmer's Guide 3 © 2011 Inductive Automation Table of Contents Part I Intro

Programmer's Guide 3 © 2011 Inductive Automation Table of Contents Part I Introduction 6 ................................................................................................................................... 6 1 Welcome to the Ignition SDK ................................................................................................................................... 6 2 What can you do? ................................................................................................................................... 7 3 Prerequisite Knowledge ................................................................................................................................... 7 4 Technical Documentation ................................................................................................................................... 7 5 Getting Help Part II Getting Started 10 ................................................................................................................................... 10 1 The Ignition Platform ................................................................................................................................... 11 2 SDK Structure ................................................................................................................................... 12 3 Development Cycle ................................................................................................................................... 12 4 Environment Setup ................................................................................................................................... 13 5 Anatomy of a Module ................................................................................................................................... 15 6 Scopes, Hooks, and Contexts ................................................................................................................................... 15 7 Useful Utility Classes ................................................................................................................................... 17 8 Key Design Concepts .......................................................................................................................................................... 17 Overview .......................................................................................................................................................... 17 Logging .......................................................................................................................................................... 18 Storing Configuration Data .......................................................................................................................................................... 19 Extension Points .......................................................................................................................................................... 19 Programming for Redundancy .......................................................................................................................................................... 20 Localization .......................................................................................................................................................... 21 Style and Naming Conventions Part III Programming for the Gateway 24 ................................................................................................................................... 24 1 Getting Started - The GatewayModuleHook ................................................................................................................................... 24 2 Providing Status Information ................................................................................................................................... 25 3 Protecting Modules with the Licensing System ................................................................................................................................... 26 4 Storing data with PersistentRecords ................................................................................................................................... 29 5 Projects and Project Resources ................................................................................................................................... 31 6 Extending Ignition with Extension Points ................................................................................................................................... 32 7 Storing History using Store and Forward ................................................................................................................................... 33 8 Working with Platform Services .......................................................................................................................................................... 33 Databases .......................................................................................................................................................... 34 Execution Scheduling .......................................................................................................................................................... 35 Auditing .......................................................................................................................................................... 36 OPC .......................................................................................................................................................... 37 SQLTags .......................................................................................................................................................... 38 Alerting © 2011 Inductive Automation Part IV Programming for the Designer 42 ................................................................................................................................... 42 1 Working with Project Resources ................................................................................................................................... 44 2 Building a Workspace ................................................................................................................................... 45 3 Creating Menus and Toolbars ................................................................................................................................... 46 4 Supporting Search and Replace ................................................................................................................................... 47 5 Supporting Undo and Redo ................................................................................................................................... 48 6 Designer to Gateway Communication (RPC) ................................................................................................................................... 49 7 Gateway to Client Communication (Push Notification) ................................................................................................................................... 51 8 Providing Progress Information Part V Vision Component Development 54 ................................................................................................................................... 54 1 Module Structure ................................................................................................................................... 54 2 Component Overview ................................................................................................................................... 55 3 BeanInfo Classes ................................................................................................................................... 56 4 Designer Hook Part VI OPC-UA Driver Development 60 ................................................................................................................................... 60 1 Three Steps to a UA Driver .......................................................................................................................................................... 60 Implement the Driver Interface .......................................................................................................................................................... 60 Implement the DriverMeta Interface .......................................................................................................................................................... 61 Register Your Driver Part VII Examples 64 ................................................................................................................................... 64 1 Component Example ................................................................................................................................... 64 2 SQLTag Provider Example Index 0 Part I Introduction Introduction 6 © 2011 Inductive Automation 1 Introduction 1.1 Welcome to the Ignition SDK Ignition was designed to be a powerful industrial application platform, built from the ground up to support extensibility through a modular architecture. In fact, nearly all of the commercial pieces associated with Ignition, such as SQLBridge, Vision, and OPC-UA, are modules built with the same SDK that you have in your hands. As a platform, Ignition provides a variety of services that dramatically reduce the time and effort required to develop top-quality industrial applications. Instead of worrying about the OPC specification, or how to efficiently handle database connection pooling, you can focus on achieving your main goals. Using the SDK, you'll be developing modules that are loaded into the platform and given access to everything it can do. In addition to using these services, in many cases modules can extend them to provide additional implementations, such as adding a new way to authenticate users. Modules can provide new components for Vision screens, create new workspaces in the designer, and add drivers that expose data through OPC-UA. In short, if you can dream it, it's likely the Ignition platform can help you do it. This document is written to be a friendly reference guide to the platform, and to provide all of the information you need to get started with the SDK. Certainly some parts of the SDK might not be covered as well as they could be, and we always encourage feedback on this point, though when coupled with the technical documentation (the JavaDocs) everything should at least be represented. As questions come up, or you come up with ideas for way the platform could be improved, we encourage you to contact us, preferably through the Module SDK Forum on our website. We hope that you will find programming for Ignition as exciting and fun as we've found the process of building it, and look forward to seeing the great things you create with the SDK! Happy programming, The Inductive Automation Development Team 1.2 What can you do? An Ignition module can do anything you might imagine. The scope of an Ignition module is extremely broad - from adding something minor to complement the framework, or leverage the framework to create an entirely new product. Modules can even add new functionality to other modules! Here's some ideas, in no particular order, to help spur creativity: Write an ethernet driver for a PLC or other device. Add a visual component to the Vision module. Incorporate an existing 3rd party Java library to include some new technology Insert new useful functions into the scripting system Create a new authentication profile type Add some sort of industry-specific suite of functionality Implement a numerical analysis that Ignition doesn't yet include Introduction 7 © 2011 Inductive Automation 1.3 Prerequisite Knowledge To be successful with the Ignition Module SDK, you'll need to be acquainted with a few core programming technologies and concepts. Java SE Java is the language that Ignition is written in, and the language that modules must also be written in. Therefore, to even get started with the SDK, you'll need to have a decent foundation in the Java language and framework. Concepts such as package management, classpaths, and JAR files are frequently used in the development of Ignition modules. See also: Oracle's Java Developer Portal: http://www.oracle.com/technetwork/java/index.html Ant Ant is build file system used by Ignition. While not strictly necessary for module development, understanding and using Ant will make things much easier. Each example project includes an Ant build file which can be modified and adapted as necessary. See also: Apache Ant homepage: http://ant.apache.org/ Ignition Of course, to build an Ignition module, it's helpful to have good background in working with Ignition itself. You should have a good understanding of how many of the platform services work and are configured through the gateway, such as database connections, authentication profiles, SQLTags providers, OPC connections, and projects. For some targeted project types, such as a device driver for OPC-UA, a wide knowledge of the platform isn't necessary, but you should still be acquainted with how the existing drivers are configured and used. 1.4 Technical Documentation In addition to this document, another crucial piece of information for developers working with the SDK is the JavaDocs for the API. That library, compiled off of the source code, provides information about all of the classes and interfaces in the API. The information in this document will often refer to code objects that will be further documented in that system. Additionally, it's useful to consult the JDK documentation provided on Oracle's Java portal. When doing this, however, remember that the gateway is compiled against Java 6, but designer/client code is compiled against Java 5, so take care to only use the facilities appropriate to the scope of module you're developing. 1.5 Getting Help If you run into a problem with the SDK, or aren't sure how to accomplish something, the module SDK forum on the Inductive Automation website is the place to go! There are a wide range of users who have experience building modules, and it is frequently checked by the IA development team. For more general questions with Java, Ant, etc., the internet has a wealth of resources. StackOverflow. com is a particularly good place to ask questions, though you generally can't go wrong typing nearly anything into Google. Introduction 8 © 2011 Inductive Automation For developers who would like to jump-start their dev process, Inductive Automation hosts periodic Module Development Bootcamps, and can also host private training events. More information about these events can be obtained by calling the sales department at 800-266-7798. Resources Inductive Automation Forum: http://www.inductiveautomation.com/forum Email: developers@inductiveautomation.com Part II Getting Started Getting Started 10 © 2011 Inductive Automation 2 Getting Started 2.1 The Ignition Platform The "Ignition Platform", as we refer to it frequently throughout this document, is the base of the Ignition product and provides the groundwork upon which modules, including your own, can be built. When we refer to the platform, we are referring primarily to the publicly accessible functions that can be used by modules. Occasionally, though, we simply use it as a convenient way to describe Ignition independently from any particular modules. The various sections and chapters of this guide will outline the functionality provided by the platform, first at a high level, and then further in depth. Despite the fact that we refer to the Ignition Platform as a single unit, there are really two distinct components to it: the gateway portion, and the designer portion. There is a third (as we refer to them later, "scope"), the client, but compared to the first two, its role is minimal. The structure of this document clearly reflects this main division, with separate chapters for programming for the gateway and for the designer. Understanding this structure will help you uploads/Management/ programmers-guide.pdf

  • 30
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager
  • Détails
  • Publié le Sep 17, 2021
  • Catégorie Management
  • Langue French
  • Taille du fichier 2.8573MB