NEESit logo

Channel units in the Data Turbine


Paul Hubbard
Terry Weymouth
Jason Hanley

V1.0: Feb 11, 2005
V1.1: Apr 18, 2005 Added image and URL to doc head

Background

As shipped, the Creare Data Turbine does not understand units. (I.e., 'channel C0 measurements are in meters') We needed a way to add unit support for plots, as a requirement of our user community. The turbine has  support for user metadata, but bugs  in the implementation blocked our use of that method. This page explains how we solved the problem, and how you can write code to interoperate.

The initial use of units is limited to sources from data acquisition (DAQ). Other channels, such as audio and video, do not have the same requirements.

Goals

  1. Simple to implement, in both source and sink
  2. ASCII format, human-readable, easily parsed
  3. Dynamic - units may change on the fly if necessary
  4. Does not break existing code!

The Solution

A channel called _Units containing an entry for each source. The format is a string with name=value pairs. Delimter is tab or comma, as spaces are valid in some units. If the units change, re-create and send the entire string, not just the new value.

Example:
	c0=mm, c1=kips, c2=G
Or
	Channel 1=mm Hg	[tab]Channel 2=megaparsecs per fortnight

The mime type for the source must be set to
	text/plain
So the _Units source has multiple sources within it. This screenshot shows that (lower left) as well as graphs with units (See the legend, bottom center of the plot):

Data viewer

Notes

All this code can be found in the NEES CVS archive (instructions and info page).

Navigation