Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unlocking the Development Power of Ignition with Python Scripts

Similar presentations


Presentation on theme: "Unlocking the Development Power of Ignition with Python Scripts"— Presentation transcript:

1

2 Unlocking the Development Power of Ignition with Python Scripts
Kevin McClusky Co-Director of Sales Engineering Travis Cox Co-Director of Sales Engineering

3 257 Functions!

4 Session Intro Welcome! This session focuses on Python in Ignition
First 30 minutes: Practical examples Final 30 minutes: Advanced functions for Python experts

5 Other Options Welcome! If you found yourself in this session by accident, these are the other sessions right now. Megatrends That Impact Industrial Automation Craig Resnick, VP, ARC Advisory Group Building Future-Proof Utility Systems Dee Brown, Principal & Co-Founder, Brown Engineers, LLC

6 Scripting in Ignition Why? Lots of functionality under the hood
Ability to do file interactions, data processing Multi-step processes, multiple steps, conditional execution

7 Python Review Python Basics Simple Types Integer Float String Boolean
None

8 Python Review Python Basics Complex Types Other objects List Tuple
Dictionary Other objects Functions Classes

9 Python Review Python Basics Flow Control if elif else for while

10 Ignition Scripting API
Wide range of functions Ignition scripting API Functions! system.alarm system.dataset system.date system.db system.device system.dnp3 system.eam system.file system.groups system.gui system.nav system.net system.opc system.print system.report system.security system.serial system.sfc system.tag system.twilio system.user system.util

11 Practical Examples Practical Examples
We’ll focus on a few specific examples of scripting in Ignition. Some best practices will be demonstrated along the way.

12 Practical Examples Demo
System.gui.transform, animations Write to multiple tags / devices Adding column to dataset

13 Advanced Python Topics Jython Libraries
Gateway vs Client scripts, scopes Possible Pitfalls Tips and Tricks

14 Jython Python in Ignition Language Interpreter Language Specification
system.gui.messageBox(“Hello World”)

15 Scripting Libraries Library Access in Ignition Ignition scripting API
system.gui.messageBox(“Hello World”) Ignition scripting API Python Standard Library Java Class Library

16 Scripting Libraries Extended Library Access in Ignition
system.gui.messageBox(“Hello World”) Ignition Module provided Functions Python Additional Libraries Java Additional Libraries

17 Advanced Python Script Scoping Gateway Scripts Client Scripts
Client interaction with Gateway

18 Advanced Python Possible Pitfalls Infinite loops
Heavy scripts with data processing Gateway communication from clients with loops and high latency connections Exception processing Memory consumption / global variables / socket consumption Gateway scripts vs clients scoping

19 Advanced Python Tips and Tricks Python list slicing list = [1,2,3,4,5]
print list[2:4] print list[:3] print list [3:5:2] print list [5:1:-1]

20 Advanced Python Tips and Tricks List comprehensions list = [1,2,3,4,5]
newList = [] for item in list: newList.append(item*2) list = [1,2,3,4,5] newList = [item*2 for item in list]

21 Advanced Python Tips and Tricks A Couple Keyboard Shortcuts:
system. <Ctrl-Space> Ctrl-F, R, F3

22 Advanced Python Tips and Tricks 7.9 – Multi-Window support
system. function for opening and accessing separate windows

23 Advanced Python Tips and Tricks Globals
globals = system.util.getGlobals() globals[‘myvar’] = “myValue”

24 Advanced Python Possibilities in Scripting
Communication via REST / json WebDev RESTful Endpoint File Parsing / processing Large enterprise GN configuration: Message handling and distribution

25 Advanced Python Only for expert developers
Java swing component access through scripting Ignition Module SDK access through python type(), dir() Ignition Module script function additions

26

27

28


Download ppt "Unlocking the Development Power of Ignition with Python Scripts"

Similar presentations


Ads by Google