Koch Lab:Publications/Drafts/Versatile Feedback/Software/High-Level Program Structure

From OpenWetWare
Jump to: navigation, search

Abstract

I will explain how we designed the data acquisition/feedback control software, by making an analogy to the functions of a digital camera.


A Thought Experiment

How would you design a user interface for a digital camera? Using a camera has parallels in running an experiment: there is a set-up phase, where you compose the subject or scene and adjust the camera settings to obtain the desired effect, and then a data-acquisition phase, where the camera records the image.

Finite State Machines

These phases can be diagrammed as a finite-state machine (FSM), such as the graph in figure 1.

FiniteStateMachine1.png

Some cameras have multiple set-up phases: one for advanced settings (which cannot be interrupted for acquisition) and one for oft-changed settings (which can). Compare figure 2:

FiniteStateMachine1a.png

LabVIEW programmers implement finite state machines by putting a Case structure inside a While Loop (or For Loop). At each iteration of the loop, some selector value determines the state (case) to run.

Substructure of the Acquisition Phase

Our solution: a fixed structure, with the ability to run scripts

Hardware Limitations