Multiprocess System for Virtual Instruments in Python



Similar documents
Website Builder Overview

DiskPulse DISK CHANGE MONITOR

Programming with the Dev C++ IDE

Wakanda Studio Features

Python Documentation & Startup

Chaco: A Plotting Package for Scientists and Engineers. David C. Morrill Enthought, Inc.

Visual Basic Programming. An Introduction

Introduction to Python

GUI application set up using QT designer. Sana Siddique. Team 5

MASTERTAG DEVELOPER GUIDE

Online Data Monitoring Framework Based on Histogram Packaging in Network Distributed Data Acquisition Systems

imc FAMOS 6.3 visualization signal analysis data processing test reporting Comprehensive data analysis and documentation imc productive testing

How to create pop-up menus

Event Log. Chapter 7 Event Log Event Log Management Excel Editing Create a New Event Log... 9

How To Use Safety System Software (S3)

Image Management Suite. Mini Thesis. Roland Foster. Supervisors: Mr. Mehrdad Ghaziasgar and Mr. James Connan. B.Sc. Honours

Building and Using Web Services With JDeveloper 11g

Tutorial: Building a Dojo Application using IBM Rational Application Developer Loan Payment Calculator

MATLAB. Creating Graphical User Interfaces Version 6. The Language of Technical Computing. Computation. Visualization. Programming

ELEC 377. Operating Systems. Week 1 Class 3

WebSphere Business Monitor

SPHOL205: Introduction to Backup & Restore in SharePoint Hands-On Lab. Lab Manual

Web Development with R

Log Analyzer Reference

BogDan Vatra and Andy Gryc. Qt on Android: Is it right for you?

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Event Log. Chapter 7 Event Log Event Log Management Excel Editing Create a New Event Log... 10

Smart Connection 9 Element Labels

Source Code Translation

Visualization with ParaView. Greg Johnson

GRAVE: An Interactive Geometry Construction and Visualization Software System for the TORT Radiation Transport Code

Draw pie charts in Excel

Input and Interaction. Objectives

MayaVi: A free tool for CFD data visualization

IBM Unica emessage Version 8 Release 6 February 13, User's Guide

Microsoft Expression Web

INTERNET PROGRAMMING AND DEVELOPMENT AEC LEA.BN Course Descriptions & Outcome Competency

The Ultra-scale Visualization Climate Data Analysis Tools (UV-CDAT): A Vision for Large-Scale Climate Data

Quick Start Guide. Installation and Setup

KIVY - A Framework for Natural User Interfaces

Xtreeme Search Engine Studio Help Xtreeme

ProxySG TechBrief Implementing a Reverse Proxy

Search help. More on Office.com: images templates

CS412 Interactive Lab Creating a Simple Web Form

AUTOMATED CONFERENCE CD-ROM BUILDER AN OPEN SOURCE APPROACH Stefan Karastanev

A Modular Approach to Teaching Mobile APPS Development

VIRTUAL LABORATORY: MULTI-STYLE CODE EDITOR

Applications Development

Visual Dialogue User Guide. Version 6.1

Building Custom GIS Applications using Open-Source Toolkits A Case Study

imc FAMOS 6.3 visualization signal analysis data processing test reporting Comprehensive data analysis and documentation imc productive testing

Rich Internet Applications

MALAYSIAN PUBLIC SECTOR OPEN SOURCE SOFTWARE (OSS) PROGRAMME. COMPARISON REPORT ON NETWORK MONITORING SYSTEMS (Nagios and Zabbix)

AVS/Express - an object-oriented visual development tool

VisIt Visualization Tool

caqtdm Tutorial Jim Stevens APS Controls Group October 9, 2014

Using these objects to view the process of the whole event from triggering waiting for processing until alarm stops. Define event content first.

Getting Started with GRUFF

WebSphere Business Monitor V6.2 Business space dashboards

DATA 301 Introduction to Data Analytics Microsoft Excel VBA. Dr. Ramon Lawrence University of British Columbia Okanagan

Configuring iplanet 6.0 Web Server For SSL and non-ssl Redirect

Arena Tutorial 1. Installation STUDENT 2. Overall Features of Arena

Oracle Forms Developer 10g: Build Internet Applications

Chapter 7 Event Log. Click the [Alarm (Event Log)] icon, and [Event Log] dialog appears as below:

End-user Tools for Application Performance Analysis Using Hardware Counters

Chapter 7 Event Log. 7.1 Event Log Management

A send-a-friend application with ASP Smart Mailer

ACE: Dreamweaver CC Exam Guide

Chapter 7 Event Log Overview

Rapid GUI Application Development with Python

Backbase Accessibility

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

WebSphere Business Monitor

Contents. 2. cttctx Performance Test Utility Server Side Plug-In Index All Rights Reserved.

Ball Aerospace s COSMOS Open Source Test System

SENSE/NET 6.0. Open Source ECMS for the.net platform. 1

TIBCO Spotfire Automation Services 6.5. User s Manual

SimWebLink.NET Remote Control and Monitoring in the Simulink

USER MANUAL SlimComputer

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Lecture 1 Introduction to Android

Registration Instructions. Visual Basic 2010 Express Software

Microsoft Publisher 2010 What s New!

Practical Data Visualization and Virtual Reality. Virtual Reality VR Software and Programming. Karljohan Lundin Palmerius

Visualizing an OrientDB Graph Database with KeyLines

Making a Web Page with Microsoft Publisher 2003

Open source framework for interactive data exploration in server based architecture

JMETER - MONITOR TEST PLAN

Building Rich Internet Applications with PHP and Zend Framework

Tutorial JavaScript: Switching panels using a radio button

HEP data analysis using jhepwork and Java

CDOT Linking Excel Documents to MicroStation

Dynamic Web Programming BUILDING WEB APPLICATIONS USING ASP.NET, AJAX AND JAVASCRIPT

DEVELOPMENT OF AN ANALYSIS AND REPORTING TOOL FOR ORACLE FORMS SOURCE CODES

Building a Python Plugin

Internet Technologies

Installing C++ compiler for CSc212 Data Structures

Transcription:

Multiprocess System for Virtual Instruments in Python An Introduction to Pythics Brian R. D Urso Assistant Professor of Physics and Astronomy School of Arts and Sciences Oak Ridge National Laboratory Measurement Science and Systems Engineering Division

Motivation How to control laboratory instruments and experiments? Also applies to many models and simulations. Commercial software is great for simple problems, but may be inadequate for complex tasks. Programming languages are too specialized. Inadequate multithreading/multiprocessing. Lack of robustness. Software developed in proprietary languages may be difficult for students to utilize after they graduate. Alternative: use C, C++, Fortran, etc. But: Steep learning curve: GUI building is complex. Error-prone: most laboratory problems require multithreading. Redesign needed for every project. 2

Solution Requirements Use a general-purpose, easy to learn language (Python). Cross-platform (Linux, Windows). Avoid excessive dependencies (Python > 2.6.0, wxpython). Don t reinvent the wheel. For full functionality: NumPy, matplotlib, Python Imaging Library (PIL). Also useful: PyVISA. Data acquisition and processing should not interfere with GUI operation (including loops, timers, instrument timeouts). User-programmer should not have to directly use multithreaded/multiprocess programming techniques. Simple, low-fuss method of specifying GUI (must be portable). User-programmer does not have to understand GUI programming. Don t introduce new syntax or special functions. Sharing of data between multiple VIs must be simple. System must be robust. 3

Solution: Pythics Overview Pure Python implementation. Organized as a program that manages documents virtual instruments or VI s. Single GUI process and thread (mandated by GUI toolkits). Each VI gets its own process for executing actions. GUI is web browser style: Tabbed interface, one tab per VI. Layout within each tab is html-like. User-programmer writes two files: GUI specification: html/xml. Callback functions: pure Python. 4

Multithreading/Multiprocessing in Pythics Design: Minimize bottlenecks. Simple to use: User code runs in a single thread/process. One GUI process. Main GUI thread. Helper thread for managing request queue. Each VI has an independent action process. Main thread for executing actions (user code). Additional thread for each timer to trigger periodic actions. 5

Using Pythics GUI Specification GUI layout (text and controls) by custom xml/html layout engine. Supported controls: Images, buttons, text boxes, file dialogs, numeric input/output, spreadsheet, sliders, Python shell, Plots (wxpython, matplotlib). Style specification (fonts, colors) with simplified CSS. Many basic formatting tags supported. Some special controls for side effects: Timers, globals, loading python files, loading default parameters, 6

Using Pythics Example GUI <html> <head><title>hello World</title></head> <body> <h1>hello World</h1> <object classid='button' width='200'> <param name='label' value='run'/> <param name='action' value='hello_world.run'/> </object> <br/> <object classid='textbox' id='result' width='200'> </object> <br/> <object classid='scriptloader' width='100%'> <param name='filename' value='hello_world'/> </object> </body> </html> 7

Using Pythics Callback Functions def run(result, **kwargs): result.value = "Hello, world!" The Python portion of a VI is one or more pure python files. The files should define callback functions which are called when GUI events occur (e.g. a button click). Callback functions are passed all GUI controls as keyword arguments (the key is the id parameter given in the xml file). The control objects passed to callback functions are proxies with a simplified interface. Proxy objects handle all interprocess communication. Simple interface: high level properties and methods. Otherwise free to do anything in these files. 8

Additional Features Optionally speed up inter-process data transfer with shared memory. Available for canvas images. Useful for array data (plots, tables)? Timers live in action process for minimal overhead. Can be aborted at any time (uses events internally). No limit to number of timers per VI. Shared data: Use global namespace from multiprocessing package. Parameters: Save and restore values stored in controls (including setting defaults). Sub-windows: Can encapsulate an entire VI in a single control. Allows effective creation of complex controls. 9

Putting it All Together Pythics allows simple: Specification of GUI. Multiprocessing and multithreading for simultaneous data processing and GUI functionality. Limitations: Web page like GUI design. Weakly coupled GUI and code. Designed for experiment control. Also useful for controlling models and simulations. Builds on many great Python packages: Built-in: multiprocessing. Add-ons: wxpython, NumPy, All released under GNU GPL! See http://code.google.com/p/pythics/ 10

Future Improvements (Wish List) Build a community? Get funding? Documentation and testing. Improved real-time plotting. Need speed for fast updates (~ 10/second) and scrolling. More plot types. Based on matplotlib? Chaco? plplot? Printing support. Optional graphical GUI editor. XML format makes it fairly easy. 3-D rendering widget. Try to port Visual Python (VPython)? PyOpenGL? VTK? Operation over network. Front and back ends on different machines. Some built-in support in multiprocessing module. 11