COMEDI_TO_PHYSICAL(3)

✨ NAME ✨

comedi_to_physical β€” turns a raw sample into actual physical units using polynomials πŸ’…


🌸 SYNOPSIS 🌸

#include <comedilib.h>

double comedi_to_physical(lsampl_t data,
                          const comedi_polynomial_t * conversion_polynomial);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, here's the vibe: this function takes data, which is a Comedi integer sample value (that's an lsampl_t, and it lives somewhere between 0 and maxdata), and converts it into physical units as a double. slay. ✨

The conversion_polynomial argument? You don't just make that up yourself β€” you get it from either comedi_get_hardcal_converter or comedi_get_softcal_converter. Those are your sources, periodt.

πŸ’€ real talk though: this function does no range checking on the input data. none. zero. nada. So if you want to catch possibly out-of-range readings, that's on you β€” you gotta check for values of 0 or maxdata yourself. it's giving "you're the main character here". 😭

πŸŽ€ RETURN VALUE πŸŽ€

The physical value that corresponds to the input sample value. literally just the converted number. 🫢


πŸ‘‘ AUTHORS πŸ‘‘

  • David Schleef <ds@schleef.org> β€” Author.
  • Frank Mori Hess <fmhess@users.sourceforge.net> β€” Author.
  • Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be> β€” Author.
  • Bernd Porr <tech@linux-usb-daq.co.uk> β€” Author.
  • Ian Abbott <abbotti@mev.co.uk> β€” Author.
  • Γ‰ric Piel <piel@delmic.com> β€” Author.

the icon lineup fr fr πŸ”₯


Copyright Β© 1998-2003 David Schleef
Copyright Β© 2001-2003, 2005, 2008 Frank Mori Hess
Copyright Β© 2002-2003 Herman Bruyninckx
Copyright Β© 2012 Bernd Porr
Copyright Β© 2012 Ian Abbott
Copyright Β© 2012, 2015 Γ‰ric Piel

This document is part of Comedilib. And just so we're clear β€” in the context of this document, the term "source code" as defined by the license means the XML source. iykyk. πŸ“œ

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1 of the License. ✨

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.


🧚 that's the whole page bestie, no notes πŸ’…

Comedi Β· version stamp 03/20/2026 Β· this was COMEDI_TO_PHYSICAL(3) and she ate, ngl πŸŒˆπŸ‘‘πŸ“

πŸ“¦ where this page comes from