duck-lab

Opensource DAQ Framework

Download

Tarball is available here: tarball

Mercurial repository: https://rtn.sssup.it/hg/duck-lab

Introduction 

duck-lab is an open-source framework for Data AcQuisition (DAQ) and processing designed for portability and extensibility. It is currently available for GNU/Linux with L-GPL license. It is possible to link Duck-lab with the ROOT framework developed at CERN.

Key features:

  • acquisition from different streams (serial port, socket, parallel port, etc.)
  • different storage (text-files, ROOT data framework, etc.)
  • run-time configuration through XML file
The framework has been originally designed to acquire, store and process data produced from embedded devices in the most configurable way.
daq systemA common approach to test, debug and assist embedded systems development is to rely on custom applications to collect output produced by the device. A typical use case is: an RS-232 serial port with a console application  (e.g.: hyperterminal, minicom, etc.) or a custom application (e.g. written in C or python). 
 
A more generic approach is to make use of DAQ software that allows also to perform parsing, storing and processing of the acquired information. The state of the art in such way is represented by LabVIEW.
The duck-lab framework represents an intermediate solution for DAQ and processing. Without pretending to achieve the complexity and versatility of LabVIEW, our framework has been designed as a simple, configurable, and generic tool.
 
 
daq basic_design

 Design guidelines:

  • Generic Data Types (e.g. integers, floats, structured data)
  • Generic Data Stream (e.g. serial port, ethernet, etc.)
  • Multiple storages and display
  • Run-Time (Re)Configuration
  • Extensibility: adding new components (data, steams, storage, display) requires very little effort

Online resources 

The duck-lab project is currently available under Mercurial revision control.
 
The repository can be browsed via web interface here (ignore the SSL error, due to unregistedred certificate). 
 
To get the last snapshot of the repository use: hg clone https://rtn.sssup.it/hg/duck-lab

The last export of the repository is also available here.

For instruction see the file INSTALL available in the main project directory or contact the authors: 
  • Christian Nastasi: <c.nastasi AT sssup DOT it>
  • Claudio Salvadori: <c.salvadori AT sssup DOT it>

Example of usage

contiki light sensors

 
After downloading duck-lab, installation instructions can be found in the INSTALL file in the main directory. Follow the instructions to have the duck-lab properly installed. Please, notice that ROOT-cern framework has to be enabled to run this example.
 tmote sky
The folder 'examples/from_SerialStream' contains the example XML file ('contiki-example.xml') that describes the DAQ process. In particular, two 16-bits unsigned integers shall be acquired from the TelosB board, representing the two light sensor measurements. 
The acquired data shall be stored in:
  • A text file, with semicolon separated integers in hexadecimal base
  • A text file, with semicolon separated integers in decimal base
  • A ROOT file, containing a TTree with the acquired events
    daq example
Notice, a ROOT post-processing file shall be automatically generated and is meant to be modified to write the appropriate post-processing logic. Another ROOT post-processing file ('root-manual_postprocessing.cpp') shows some possible operations: histograms and graphs.
 
The source and binary files for the TMote sky can be found here.


Attach the tmote sky usb-port to your PC. To execute the application:

  • A new serial port should be available, typically /dev/ttyUSB0 (use 'dmesg' to verify). 
    • Notice: the serial port specified in the XML shall be the detected one.
  • Start the duck-lab: 'duck-lab contiki-example.xml'.  
    • Notice: messages shall be printed and the duck-lab shall wait for incoming data from the serial port
  • Push the USER button on the tmote sky to start data transmission.
    • Notice: a red led should blink for each transmission (every second) on the tmote sky
    • Notice: On the PC there is an animation 'bar' (character) that should rotate every 10 acquisitions.
  • To stop the acquisition on the PC, use Ctrl-C (will close safely the duck-lab)
The two text files and the ROOT file shall be produced. The ROOT file is meant to be opened through the ROOT api.
To execute the ROOT post-processing on the produced ROOT file, compile the post-processing applications following the instruction in their source files.