Design and Implementation of a LabVIEW based Computer Control for - - PowerPoint PPT Presentation
Design and Implementation of a LabVIEW based Computer Control for - - PowerPoint PPT Presentation
Design and Implementation of a LabVIEW based Computer Control for EPR Instrumentation Diploma Thesis Defense Matthias Kolja Miehl October 22, 2010 at 2:30 pm Milwaukee, Wisconsin, USA Medical College of Wisconsin MACC Fund Research Center
LabVIEW based Computer Control
◮ Control and acquisition framework ◮ Easily change hardware ◮ All experiments in one application
2 / 72
LabVIEW based Computer Control
◮ Control and acquisition framework ◮ Easily change hardware ◮ All experiments in one application
Figure: L-Band spectrometer at MCW’s Biophysics Research Department
3 / 72
Contents
1
Introduction
2
Concept
3
Implementation
4
Test
5
Summary and Vision
Contents
1
Introduction
2
Concept
3
Implementation
4
Test
5
Summary and Vision
LabVIEW based Computer Control Introduction Motivation
Need MCW Research:
◮ New experiments ◮ Different spectrometers ◮ Changing Hardware
6 / 72
LabVIEW based Computer Control Introduction Motivation
Need MCW Research:
◮ New experiments ◮ Different spectrometers ◮ Changing Hardware
Situation Use of separate programs for
◮ each experiment, ◮ each spectrometer, and ◮ were rewritten for new instruments.
7 / 72
LabVIEW based Computer Control Introduction Motivation
Need MCW Research:
◮ New experiments ◮ Different spectrometers ◮ Changing Hardware
Situation Use of separate programs for
◮ each experiment, ◮ each spectrometer, and ◮ were rewritten for new instruments.
Problem
◮ Labor and time intensive tasks ◮ Reduction of actual research time
8 / 72
LabVIEW based Computer Control Introduction Motivation
Motivation Increase the actual research time by reducing redundancy.
◮ Experiment implementation ◮ Changing hardware
9 / 72
LabVIEW based Computer Control Introduction Motivation
Motivation Increase the actual research time by reducing redundancy.
◮ Experiment implementation ◮ Changing hardware
Goal Versatile framework:
◮ All experiments ◮ Every spectrometer
10 / 72
LabVIEW based Computer Control Introduction Related Work
Existing Approaches
◮ WinEPR ◮ EWWin ◮ SpecMan4EPR
11 / 72
LabVIEW based Computer Control Introduction Related Work
Existing Approaches
◮ WinEPR ◮ EWWin ◮ SpecMan4EPR
MCW’s Requirements
◮ Exchange of instruments ◮ Storing experiment settings ◮ Easy extension by customer
12 / 72
Contents
1
Introduction
2
Concept
3
Implementation
4
Test
5
Summary and Vision
LabVIEW based Computer Control Concept Key Requirements
Key Requirements
◮ All experiments in one application ◮ Instruments easily exchangeable ◮ Maintainability and extendability ◮ 32 and 64-bit driver support
14 / 72
LabVIEW based Computer Control Concept Overall Structure
Core of Main Appl. Instrument Driver Instrument ... ... 64-bit 64 or 32-bit Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware
Figure: Overall application structure (concept)
15 / 72
Contents
1
Introduction
2
Concept
3
Implementation
4
Test
5
Summary and Vision
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Core of Main Appl. Instrument Driver Instrument Client Tab Controls Multiple-Loop
- Appl. Framework
Event Structure STM Server as EXE Module Hardware ... ... 64-bit EXE 64 or 32-bit EXE Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware Implementation Concept GPIB, LXI, ...
Figure: Overall application structure (implementation)
17 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Core of Main Appl. Instrument Driver Instrument Client Tab Controls Multiple-Loop
- Appl. Framework
Event Structure STM Server as EXE Module Hardware ... ... 64-bit EXE 64 or 32-bit EXE Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware Implementation Concept GPIB, LXI, ...
Figure: Overall application structure (implementation)
18 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Figure: Tab control structure of the application
19 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Figure: Tab control structure as the operator sees it
20 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Core of Main Appl. Instrument Driver Instrument Client Tab Controls Multiple-Loop
- Appl. Framework
Event Structure STM Server as EXE Module Hardware ... ... 64-bit EXE 64 or 32-bit EXE Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware Implementation Concept GPIB, LXI, ...
Figure: Overall application structure (implementation)
21 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Figure: Main program event handler loop
22 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Core of Main Appl. Instrument Driver Instrument Client Tab Controls Multiple-Loop
- Appl. Framework
Event Structure STM Server as EXE Module Hardware ... ... 64-bit EXE 64 or 32-bit EXE Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware Implementation Concept GPIB, LXI, ...
Figure: Overall application structure (implementation)
23 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Figure: Implementation of the main program’s parallel loop structure
24 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Core of Main Appl. Instrument Driver Instrument Client Tab Controls Multiple-Loop
- Appl. Framework
Event Structure STM Server as EXE Module Hardware ... ... 64-bit EXE 64 or 32-bit EXE Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware Implementation Concept GPIB, LXI, ...
Figure: Overall application structure (implementation)
25 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Core of Main Appl. Instrument Driver Instrument Client Tab Controls Multiple-Loop
- Appl. Framework
Event Structure STM Server as EXE Module Hardware ... ... 64-bit EXE 64 or 32-bit EXE Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware Implementation Concept GPIB, LXI, ...
Figure: Overall application structure (implementation)
26 / 72
LabVIEW based Computer Control Implementation Overall Structure and Used Technologies
Core of Main Appl. Instrument Driver Instrument Client Tab Controls Multiple-Loop
- Appl. Framework
Event Structure STM Server as EXE Module Hardware ... ... 64-bit EXE 64 or 32-bit EXE Exp. GUI ... Controls and Indicators Logic Internal Data Flow Inter-Process Communication Bus Hardware Abstraction Hardware Implementation Concept GPIB, LXI, ...
Figure: Overall application structure (implementation)
27 / 72
LabVIEW based Computer Control Implementation Driver Management
Startup of Drivers Communication Main Appl. Driver 1 Driver 2 Driver 2
starts
text_based_variable.ini
Write port for each driver Read port from respective section
Main Appl. Driver 1 Driver 2 Driver 2
STM Port x Port y Port z x, y, z z y x
28 / 72
LabVIEW based Computer Control Implementation STM
Advantages:
◮ Command-based
29 / 72
LabVIEW based Computer Control Implementation STM
Advantages:
◮ Command-based ◮ Hides transport layer details
30 / 72
LabVIEW based Computer Control Implementation STM
Advantages:
◮ Command-based ◮ Hides transport layer details ◮ Minimizes network traffic
31 / 72
LabVIEW based Computer Control Implementation STM
Advantages:
◮ Command-based ◮ Hides transport layer details ◮ Minimizes network traffic ◮ Small overhead
32 / 72
LabVIEW based Computer Control Implementation STM
Advantages:
◮ Command-based ◮ Hides transport layer details ◮ Minimizes network traffic ◮ Small overhead ◮ High throughput
33 / 72
LabVIEW based Computer Control Implementation STM
Variant Data
34 / 72
LabVIEW based Computer Control Implementation STM
Variant Data
Figure: Code of modified STM write function block
35 / 72
LabVIEW based Computer Control Implementation STM
Variant Data
Figure: Code of modified STM write function block Figure: Code of modified STM read function block
36 / 72
LabVIEW based Computer Control Implementation STM
Variant Data
Figure: Modified STM function blocks for writing and reading
37 / 72
LabVIEW based Computer Control Implementation STM
Command-Based Communication Framework
Client/Main Appl. Server/Driver
Data Receiver Command/ Parameter Sender
Network Communication
Commands + Parameters Data + Status Information Command Parser Medium Priority Tasks High Priority Task
Figure: STM’s command-based communication framework
38 / 72
LabVIEW based Computer Control Implementation Main Program and Driver Structure
STM
Main Program Medium Priority (Transmitter) Command Parser Medium Priority (Processor) High Priority Event Handler Transmitter Receiver Main Driver
STM STM D a t a Q u e u e M e d i u m P r i
- r
i t y Q u e u e H i g h P r i
- r
i t y Q u e u e STM STM M a i n Q u e u e
Figure: Parallel loop structure of main program and drivers
39 / 72
LabVIEW based Computer Control Implementation Main Program and Driver Structure
Figure: Actual loop structure of driver
40 / 72
LabVIEW based Computer Control Implementation Resulting Information Flow
STM Command GUI in Main Appl. Driver Instrument Instrument Bus
- Event structure
- Queue
- Main loop
- Transmitter loop
- Command Parser
- Queue
- Medium Priority (Processor) loop
- LabVIEW driver function block
STM Bus Command STM Parameter
Figure: Resulting information flow on instrument control change
41 / 72
LabVIEW based Computer Control Implementation Usages
Goal: Relation between drivers and instruments
42 / 72
LabVIEW based Computer Control Implementation Usages
Goal: Relation between drivers and instruments
Figure: Instrument control clusters on instrument panel
43 / 72
LabVIEW based Computer Control Implementation Usages
usage instrument 1
selects uses
driver 1 instrument 2 driver 2 instrument 3 driver 2
- r
- r
Figure: Usage concept
44 / 72
LabVIEW based Computer Control Implementation Usages
L-Band.CW sim.ini ; assignment of instrument to usage ; --------------------------------- ; usage = instrument name [config] stepper motor = "DS345(1)" signal = "DS345(2)" adc = "NI PCI-6024E"
45 / 72
LabVIEW based Computer Control Implementation Usages
L-Band.CW sim.ini ; EXE names ; --------- ; instrument name = driver name [driver] DS345(1) = "srds345" DS345(2) = "srds345" N8241A = "n8241a" N8241A Option 330 = "n8241a" NI PCI-6024E = "ni pci-6024e"
46 / 72
LabVIEW based Computer Control Implementation Usages
L-Band.CW sim.ini ; instrument resource names ; ------------------------- ; instrument name = resource name [resource] DS345(1) = "17" DS345(2) = "18" N8241A = "TCPIP0::169.254.1.20::inst0::instr" N8241A Option 330 = "TCPIP0::169.254.1.22::inst0::instr" NI PCI-6024E = "Dev1"
47 / 72
LabVIEW based Computer Control Implementation Usages
L-Band.CW sim.ini ; default parameters ; ------------------ ; parameter_DataType = value [signal] frequency_Digital = 1.000000 amplitude_Digital = 3.000000 phase_Digital = 0.000000
- ffset_Digital = 0.000000
amplitude unit_Ring = 1.000000 waveform_Ring = 1.000000 write wfm file_Path = "/C/temp/waveform.txt" [...]
48 / 72
LabVIEW based Computer Control Implementation Usages
usage instrument 1
selects uses
driver 1 instrument 2 driver 2 instrument 3 driver 2
- r
- r
Figure: Usage concept
signal DS345
selects uses
sdrs345 N8241A n8241a N8241A, 330 n8241a
- r
- r
Figure: Usage implementation
49 / 72
LabVIEW based Computer Control Implementation Hardware Abstraction
Goal: Select different instruments for a usage
Main Appl. Driver Instrument standardized STM commands instrument specific bus commands
Figure: Driver as hardware abstraction layer
50 / 72
LabVIEW based Computer Control Implementation Hardware Abstraction
Figure: Driver’s command parser loop
51 / 72
LabVIEW based Computer Control Implementation Hardware Abstraction
Figure: Driver’s high priority loop
52 / 72
LabVIEW based Computer Control Implementation Implemented Experiment
Figure: CW experiment GUI Collection page
53 / 72
LabVIEW based Computer Control Implementation Implemented Experiment
Figure: CW experiment GUI Parameters page
54 / 72
LabVIEW based Computer Control Implementation Implemented Experiment
Figure: CW experiment GUI Patrick page
55 / 72
LabVIEW based Computer Control Implementation Implemented Experiment
Figure: CW experiment GUI Varian page
56 / 72
LabVIEW based Computer Control Implementation Implemented Experiment
Figure: CW experiment GUI Instrument panel
57 / 72
Contents
1
Introduction
2
Concept
3
Implementation
4
Test
5
Summary and Vision
LabVIEW based Computer Control Test Measurement Setup
Measurement Setup Sample : Spin label Microwave frequency : 1.908 GHz (L-Band) Microwave input power : 120 µW Center field : 675 G Sweep : 105 G, i.e. 622.5 G .. 727.5 G Number of averages : 5 Acquisition time : ≈ 5:30 min
59 / 72
LabVIEW based Computer Control Test Results
Figure: Collection page after 2nd collection
60 / 72
LabVIEW based Computer Control Test Results
Figure: Collection page after 3rd collection
61 / 72
LabVIEW based Computer Control Test Results
Figure: Collection page after 4th collection
62 / 72
LabVIEW based Computer Control Test Results
Figure: Collection page after 5th collection
63 / 72
LabVIEW based Computer Control Test Results
Figure: Plot of full data.xls
64 / 72
Contents
1
Introduction
2
Concept
3
Implementation
4
Test
5
Summary and Vision
LabVIEW based Computer Control Summary and Vision 66 / 72
LabVIEW based Computer Control Summary and Vision
Key Features
◮ Can run on all spectrometers ◮ Can implement all experiments ◮ Faster experiment implementation ◮ Improved modularity and flexibility ◮ 32 and 64-bit driver capability ◮ Multi-core processors and multi-threading capable
67 / 72
LabVIEW based Computer Control Summary and Vision
Issues
◮ Improve thread allocation ◮ Decrease time it takes to display acquired data ◮ Emphasize the common basis of experiments
68 / 72
LabVIEW based Computer Control Summary and Vision
Discoveries
◮ Shared variables work unreliable for some applications ◮ Module based concept for large projects ◮ STM with case structure to avoid polling for new messages
69 / 72
LabVIEW based Computer Control Summary and Vision
Future Improvements
◮ Adaptive Signal Averaging Technique ◮ Technical Data Management Streaming (TDMS) ◮ Implement more drivers
70 / 72