Mezurit 2: Virtual instrumentation for electronics experiments
- Dr. Brian Standley
Mezurit 2: Virtual instrumentation for electronics experiments Dr. - - PowerPoint PPT Presentation
Mezurit 2: Virtual instrumentation for electronics experiments Dr. Brian Standley FOSDEM 2 Feb 2013 Origin of Mezurit 2 Problem #1: Acquire, scale, and record data Problem #2: Sweep a region of parameter space Problem #3: Find and
Brian Standley FOSDEM 2 Feb 2013
Brian Standley FOSDEM 2 Feb 2013
Brian Standley FOSDEM 2 Feb 2013
BGVA
tg
MΩ
1
bg
b
kΩ 100
10×
PCI-GPIB SR830
X Y Master SINE OUT
kΩ
100.3
Ω
109
INPUT
1000:1 divider DL1211
105V/A
Ω
130
chip carrier
(each) junction box
feed- through
Oxford VTI
ADC
PCI-6036e
3 DAC 1
computer
ADC 4 DAC 0
Brian Standley FOSDEM 2 Feb 2013
BGVA
tg
MΩ
1
bg
b
kΩ 100
10×
PCI-GPIB SR830
X Y Master SINE OUT
kΩ
100.3
Ω
109
INPUT
1000:1 divider DL1211
105V/A
Ω
130
chip carrier
(each) junction box
feed- through
Oxford VTI
ADC
PCI-6036e
3 DAC 1
computer
ADC 4 DAC 0
Brian Standley FOSDEM 2 Feb 2013
Brian Standley FOSDEM 2 Feb 2013
Language files blank comment code
C/C++ Header 37 513 747 1263 Python 3 134 40 333
Brian Standley FOSDEM 2 Feb 2013
Widgets Refresh logic Settings Operation logic
Acquisition loop: Wrapper libraries:
RPC nodes MCF nodes
Interface loop:
DAQ GPIB Timing Binning system Trigger Scanning
COMEDI NI-DAQ GTimer linux-gpib NI-488.2
Terminal:
GPIB loop Receive input Varset
glibc mscvrt
Python interpreter Widgets Settings RPC nodes MCF nodes
Tools:
Virtual chan. computation
Sub- systems:
MCF system Logging Sweep Display status Plot data RPC server Status messaging
Brian Standley FOSDEM 2 Feb 2013
Widgets Refresh logic Settings Operation logic
Acquisition loop: Wrapper libraries:
RPC nodes MCF nodes
Interface loop:
DAQ GPIB Timing Binning system Trigger Scanning
COMEDI NI-DAQ GTimer linux-gpib NI-488.2
Terminal:
GPIB loop Receive input Varset
glibc mscvrt
Python interpreter Widgets Settings RPC nodes MCF nodes
Tools:
Virtual chan. computation
Sub- systems:
MCF system Logging Sweep Display status Plot data RPC server Status messaging
Buffer readout due? GTK events pending? RPC queued?
RPC queue
RPC received? Type == DAQ? Queue for GUI Scanning? Limit rate (~1 kHz) Read ADCs sadc DAQ device Compute {X }
nMoving average Acquired point Binning event? Recorded points Record point Triggers armed? Sweeping?
Yes No
Format msg. Slot update due? Send msg.
GPIB dev. GPIB slots Limit rate (50 Hz)
Scanning?
T == 1?
iTransfer due?
Read samples
Yes No No Yes Yes No No Yes Yes No Yes
Compute {{X }
n j}Sample buffer
No
Scan done?
Yes No
Store samples Record points Set GPIB slots Compute {X'
p}, {x' p} Yes NoDAQ device
No Yes No Yes No Yes
No Yes
Refresh
Yes No
} readout due?
n{X Copy point
Plot data
No Yes
Refresh Limit rate (120 Hz) Acquired point
GUI DAQ GPIB
Set DACs DAQ device
Brian Standley FOSDEM 2 Feb 2013
Brian Standley FOSDEM 2 Feb 2013
lock(mutex) var = new_value unlock(mutex) set_value(widget, new_value) }
DAQ thread:
Variables
1.2E+0 rate_var
9 10
hold_var 5.0E-2 delta_var 0.0E+0
11
Widgets MCF Closures
setvar_mcf()
+ var = rate_var + widget = rate_widget
'sweep_rate' 'hold_time' setvar_mcf()
+ var = hold_var + widget = hold_widget
'sweep_delta' setvar_mcf()
+ var = delta_var + widget = delta_widget
lock(mutex) step_sweep(delta_var, rate_var, hold_var) unlock(mutex) } while (running) {
8
key, value = parse(arg) func = mcf_lookup(key)) mcf_call(func, value) } def setvar_mcf(var, widget, new_value) { def setvar_rpc(arg) { cmd, arg = get_msg() func = rpc_lookup(cmd) rpc_call(func, arg) }
12 6
Terminal:
GUI thread:
mcf_closure(setvar_mcf, 'sweep_rate', rate_var, rate_widget) } if (rpc_queued()) { while (running) {
RPC Closures
setvar_rpc() 'set_var' 'get_var' getvar_rpc() savedata_rpc() 'save_data'
1 2 4 3
rpc_closure(setvar_rpc, 'set_var')
5 7
Brian Standley FOSDEM 2 Feb 2013
Brian Standley FOSDEM 2 Feb 2013
Brian Standley FOSDEM 2 Feb 2013
User-supplied script
Realtime layer (C):
Instrument libraries
Model definition (Python):
Interface library General DAQ / control engine Drivers User-supplied script Widget libraries Interface library
Control and display GUI (Python):
Brian Standley FOSDEM 2 Feb 2013