This document discusses how to build measurement systems using an object-oriented approach in LabVIEW. It presents an example of building a thermometry system using objects to represent instruments, measurements, and controls. Measurements are factored into processes that reference instrument objects. This allows different measurements to reuse instruments. The example illustrates creating subclasses for specific measurement types. It shows how measurement systems can be naturally factored into classes representing physical instruments, virtual measurements, and controls that work together.
3. A Real
Some extra
diagnostic
DMMs
Example
A bunch of
Lockin amplifiers
A special
multiplexor we
built for this
At least 4 project
thermometers
Some instruments
are standalone -
A couple of
superconducting
some are embedded
magnets A (dual) magnet
power supply
in hardware.
5. Thermometry Example
• this is a current source
• this is a voltmeter
• this is a resistor that varies its resistance
with temperature - we can use it as a
thermometer
6. Resistance First
The actual circuit - we’ll
make a 4-point resistance
measurement.
Let’s code to measure the
resistance first.
7. Resistance Example
MyCurrSource
A (dual) current
source instrument
Let’s identify the instruments
that we might need to use.
FirstVoltmeter
A simple voltmeter
8. Thermometry Example
Now something to describe
MyCurrSource
the measurement process...
A (dual) current
source instrument
MyFirstResMeas
Which current
source ?
Which voltmeter ?
FirstVoltmeter
A simple voltmeter
9. Thermometry Example
MyFirstResMeas
Measure the Resistance Process
Which current source ?
‘Mycurrsource’
- set current to zero
Which voltmeter ?
- wait for 1s
‘FirstVoltmeter’
MyCurrSource
- measure the dc voltage (V1)
(take account of thermal offsets)
A (dual) current
source instrument FirstVoltmeter
- set current to 100µA
A simple voltmeter
- wait for 1s
- measure the new DC voltage (V2)
- set current to zero
- Calculate R as (V2-V1)/100µA
An example of the process
10. Thermometry Example
MyFirstResMeas
Which current source ?
‘Mycurrsource’
Which voltmeter ?
‘FirstVoltmeter’
MyCurrSource
FirstVoltmeter
A (dual) current
A simple voltmeter
source instrument
The structure of measurement systems naturally
factors into measurement processes (green) and the
instruments which they use (yellow).
11. Thermometry Example
MyCurrSource
Now add a second circuit
A (dual) current
source instrument
SecondVoltmeter
A simple voltmeter
12. Thermometry Example
Myfirstresmeas
MySecondResMeas
Which current source ?
Which current source ?
‘ MyCurrSource’
‘MyCurrSource’
Which voltmeter ?
Which voltmeter ?
‘FirstVoltmeter’
‘SecondVoltmeter’
MyCurrSource
FirstVoltmeter
A (dual) current
A simple voltmeter
source instrument
SecondVoltmeter
A simple voltmeter
Using object references allows different
measurements to share the same instruments.
13. Being able to call objects by reference is a
critical requirement for building a flexible
and reconfigurable system.
14. Making a thermometer
• Actually we package the resistor and
calibrate it to yield a thermometer
calibration file
X312 Calib.csv
20
15
+ 10
5
SN X312 0
0 7.5 15.0 30.0
15. Now add the calibration
Create a more specific measurement subclass
MySecondResMeas
Which current source ?
‘MyCurrSource’
MySecondThermMeas
Which voltmeter ?
‘SecondVoltmeter’ Which current source ?
‘Mycurrsource’
X312
Which voltmeter ?
20
‘SecondVoltmeter’
10
Where’s the calibration ?
‘C:dataX312.csv’
0
0 7.5 22.5
Keep the basic resistance code but add a
thermometer measurement subclass that has a
path to a calibration file stored on the file system.
16. The Final Object Model
MySecondThermMeas
MyCurrSource
X337
‘C:dataX337.csv’ SecondVoltmeter
SN X337
SN X312
MyFirstThermMeas
X312
FirstVoltmeter
‘C:dataX312.csv’
18. Measurements and
Instruments
Measurements
Almost all conceivable
MySecondThermMeas
MyFirstThermMeas
measurements can be
factored as a generic
measurement process
SecondVoltmeter
linked to some
FirstVoltmeter
instruments that do work
MyCurrSource
in the real world.
Instruments
19. Measurements, Instruments
.... and Controls
Measurements
Controls
MySecondThermMeas
ProbeHeater
MyFirstThermMeas
SampleMagneticField
SecondVoltmeter
FirstVoltmeter
Changes would be made
MyCurrSource
by accessing control
New CurrSource
objects not the
Instruments
instruments directly.
20. Control Loops
TempControlledStage
Measurements
Controls
get set
MySecondThermMeas
ProbeHeater
MyFirstThermMeas
SampleMagneticField
SecondVoltmeter
FirstVoltmeter
MyCurrSource
Control loops can be built
New CurrSource
by referencing both control
Instruments
and measurement objects.
21. Measurement systems can be
naturally factored into
Measurement, Instrument and
Control objects that work
together.
22. Measurement systems naturally factor into physical
•
Instrument and virtual Measurement and Control
classes.
•Accessing Objects by reference allows the system to
be reconfigured very easily.
This also allows instruments and measurements to
•
be shared for multiple purposes.
Scalable Architectures specialises in developing
measurement systems that scale continuously from
prototype to finished product.
St. Johns Innovation Centre
Scalable Cowley Road
Architectures Cambridge
CB4 0WS, UK
www.scalable-architectures.com