Introduction
A setup has been built at IFIC for measuring the signal from prototype silicon detectors within the RD50 project from CERN. The detector stands in a testbox within a Faraday cage. The far-end optical fibre of a laser emitting diode is placed perpendicularly to the detector plane. A three micrometer axis system allows to move the impact point of the laser on the device. The detector is biased through a digital source. Finally a digital scope allows to monitor the input laser signal and the measured signal from the detector. A NIM amplifier module allows to amplifiy the laser signal if required.
All the devices needed for the laser measurement (source, scope, axis and pulse generator) are connected through GPIB to a PC holding a National Instruments (NI) GPIB control card.
GtkLasGui is a program written in C++/Gtk that allows to interact with these devices through a Graphical User Interface (GUI) so that automatic measurements on the detectors can be done.
GPIB devices
The IEEE488 standard (or GPIB - General Purpose Interface Bus) is a digital 8-bit parallel communications interface bus with data transfer rates up to 1 Mbyte/s that connects instruments with a computer. GPIB was initially developed by Hewlett Packard and was recognized as an IEEE standard in 1978. The IEEE488.1-1978 standard defines the convention for electrical and mechanical bus characteristics, as well as the state diagram for each bus function. In 1987, another standard derived from IEEE488.1-1978, known as IEEE488.2-1987, was introduced to define data formats, common commands, and control protocols for instruments. In general, IEEE488.1 defines the hardware specification, and IEEE488.2 defines the software specification. Today, GPIB is the most popular interface between computer and instruments.
The IEEE-488 standard supports one System Controller, usually a computer, and up to 15 additional instruments to be interconnected on one GPIB bus. Each device is assigned a unique primary address, ranging from 0-30, by setting the address switches on the device. A secondary address may also be specified.
The devices used in the laser setup are:
- axis motion controller Newport MM4005
- digital oscilloscope HP Infinim
- digital source-meter Keithley 2410
- pulse and pattern generator Agilent 81130A
The configuration of the NI GPIB card located in silab11 PC is done through /usr/local/bin/ibconf (
you'll need root privileges). Actually, the devices that have been defined are listed in the table below with their corresponding addresses:
Address | Device name | Description |
1 | MM4005 | Axis motion controller Newport MM4005 |
2 | AGISCOPE | Digital oscilloscope Agilent DSO6104A |
3 | KEITHLEY | Digital source-meter Keithley 2410 |
4 | INFINIUM | Digital oscilloscope HP Infinium |
5 | PGEN | Pulse generator Agilent 81130A |
6 | INSTEK | Power Supply INSTEK PST-3202 |
7 | dev7 | generic device |
8 | dev8 | generic device |
... | ... | ... |
14 | dev14 | generic device |
(currently the digital scope Agilent is not used)
The device name is actually a meaningfull name of the device associated to an address number. It is possible however to set to another device an already existing address number, but for its initialization the same device name as defined for that address must be used. This way of proceeding is therefore not recommended. A new address with a new device name should be defined instead. For testing purposes, generic device names can be used for addresses ranging from 7 to 14 (at 30 Nov 2006).
The class
GPIB_Device has been defined to handle the low level GPIB functions. It includes external C functions to send instructions, read devices replies and decode error commands through the GPIB protocol.
The classes :
derive from the
GPIB_Device class and define functions specific to each device.
The Graphical User Interface (GUI)
The GUI has been designed using Glade-2. The resulting .glade (xml) file is named lasgui1.1.glade and located under the directory /afs/ific.uv.es/user/s/silicio/laser_gui/v1.1.
In order to edit the file:
% cd /afs/ific.uv.es/user/s/silicio/laser_gui/v1.1
% glade-2 lasgui1.1.glade
Name | Description | Comments |
window1 | main window of the application |
fileselection1 | file selection window for loading/saving configuration files |
dialog2 | preferences window |
window2 | motion controller jog window | |
dialog3 | confirmation dialog for setting current point of axis as new zero-point | has two options: accept or cancel |
inputdialog1 |
window3 |
window4 | sourcemeter window for setting voltage | options: in steps or inmediately |
dialog4 | focus window | intended for focusing. to be implemted |
dialog6 | dialog to set new absolute axis abolute position | |
dialog7 | dialog to set new axis relative step |
dialog8 | dialog warning that device must be initialized |
window5 | window for displaying scope measurements |
about1 | about window | contains nice logo of the SCT-Valencia group !!! |
window6 | pulse-generator settings window | |
After compilation, the executable file is copied to /afs/ific.uv.es/user/s/silicio/laser_gui/gtklasgui.
Once started, the main window shown below should appear:
The main window has different areas, like the menu bar, the button bar and regions specific to the different devices.
The menu bar
- File
- Quit: leaves the application
- Settings
- Edit Settings: edits the preferences loaded at the startup of the program. It opens a window described by the PreferencesWindow class. A configuration file .lasguirc (see Configuration file for more details) is created each time the OK button of the Preferences Window is clicked.
- Save Settings: loads some pre-defined settings from a file.
- Load Settings: saves current settings in a file.
- Stages
- Initialize: initializes the axis motion controller and sets it in listener mode for receiving GPIB commands.
- Jog control: opens the jog control window for moving the stages in a user-friendly way.
- Scope
- Initialize: initializes the digital scope and sets it in listener mode for receiving GPIB commands.
- Reset: places the scope in a known state. This is the same as using the front-panel default setup button.
- Start refresh scope screen: starts an automatic update of the MainWindow::create_canvas showing in the main GUI a "clone" of the scope screen. This has the same effect as setting active the Refresh ON/OFF toggle_button. A gtk timeout function is called with a period defined in the preferences settings.
- Stop refresh scope screen: stops the automatic update of the scope screen replica.
- Run: starts the scope running. When it is running, it acquires waveform data according to its current settings.
- Stop: stops the scope running causing it to stop acquiring data.
- Source
- Inititialize: initializes the source-meter and sets it in listener mode for receiving GPIB commands.
- Set voltage: opens a window for setting voltage. A target voltage can be set inmediately or in steps with a given step size and time gap between steps.
- Voltage range: increases or decreases the voltage range
- Current compliance limit: change the compliance limit for current. Actually three options: minimum, maximum or default value.
- Digits: changes the display resolution.
- Beep: enables or disables the beep signal.
- Start auto-acquire: starts an automatic reading of voltage and current values. A gtk timeout function is called with a period defined in the preferences settings.
- Stop auto-acquire: stops the automatic reading of voltage and current values.
- On: turns source output on.
- Off: turns source output off.
- Pulse Generator
- Initialize: initializes the pulse generator and sets it in listener mode for receiving GPIB commands.
- Set parameters: opens a window for setting different parameters (output voltage, limits...) for the two output channels.
- Program
- Initialize all devices: initializes all devices and sets them in listener mode for receiving GPIB commands.
- Start: starts the automatic measuring program.
- Stop: stops the automatic measuring program.
- Resume: freezes the automatic measuring program
GladeApp
All windows and dialogs derive from the class
GladeApp written by Carlos Lacasta. This class has several virtual functions, so that the user must write the specific code of these functions for all derived classes:
virtual void user_init()
virtual void auto_connect()
virtual void set_handlers()
- The user_init() function is called when the corresponding window of the class is created.
- The auto_connect() function associates the name of the callback as specified in the .glade file (signal function) with a user defined function of that class.
- The set_handlers() associates a creation function as specified in the .glade file with a user defined function of that class. Actually it is just used to link the custom widget function create canvas with the function MainWindow::create_canvas for displaying a ROOT canvas within the main application.
If for example a signal
on_button_foo_clicked has been defined in the .glade file associated as callback when the button
button_foo is clicked in
WindowFoo, the user must:
- associate a static function within the class WindowFoo to that signal
- define that function in the source code
In WindowFoo.h:
class WindowFoo : public GladeApp
{
public:
WindowFoo();
~WindowFoo();
void user_init();
void auto_connect();
void set_handlers();
private:
static void on_button_foo_clicked(GtkWidget*, WindowFoo*);
}
In WindowFoo.cc:
#include "WindowFoo.h"
void WindowFoo::auto_connect(){
SET_CONNECT(on_button_foo_clicked);
}
void WindowFoo::on_button_foo_clicked(GtkWidget*, WindowFoo*){
cout << " Button foo has been clicked" << endl;
...
}
The configuration file
There is a configuration file called .lasguirc under /afs/ific.uv.es/user/s/silicio/laser_gui/gtklasgui which allows to set some default variables values.
The class
PrefSettings has been written to perform some actions on this configuration file.
When the program is started, the
MainWindow::user_init() function is executed. Within this function, a new object *pref_settings (global variable) of the
PrefSettings class is created and the default file .lasguirc is read (see its constructor) and the default parameters loaded in the program.
Other configuration files can be created by means of the Save File menu entry within the main window.
A
PrefSettings::Print() function allows to print in the screen some of these values:
cout << pref_settings->Print() << endl;
Comments can be included in the file with a hash symbol # at the beginning of a line.
The contents of this file are shown below:
# Updated by lasgui v1.1.
#
# lasgui settings file -- customize as needed.
#
# This file sets the preferences options used by the lasgui program.
# There are comments in this file to explain each variable, but if
# you have questions about specific settings see the help section from
# the lasgui program (to be done).
# For variables that accept multiple values, list elements are separated
# by commas. To set a variable to the empty string its value should be "".
#
# Lines beginning with "#" are comments, and ignored by lasgui.
#
# File generated on 20-Jun-06 at 10:45:05.
#
# Sergio Gonzalez-Sevilla, April 2006
# segonzal@ific.uv.es
#############################
# Source options
#############################
# This is the inital voltage list.
Voltage0=-10
Voltage1=-20
Voltage2=-30
Voltage3=-40
Voltage4=-50
Voltage5=-60
Voltage6=-70
Voltage7=-80
Voltage8=-90
Voltage9=-100
# Allows to specify the filter count. In general, the filter count is the number
# of readings that are acquired and stored in the filter buffer for averaging calculation.
filter_counts=20
# Sets from which voltage the full scan must start.
start_voltage=-10
# Sets the voltage step between consecutive voltages.
voltage_step=5
# Sets the ramping sense from the start_voltage value.
ramp_sense=1
#############################
# Scope options
#############################
# Number of triggers to be acquire in each measurement.
ntriggers=256
# Number of triggers to be acquire at a given reference voltage. This is intended if
# a different number of triggers is required for a better noise estimation (for example).
ntriggers_ref=512
# This is the reference voltage intended for noise measurement.
# The number of triggers at this voltage is set with the 'ntriggers_ref' value.
ref_voltage=-1
# If True, will take measurement at voltage 'ref_voltage' with 'triggers_ref' triggers.
measure_ref=0
# Sets the time in seconds for refreshing the scope-screen-replica in lasgui.
scope_refresh=5
# Memory depth of waveforms
memory_depth=512
# If True, will take measurement at voltage 'ref_voltage' with 'triggers_ref' triggers.
measure_ref=0
#############################
# Stages options
#############################
# Sets which axis are enabled or not.
axis_enabled0=1
axis_enabled1=1
axis_enabled2=1
#############################
# Pulse Generator options
#############################
# Sets the default frequency (in MHz) at startup.
def_freq=1
#############################
# General options
#############################
# Sets the name of the oscillosope as it appears in the configuration file
# of the PC GPIB card. We strongly do not recommend to change this value
# unless the PC GPIB card configuration file is changed.
scope_name=INFINIUM
# Sets the name of the keithley source as it appears in the configuration file
# of the PC GPIB card. We strongly do not recommend to change this value
# unless the PC GPIB card configuration file is changed.
source_name=KEITHLEY
# Sets the name of the motion controller as it appears in the configuration file
# of the PC GPIB card. We strongly do not recommend to change this value
# unless the PC GPIB card configuration file is changed.
stages_name=MM4005
# Sets the name of the pulse generator as it appears in the configuration file
# of the PC GPIB card. We strongly do not recommend to change this value
# unless the PC GPIB card configuration file is changed.
generator_name=PGEN
# Name of the detector being studied.
detector_name=unknown
# Type of the detector being studied. Possible values are n_on_p or p_on_n.
detector_type=1
# Sets the total number of measurements (SCAN passes).
# For example, if nmeas=3, the voltage list will be followed 3 times.
nmeas=2
# Sets the time in seconds between consecutive measurements while doing the voltage SCAN.
time_measure=10
Doxygen documentation
To do/to solve
- implement auto-focusing
- add type of measurement (fixed position-varying voltage or varying position-fixed voltage) to ntuple and LasGuiMeasurement class
- integrate into program Vicente's macros
- Cuando movemos el eje X con la interfaz un movimiento relativo se va 0.2um, en el eje Y 0.3um y en el eje Z 0.1um. En el movimiento absoluto no se observa este problema.
Tips and Tricks
- if you set properties of a widget like width or heigth, and the window does not scale properly reflecting the new properties, try to save the glade project, close and re-open it. Widgets should now be visualized correctly.
- do not forget to define the functions (in the source code) specified in the auto_connect function of the class.
Links
--
SergioGonzalez - 10 Nov 2006