Put/get units for channels

Overview
Many would like to annotate data channels with units metadata. Physical units are an example of DataTurbine’s facility to associate any string with data channels.

Procedure
This is accomplished by using the function PutUserInfo() of the ChannelMap class in com.rbnb.sapi, the DataTurbine Simple API. The convention that is used is to prefix the unit label with “units=”

Examples
For some channel ‘foo’, whose data has units ‘bar’ for which a DataTurbine Channel Map exists, do:
PutUserInfo(GetIndex(“foo”), “units=bar”);
in the Source program. This metadata can then be retrieved by Sink clients by:
GetUserInfo(GetIndex(“foo”);
after a ChannelMap has been populated with channel ‘foo’.
An example of a Source program that insrts unit metadata in this way is edu.sdsc.cleos.DaqToRbnb, which can be viewed here:
http://nladr-cvs.sdsc.edu/svn-public/CLEOS/cleos-rbnb-apps/trunk/src/edu/sdsc/cleos/DaqToRbnb.java
Examples of Sink clients that use this unit metadata have complied to the protocol that prefixes unit metadata with ‘units=’ are plot.jar, which ships with DataTurbine and the Real-time Data Viewer from SUNY at Buffalo, which can be found here:
http://it.nees.org/software/rdv/index.php

Open Source DataTurbine Initiative © 2016 Frontier Theme