SlideShare a Scribd company logo
SCIENTIFIC INSTRUMENT
CONTROL WITH F#
Anton Tcholakov, Colin Stephen, Gavin Morley
Department of Physics, University of Warwick
@ant_pt
CUSTOM SPECTROMETER
CUSTOM SPECTROMETER
• Apply microwaves to a
sample in a magnetic field
• Measure the reflected
power
• Vary the magnetic field
• Changes in the signal help
to characterise the sample
REQUIREMENTS
REQUIREMENTS
• Concurrent control of multiple
instruments
• Real-time chart plotting
• Ability to save data and
experimental parameters
• Modularity
• Robust error handling
14.125 14.130 14.135 14.140
-6000
-4000
-2000
0
2000
4000
6000
8000
10000
EPRsignal(arb.units)
Magnetic field (T)
DOMAIN MODELLING
• Records, unions and units of measure let us model hardware
capabilities and experiment parameters clearly and concisely
• We get structural equality and serialisation for free
type Frequency = FrequencyInHz of float<Hz>
type Amplitude = PowerInDbm of float<dBm>
type StepSpacing = LinearSpacing | LogarithmicSpacing
type Range<'T> = { Start : ’T ; Stop : 'T }
type FrequencySweep =
| FrequencySweep of range : Range<Frequency>
| FixedFrequency of frequency : Frequency
type AmplitudeSweep =
| AmplitudeSweep of range : Range<Amplitude>
| FixedAmplitude of amplitude : Amplitude
type StepSweep =
{ Frequency : FrequencySweep
Amplitude : AmplitudeSweep
NumberOfPoints : int
Spacing : StepSpacing }
INSTRUMENT CONTROL
• Communication to hardware is inherently async
• async workflows are great metaphor for
experiments
• Use asyncChoice (available in ExtCore) and
railway-oriented programming to handle errors
DATA ACQUISITION
type StreamingAcquisition =
{ Parameters : StreamingParameters
Buffers : AcquisitionBuffers
StopCapability : CancellationCapability<StreamStopOptions>
StatusChanged : Event<StreamStatus>
SampleBlockObserved : Event<SampleBlock> }
let run scope acquisition = asyncChoice {
use acquisitionHandle =
PicoScope.Acquisition.allocateHandle digitiser acquisition.Buffers
do! prepare scope acquisition
do! startStreaming scope acquisition
do! pollUntilStopped scope acquisition }
• Acquisition emits samples via Event<‘T>, so we can feed this straight
into FSharp.Charting
• Use Rx transformations to implement signal processing
WHAT DO OTHERS USE?
C / C++
• Low level, manual memory and thread management
Python
• Global Interpreter Lock can cause problems
• Pay the price for dynamic typing in large projects
C# (… in industry?)
LabVIEW
• Looks and feels like it belongs in the 90s
• … but has a vast library of instrument drivers
SUMMARY
• F#’s type system allows us to model our problem
domain clearly and concisely
• Many of the tools we need are already available
(async, Rx, FSharp.Charting)
• F# is very well suited to the task but lacks
instrument libraries and user base

More Related Content

What's hot

Svd filtered temporal usage clustering
Svd filtered temporal usage clusteringSvd filtered temporal usage clustering
Svd filtered temporal usage clusteringLiang Xie, PhD
 
C-SAW: A Framework for Graph Sampling and Random Walk on GPUs
C-SAW: A Framework for Graph Sampling and Random Walk on GPUsC-SAW: A Framework for Graph Sampling and Random Walk on GPUs
C-SAW: A Framework for Graph Sampling and Random Walk on GPUs
Pandey_G
 
Super COMPUTING Journal
Super COMPUTING JournalSuper COMPUTING Journal
Super COMPUTING JournalPandey_G
 
Johnson Trotter Algorithm(Permutation)
Johnson Trotter Algorithm(Permutation)Johnson Trotter Algorithm(Permutation)
Johnson Trotter Algorithm(Permutation)
International Islamic University
 
Ds36715716
Ds36715716Ds36715716
Ds36715716
IJERA Editor
 
Exploring Raster with FME
Exploring Raster with FMEExploring Raster with FME
Exploring Raster with FME
Safe Software
 
Point Clouds: What's New
Point Clouds: What's NewPoint Clouds: What's New
Point Clouds: What's New
Safe Software
 
Adaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção JrAdaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção Jr
FAST
 
Building blocks for aggregate programming of self-organising applications
Building blocks for aggregate programming of self-organising applicationsBuilding blocks for aggregate programming of self-organising applications
Building blocks for aggregate programming of self-organising applications
FoCAS Initiative
 
Analisa Expression pada after effect menggungakan bahasa script
Analisa  Expression pada after effect menggungakan bahasa scriptAnalisa  Expression pada after effect menggungakan bahasa script
Analisa Expression pada after effect menggungakan bahasa script
VamelAfganisme Quartz
 
Arbitary Waveform Generator By Nisarg Vasavada.
Arbitary Waveform Generator By Nisarg Vasavada.Arbitary Waveform Generator By Nisarg Vasavada.
Arbitary Waveform Generator By Nisarg Vasavada.
Nisarg Vasavada
 
Traffic state estimation with multi-sensor data for large networks with macro...
Traffic state estimation with multi-sensor data for large networks with macro...Traffic state estimation with multi-sensor data for large networks with macro...
Traffic state estimation with multi-sensor data for large networks with macro...
YazanSafadi
 
Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...
Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...
Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...
YazanSafadi
 
Experiments & Experiences with Scilab in Undergraduate Education
Experiments & Experiences with Scilab in Undergraduate Education Experiments & Experiences with Scilab in Undergraduate Education
Experiments & Experiences with Scilab in Undergraduate Education
Naren P.R.
 
Guided Wave Propagation Simulation by ANSYS
Guided Wave Propagation Simulation by ANSYS Guided Wave Propagation Simulation by ANSYS
Guided Wave Propagation Simulation by ANSYS
Ping Hung Lee
 
Process Simulation using DWSIM
Process Simulation using DWSIMProcess Simulation using DWSIM
Process Simulation using DWSIM
Naren P.R.
 
Vtk Image procesing
Vtk Image procesingVtk Image procesing
Vtk Image procesing
Sonu Mangal
 

What's hot (20)

Svd filtered temporal usage clustering
Svd filtered temporal usage clusteringSvd filtered temporal usage clustering
Svd filtered temporal usage clustering
 
C-SAW: A Framework for Graph Sampling and Random Walk on GPUs
C-SAW: A Framework for Graph Sampling and Random Walk on GPUsC-SAW: A Framework for Graph Sampling and Random Walk on GPUs
C-SAW: A Framework for Graph Sampling and Random Walk on GPUs
 
Super COMPUTING Journal
Super COMPUTING JournalSuper COMPUTING Journal
Super COMPUTING Journal
 
Comp
CompComp
Comp
 
Johnson Trotter Algorithm(Permutation)
Johnson Trotter Algorithm(Permutation)Johnson Trotter Algorithm(Permutation)
Johnson Trotter Algorithm(Permutation)
 
Ds36715716
Ds36715716Ds36715716
Ds36715716
 
Exploring Raster with FME
Exploring Raster with FMEExploring Raster with FME
Exploring Raster with FME
 
Point Clouds: What's New
Point Clouds: What's NewPoint Clouds: What's New
Point Clouds: What's New
 
Adaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção JrAdaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção Jr
 
Building blocks for aggregate programming of self-organising applications
Building blocks for aggregate programming of self-organising applicationsBuilding blocks for aggregate programming of self-organising applications
Building blocks for aggregate programming of self-organising applications
 
Analisa Expression pada after effect menggungakan bahasa script
Analisa  Expression pada after effect menggungakan bahasa scriptAnalisa  Expression pada after effect menggungakan bahasa script
Analisa Expression pada after effect menggungakan bahasa script
 
Arbitary Waveform Generator By Nisarg Vasavada.
Arbitary Waveform Generator By Nisarg Vasavada.Arbitary Waveform Generator By Nisarg Vasavada.
Arbitary Waveform Generator By Nisarg Vasavada.
 
Traffic state estimation with multi-sensor data for large networks with macro...
Traffic state estimation with multi-sensor data for large networks with macro...Traffic state estimation with multi-sensor data for large networks with macro...
Traffic state estimation with multi-sensor data for large networks with macro...
 
Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...
Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...
Macroscopic Fundamental Diagram using Traffic Simulation and Control (AIMSUN ...
 
Experiments & Experiences with Scilab in Undergraduate Education
Experiments & Experiences with Scilab in Undergraduate Education Experiments & Experiences with Scilab in Undergraduate Education
Experiments & Experiences with Scilab in Undergraduate Education
 
Scilab
ScilabScilab
Scilab
 
Guided Wave Propagation Simulation by ANSYS
Guided Wave Propagation Simulation by ANSYS Guided Wave Propagation Simulation by ANSYS
Guided Wave Propagation Simulation by ANSYS
 
Process Simulation using DWSIM
Process Simulation using DWSIMProcess Simulation using DWSIM
Process Simulation using DWSIM
 
Vtk Image procesing
Vtk Image procesingVtk Image procesing
Vtk Image procesing
 
R intro
R introR intro
R intro
 

Viewers also liked

Instrument & Control Courses
Instrument & Control Courses Instrument & Control Courses
Instrument & Control Courses mfkhroosa
 
Instrument & Control Introduction
Instrument & Control IntroductionInstrument & Control Introduction
Instrument & Control Introduction
Morteza Shahmoradi
 
Sequel System Instrument Control Software
Sequel System Instrument Control SoftwareSequel System Instrument Control Software
Sequel System Instrument Control Software
Octavio Luna
 
Sept2016 sv pac_bio_visualization
Sept2016 sv pac_bio_visualizationSept2016 sv pac_bio_visualization
Sept2016 sv pac_bio_visualization
GenomeInABottle
 
Building scientific experiments with F#
Building scientific experiments with F#Building scientific experiments with F#
Building scientific experiments with F#
ant_pt
 
How to NLProc from .NET
How to NLProc from .NETHow to NLProc from .NET
How to NLProc from .NET
Sergey Tihon
 
Process of instrument making
Process of instrument makingProcess of instrument making
Process of instrument makingPengeneee Peng
 
23 richard a. hall - 5287265 - interfacing methods for use in inputting ope...
23   richard a. hall - 5287265 - interfacing methods for use in inputting ope...23   richard a. hall - 5287265 - interfacing methods for use in inputting ope...
23 richard a. hall - 5287265 - interfacing methods for use in inputting ope...
Mello_Patent_Registry
 
Career Guidance in Instrumentation-2013 edition
Career Guidance in Instrumentation-2013 editionCareer Guidance in Instrumentation-2013 edition
Career Guidance in Instrumentation-2013 editionMohamed Uwaise, CAP®
 
An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...
An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...
An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...Altair
 
Introduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & controlIntroduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & control
Mahmoud Wanis
 
ipec.info | Pfd p&id
ipec.info | Pfd p&idipec.info | Pfd p&id
ipec.info | Pfd p&id
IPEC
 
Basic instrumentation
Basic instrumentationBasic instrumentation
Fundamentals of FPGA
Fundamentals of FPGAFundamentals of FPGA
Fundamentals of FPGA
velamakuri
 

Viewers also liked (14)

Instrument & Control Courses
Instrument & Control Courses Instrument & Control Courses
Instrument & Control Courses
 
Instrument & Control Introduction
Instrument & Control IntroductionInstrument & Control Introduction
Instrument & Control Introduction
 
Sequel System Instrument Control Software
Sequel System Instrument Control SoftwareSequel System Instrument Control Software
Sequel System Instrument Control Software
 
Sept2016 sv pac_bio_visualization
Sept2016 sv pac_bio_visualizationSept2016 sv pac_bio_visualization
Sept2016 sv pac_bio_visualization
 
Building scientific experiments with F#
Building scientific experiments with F#Building scientific experiments with F#
Building scientific experiments with F#
 
How to NLProc from .NET
How to NLProc from .NETHow to NLProc from .NET
How to NLProc from .NET
 
Process of instrument making
Process of instrument makingProcess of instrument making
Process of instrument making
 
23 richard a. hall - 5287265 - interfacing methods for use in inputting ope...
23   richard a. hall - 5287265 - interfacing methods for use in inputting ope...23   richard a. hall - 5287265 - interfacing methods for use in inputting ope...
23 richard a. hall - 5287265 - interfacing methods for use in inputting ope...
 
Career Guidance in Instrumentation-2013 edition
Career Guidance in Instrumentation-2013 editionCareer Guidance in Instrumentation-2013 edition
Career Guidance in Instrumentation-2013 edition
 
An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...
An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...
An Automated Head Impact Process Setup for Automobile Instrument Panel (IP) A...
 
Introduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & controlIntroduction to fundamentals of instrument & control
Introduction to fundamentals of instrument & control
 
ipec.info | Pfd p&id
ipec.info | Pfd p&idipec.info | Pfd p&id
ipec.info | Pfd p&id
 
Basic instrumentation
Basic instrumentationBasic instrumentation
Basic instrumentation
 
Fundamentals of FPGA
Fundamentals of FPGAFundamentals of FPGA
Fundamentals of FPGA
 

Similar to Scientific instrument control with F#

Strength of Materials iLab
Strength of Materials iLabStrength of Materials iLab
Strength of Materials iLab
Babatunde Ishola
 
Strel streaming
Strel streamingStrel streaming
Strel streaming
Vincenzo Gulisano
 
OPAL-RT ePHASORsim Webinar
OPAL-RT ePHASORsim WebinarOPAL-RT ePHASORsim Webinar
OPAL-RT ePHASORsim Webinar
OPAL-RT TECHNOLOGIES
 
SERENE 2014 School: Incremental Model Queries over the Cloud
SERENE 2014 School: Incremental Model Queries over the CloudSERENE 2014 School: Incremental Model Queries over the Cloud
SERENE 2014 School: Incremental Model Queries over the Cloud
SERENEWorkshop
 
SERENE 2014 School: Daniel varro serene2014_school
SERENE 2014 School: Daniel varro serene2014_schoolSERENE 2014 School: Daniel varro serene2014_school
SERENE 2014 School: Daniel varro serene2014_school
Henry Muccini
 
Digial instrumentation fnal
Digial instrumentation fnalDigial instrumentation fnal
Digial instrumentation fnal
Bishal Rimal
 
Katalog produk chauvin arnoux power quality analyser ca8336 by tridinamika
Katalog produk chauvin arnoux power quality analyser ca8336 by tridinamikaKatalog produk chauvin arnoux power quality analyser ca8336 by tridinamika
Katalog produk chauvin arnoux power quality analyser ca8336 by tridinamika
PT. Tridinamika Jaya Instrument
 
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Gene's law
Gene's lawGene's law
Gene's law
Hoopeer Hoopeer
 
Random access scan
Random access scan Random access scan
Random access scan
Harish Peta
 
Advancements in the Real-Time Simulation of Large Active Distribution Systems...
Advancements in the Real-Time Simulation of Large Active Distribution Systems...Advancements in the Real-Time Simulation of Large Active Distribution Systems...
Advancements in the Real-Time Simulation of Large Active Distribution Systems...
OPAL-RT TECHNOLOGIES
 
Crash course on data streaming (with examples using Apache Flink)
Crash course on data streaming (with examples using Apache Flink)Crash course on data streaming (with examples using Apache Flink)
Crash course on data streaming (with examples using Apache Flink)
Vincenzo Gulisano
 
Tektronix and keithley product and apps update q3 2016
Tektronix and keithley product and apps update q3 2016Tektronix and keithley product and apps update q3 2016
Tektronix and keithley product and apps update q3 2016
Jeff Sable
 
Spectral Analysis of Sample Rate Converter
Spectral Analysis of Sample Rate ConverterSpectral Analysis of Sample Rate Converter
Spectral Analysis of Sample Rate Converter
CSCJournals
 
OPAL-RT RT14 Conference: egston compiso opal-rt
OPAL-RT RT14 Conference:  egston compiso opal-rtOPAL-RT RT14 Conference:  egston compiso opal-rt
OPAL-RT RT14 Conference: egston compiso opal-rt
OPAL-RT TECHNOLOGIES
 
Accurate Synchronization of EtherCAT Systems Using Distributed Clocks
Accurate Synchronization of EtherCAT Systems Using Distributed ClocksAccurate Synchronization of EtherCAT Systems Using Distributed Clocks
Accurate Synchronization of EtherCAT Systems Using Distributed Clocks
Design World
 
Resume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed SignalResume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed SignalArizona State University
 
Resume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed SignalResume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed SignalArizona State University
 
A High-Level Programming Approach for using FPGAs in HPC using Functional Des...
A High-Level Programming Approach for using FPGAs in HPC using Functional Des...A High-Level Programming Approach for using FPGAs in HPC using Functional Des...
A High-Level Programming Approach for using FPGAs in HPC using Functional Des...
waqarnabi
 
Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...
Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...
Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...
TSC University of Mondragon
 

Similar to Scientific instrument control with F# (20)

Strength of Materials iLab
Strength of Materials iLabStrength of Materials iLab
Strength of Materials iLab
 
Strel streaming
Strel streamingStrel streaming
Strel streaming
 
OPAL-RT ePHASORsim Webinar
OPAL-RT ePHASORsim WebinarOPAL-RT ePHASORsim Webinar
OPAL-RT ePHASORsim Webinar
 
SERENE 2014 School: Incremental Model Queries over the Cloud
SERENE 2014 School: Incremental Model Queries over the CloudSERENE 2014 School: Incremental Model Queries over the Cloud
SERENE 2014 School: Incremental Model Queries over the Cloud
 
SERENE 2014 School: Daniel varro serene2014_school
SERENE 2014 School: Daniel varro serene2014_schoolSERENE 2014 School: Daniel varro serene2014_school
SERENE 2014 School: Daniel varro serene2014_school
 
Digial instrumentation fnal
Digial instrumentation fnalDigial instrumentation fnal
Digial instrumentation fnal
 
Katalog produk chauvin arnoux power quality analyser ca8336 by tridinamika
Katalog produk chauvin arnoux power quality analyser ca8336 by tridinamikaKatalog produk chauvin arnoux power quality analyser ca8336 by tridinamika
Katalog produk chauvin arnoux power quality analyser ca8336 by tridinamika
 
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
Using MpCCI to model Fluid-Structure-Interactions with ABAQUS and 3rd party C...
 
Gene's law
Gene's lawGene's law
Gene's law
 
Random access scan
Random access scan Random access scan
Random access scan
 
Advancements in the Real-Time Simulation of Large Active Distribution Systems...
Advancements in the Real-Time Simulation of Large Active Distribution Systems...Advancements in the Real-Time Simulation of Large Active Distribution Systems...
Advancements in the Real-Time Simulation of Large Active Distribution Systems...
 
Crash course on data streaming (with examples using Apache Flink)
Crash course on data streaming (with examples using Apache Flink)Crash course on data streaming (with examples using Apache Flink)
Crash course on data streaming (with examples using Apache Flink)
 
Tektronix and keithley product and apps update q3 2016
Tektronix and keithley product and apps update q3 2016Tektronix and keithley product and apps update q3 2016
Tektronix and keithley product and apps update q3 2016
 
Spectral Analysis of Sample Rate Converter
Spectral Analysis of Sample Rate ConverterSpectral Analysis of Sample Rate Converter
Spectral Analysis of Sample Rate Converter
 
OPAL-RT RT14 Conference: egston compiso opal-rt
OPAL-RT RT14 Conference:  egston compiso opal-rtOPAL-RT RT14 Conference:  egston compiso opal-rt
OPAL-RT RT14 Conference: egston compiso opal-rt
 
Accurate Synchronization of EtherCAT Systems Using Distributed Clocks
Accurate Synchronization of EtherCAT Systems Using Distributed ClocksAccurate Synchronization of EtherCAT Systems Using Distributed Clocks
Accurate Synchronization of EtherCAT Systems Using Distributed Clocks
 
Resume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed SignalResume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed Signal
 
Resume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed SignalResume_Karthik_Koneru_Analog_and_Mixed Signal
Resume_Karthik_Koneru_Analog_and_Mixed Signal
 
A High-Level Programming Approach for using FPGAs in HPC using Functional Des...
A High-Level Programming Approach for using FPGAs in HPC using Functional Des...A High-Level Programming Approach for using FPGAs in HPC using Functional Des...
A High-Level Programming Approach for using FPGAs in HPC using Functional Des...
 
Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...
Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...
Real-time Implementation of Sphere Decoder-based MIMO Wireless System (EUSIPC...
 

Recently uploaded

Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 

Recently uploaded (20)

Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 

Scientific instrument control with F#

  • 1. SCIENTIFIC INSTRUMENT CONTROL WITH F# Anton Tcholakov, Colin Stephen, Gavin Morley Department of Physics, University of Warwick @ant_pt
  • 3. CUSTOM SPECTROMETER • Apply microwaves to a sample in a magnetic field • Measure the reflected power • Vary the magnetic field • Changes in the signal help to characterise the sample
  • 5. REQUIREMENTS • Concurrent control of multiple instruments • Real-time chart plotting • Ability to save data and experimental parameters • Modularity • Robust error handling 14.125 14.130 14.135 14.140 -6000 -4000 -2000 0 2000 4000 6000 8000 10000 EPRsignal(arb.units) Magnetic field (T)
  • 6. DOMAIN MODELLING • Records, unions and units of measure let us model hardware capabilities and experiment parameters clearly and concisely • We get structural equality and serialisation for free type Frequency = FrequencyInHz of float<Hz> type Amplitude = PowerInDbm of float<dBm> type StepSpacing = LinearSpacing | LogarithmicSpacing type Range<'T> = { Start : ’T ; Stop : 'T } type FrequencySweep = | FrequencySweep of range : Range<Frequency> | FixedFrequency of frequency : Frequency type AmplitudeSweep = | AmplitudeSweep of range : Range<Amplitude> | FixedAmplitude of amplitude : Amplitude type StepSweep = { Frequency : FrequencySweep Amplitude : AmplitudeSweep NumberOfPoints : int Spacing : StepSpacing }
  • 7. INSTRUMENT CONTROL • Communication to hardware is inherently async • async workflows are great metaphor for experiments • Use asyncChoice (available in ExtCore) and railway-oriented programming to handle errors
  • 8. DATA ACQUISITION type StreamingAcquisition = { Parameters : StreamingParameters Buffers : AcquisitionBuffers StopCapability : CancellationCapability<StreamStopOptions> StatusChanged : Event<StreamStatus> SampleBlockObserved : Event<SampleBlock> } let run scope acquisition = asyncChoice { use acquisitionHandle = PicoScope.Acquisition.allocateHandle digitiser acquisition.Buffers do! prepare scope acquisition do! startStreaming scope acquisition do! pollUntilStopped scope acquisition } • Acquisition emits samples via Event<‘T>, so we can feed this straight into FSharp.Charting • Use Rx transformations to implement signal processing
  • 9. WHAT DO OTHERS USE? C / C++ • Low level, manual memory and thread management Python • Global Interpreter Lock can cause problems • Pay the price for dynamic typing in large projects C# (… in industry?)
  • 10. LabVIEW • Looks and feels like it belongs in the 90s • … but has a vast library of instrument drivers
  • 11. SUMMARY • F#’s type system allows us to model our problem domain clearly and concisely • Many of the tools we need are already available (async, Rx, FSharp.Charting) • F# is very well suited to the task but lacks instrument libraries and user base