Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk.

Slides:



Advertisements
Similar presentations
Chapter 16 Graphical User Interfaces
Advertisements

Tk. Toolkit n Wish - windowing shell –touch fileName –chmod +x fileName –xedit fileName & –#!/usr/local/bin/wish n Widgets - eg Buttons, Labels, Frames.
Chapter 16 Graphical User Interfaces John Keyser’s Modifications of Slides by Bjarne Stroustrup
W2D1 Fluency with IT = to learn / figure out quickly to use the computer for whatever purpose skills (lab) concepts (lectures)
Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Matlab.
XP Tutorial 4 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Personalizing Your Windows Environment Tutorial 4.
Next Generation MMI Requirements May 4, MMI - High Level Requirements run under UNIX and Windows NT (WNT) use a well defined ASCII definition for.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Tcl/Tk 1 CS 414, Software Engineering I Mark Ardis Rose-Hulman Institute December 3, 2002.
Tcl and Tk CSE 470 Fall 1999 Revised by Prasad. Objective To use Tcl Tk to develop GUI and prototype of the project.
Introduction to Visual Basic Chulantha Kulasekere.
Microsoft ® Office PowerPoint ® 2003 Training Playing movies [Your company name] presents:
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Graphical User Interfaces A Quick Outlook. Interface Many methods to create and “interface” with the user 2 most common interface methods: – Console –
How to Script a Presentation and Include Your Own Original Media Bryn Jones UNDA 2001.
DEMONSTRATION FOR SIGMA DATA ACQUISITION MODULES Tempatron Ltd Data Measurements Division Darwin Close Reading RG2 0TB UK T : +44 (0) F :
What are computers? Computers are machines that perform tasks or calculations according to a set of instructions, or programs. The first fully electronic.
Create Professional-looking Content Easy to Use Interface Share Documents.
How do people communicate with computers?
Ch 26 & 27 User Interfaces.
SAD and Python with EPICS at IHEP,Beijing, Noboru Yamamoto KEK, JAPAN.
ENVIROTRAC: A Premier Chamber Monitoring and Data Acquisition System Envirotrac A Guided Tour.
KRAD makes it easy to handle HTML events in your webpage. Kuali University: Apply Now Lab 6: Fun with HTML Events Lab Objectives HTML Events – what are.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Tcl/Tk package in R Yichen Qin
TCL/Tk Based Environment for Mixed-Signal Circuit Design System Description Software Architecture Examples Future Directions Summary.
The Fundamentals of Using Windows 95. Windows 95 ã operating system that performs every function necessary for the user to communicate and control computer.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Introduction to MATLAB Damon Tomlin February 22, 2008 Lecture 3: Data Visualization & User Interfaces.
Prachi Chitnis.  The CSS feel  SDS – Synoptic Display Studio  ADL Converter  PV table, Probe…
Python Programming Graphical User Interfaces Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
CSCE 121: Introduction to Program Design and Concepts, Honors Dr. J. Michael Moore Spring 2015 Set 15: GUIs 1.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
Introduction to Matlab & Data Analysis 2015 In this tutorial we will: Build a practical application using GUIDE Learn more about graphical user interface.
How the Session Works Outline Practical on arrival Talk 1 Reflect on practical Clarify concepts Practical exercises at your own pace Talk 2: Further concepts.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Programming for GCSE 1.0 Beginning with Python T eaching L ondon C omputing Margaret Derrington KCL Easter 2014.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Tkinter Basics. Initial Stuff To get the package: from tkinter import * To make a window, give it a title and operate it: windowVar = Tk() windowVar.title(“your.
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
TCL TK. Tcl/Tk C functions can become Tcl commands that are invoked interactively Tk = scriptable, portable user interface –Windows, X (Unix), MacOS,
Creating visual interfaces in python
UNDERSTANDING “THE RIBBON” Bonnie Powell Assistant Administrative Computer Network Coordinator.
April 27, 2006 The New GANGA GUI 26th LHCb Software Week C L Tan
An Overview of Tcl/Tk Programming. Tcl/Tk Tcl (Tool Command Language) is used by over half a million developers worldwide and has become a critical component.
Scripting.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
Matthias Clausen, DESY EPICS Training – Client Tools/ CSS EPICS collaboration meeting EPICS Training Client Tools EPICS collaboration meeting 2008.
RAPID: THE RAPID ADA PORTABLE INTERFACE DESIGNER Martin Carlisle Department of Computer Science US Air Force Academy.
What Is Firefox? __________ is a Web ___________ that you use to search for and view Web pages, save pages for use in the future, and maintain a list.
EEC-693/793 Applied Computer Vision with Depth Cameras
CST 1101 Problem Solving Using Computers
Topics Graphical User Interfaces Using the tkinter Module
EEC-693/793 Applied Computer Vision with Depth Cameras
Chapter Topics 15.1 Graphical User Interfaces
EEC-693/793 Applied Computer Vision with Depth Cameras
GUI Using Python.
TCL/TK Tool Command Language/Tool Kit.
This Week: Tkinter for GUI Interfaces Some examples
Introduction to Computing Using Java
The Basic Usage and The Event Handling in Glade.
I dragged over the label tool (A icon) and put it on the form.
EEC-693/793 Applied Computer Vision with Depth Cameras
Executive Reports, Instructions and Documentation
Presentation transcript:

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Contents ■ Tcl/Tk overview ■ Graphical user interfaces ► pep ► pvAssign ► SLS widgets ■ Direct EPICS access ► pvget, pvput, pvmon ■ Problems ■ References

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk What is Tcl/Tk? ■ Tcl is a scripting programming language. ■ Tk is a widget toolkit, available for Tcl and other languages. ■ It provides a command line shell: tclsh ■ And a GUI shell: wish ■ And a help program: tclhelp ■ Tcl can be extended with so called "packages". ► We provide an EPICS package for Tcl/Tk. ► We also provide special widgets for Tcl/Tk. ■ Tcl is really well supported by the controls section.

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Tcl/Tk quick start ■ Tcl is easy ■ Tk makes GUI creation simple ■ Type: wish button.b -text "Press me!" -command {puts "Hello world!"} pack.b ■ Press button ■ Look in tclhelp for: button, puts, pack ■ Write the program in a file and add first line: #!/usr/bin/wish ■ Make file executable: chmod +x filename

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Graphical user interfaces in Tcl/Tk: pep ■ pep -mc X11MA-ID1-CHU1:I-SET ► connects magnet control widget to X11MA-ID1-CHU1:I-SET ■ pep X11MA-ID1-CHU1:I-SET ► asks what widget type to connect to X11MA-ID1-CHU1:I-SET ■ pep –f configfile ► loads configfile.prc from. or $SLSBASE/sls/config/panel ► Try files from /work/sls/config/panel ■ Also see "How to use pep" item in Help menu.

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Beyond pep: Write your own Tcl-GUI with pvAssign ■ Start wish and load pvAssign package package require pvAssign ■ Create Widget label.temperature pack.temperature ■ Connect EPICS channel pvAssign.temperature MTRT1-TEMP:READ ■ Enjoy the features ► See value and alarm updates ► Try right click and middle click

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Supported widget types ■ Standard Tcl/Tk widgets ► label ● display string/number ► entry ● set string/number ► checkbutton ● set bit ► menubutton ● set enum with menu ► scale ● set number with slider ■ ■ Special SLS widgets ► formattedlabel ● display formatted number with units ► comparelabel ● display = or ≠ (compare to 0) ► wheelswitch ● set number ► led ● show bit as LED ► choicebutton ● set enum with row/column of buttons ■ ■ Load widget packages package require Wheelswitch

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk SLS Widgets types: Formattedlabel ■ Use standalone Formattedlabel package require Formattedlabel formattedlabel.fl -bg paleGreen -format "%9.4f mA" pack.fl.fl set ■ Use Formattedlabel with EPICS package require pvAssign package require Formattedlabel formattedlabel.temp1 -bg paleGreen pack.temp1 pvassign.temp1 MTRT1-LI-COOL:TEMP1

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk SLS Widgets types: Wheelswitch ■ Use standalone Wheelswitch package require Wheelswitch wheelswitch.ws -bg paleGreen -format 9.4 -label mA \ -min max command puts pack.ws.ws set ■ Use Wheelswitch with EPICS package require pvAssign package require Wheelswitch wheelswitch.limit -bg paleGreen pack.limit pvassign.limit MTRT1-LI-COOL:LIMIT

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk SLS Widgets types: Led ■ Use standalone Led package require Led led.led -color red pack.led ■ Use Led with EPICS package require pvAssign package require Led led.status pack.status pvassign.status MTRT1-LI-COOL:SW

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Beyond pvAssign: direct EPICS access ■ Load EPICS package (which is also used by pvAssign) package require Epics ■ Read value pvget MTRT1-LI-COOL:TEMP1 pvget MTRT1-LI-COOL:TEMP1 -format ■ Write value pvput MTRT1-LI-COOL:LIMIT 10 ■ Crate monitor pvmon MTRT1-LI-COOL:TEMP1 updateTemp1 ► Monitors need a callback procedure (here: updateTemp1 ) proc updateTemp1 {iostate value sevr stat time}

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Monitor example #!/usr/bin/tclsh package require Epics proc updateValue {channel iostate value sevr stat time} { if {$iostate != "OK"} { puts "$channel disconnected" return } if {$sevr != "NO_ALARM"} { puts "$channel has $sevr alarm because of $stat status" } puts "$time $channel = $value" } set device MTEST-VME-T1 foreach property {UPTIME LOAD WD} { set channel $device:$property pvmon $channel "updateValue $channel" } vwait forever

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Frequently asked questions about monitors ■ Why can't I simply call pvget in a loop? ► This creates much network overhead. ► It keeps the program and the IOC busy. ■ But what about a delay in the loop? ► Then you increase latency when something happens. ► You still have much overhead. ■ I don't understand how the monitor function gets called. ► Monitors work much the same as for example mouse clicks. ► On value change, monitors are called as soon as the program is idle.

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Problems with Tcl and EPICS ■ What if package require Epics (or pvAssign ) fails? ► Check environment variable TCLLIBPATH echo $TCLLIBPATH /usr/lib/tcl /work/lib/tcl ► Check that EPICS is installed in /usr/local/epics and /work or /prod is mounted. ■ Why does pvmon not work in tclsh ? ► Monitors need an idle loop to work, wish has one, tclsh not. ► Add vwait forever to the end of the script and it works.

Advanced EPICS Training, Dirk Zimoch 2008 Channel Access in Tcl/Tk Where can I learn more about Tcl/Tk? ■ First try tclhelp ■ Look at ■ Ask one of the Tcl experts: ► Werner Portmann ► Elke Zimoch ► Dirk Zimoch