logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

comedi_to_phys - convert sample to physical units

Authors

DavidSchleef <ds@schleef.org>
           Author.

       FrankMoriHess <fmhess@users.sourceforge.net>
           Author.

       HermanBruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
           Author.

       BerndPorr <tech@linux-usb-daq.co.uk>
           Author.

       IanAbbott <abbotti@mev.co.uk>
           Author.

       ÉricPiel <piel@delmic.com>
           Author.

Description

       Converts parameter data given in sample values (lsampl_t, between 0 and maxdata) into physical units
       (double). The parameter range represents the conversion information to use, and the parameter maxdata
       represents the maximum possible data value for the channel that the data was read. The mapping between
       physical units is linear and assumes ideal converter characteristics.

       Conversion of endpoint sample values, that is, sample values equal to 0 or maxdata, is affected by the
       Comedilib out-of-range behavior (see function comedi_set_global_oor_behavior). If the out-of-range
       behavior is set to COMEDI_OOR_NAN, endpoint values are converted to NAN. If the out-of-range behavior is
       set to COMEDI_OOR_NUMBER, the endpoint values are converted similarly to other values.

       If there is an error, NAN is returned.

Name

       comedi_to_phys - convert sample to physical units

Synopsis

#include<comedilib.h>doublecomedi_to_phys(lsampl_tdata,comedi_range*range,lsampl_tmaxdata);

See Also