1COMEDI_GET_SOFTCAL_CONVERTER(3)                COMEDI_GET_SOFTCAL_CONVERTER(3)
2
3
4

NAME

6       comedi_get_softcal_converter  -  get  converter for software-calibrated
7       subdevice
8

SYNOPSIS

10       #include <comedilib.h>
11
12       int comedi_get_softcal_converter (unsigned subdevice, unsigned channel,
13       unsigned   range,  enum  comedi_conversion_direction  direction,  const
14       comedi_calibration_t  *parsed_calibration,  comedi_polynomial_t   *con‐
15       verter);
16

STATUS

18       alpha
19

DESCRIPTION

21       comedi_get_softcal_converter()  initializes  converter  so  it  can  be
22       passed to either comedi_to_physical() or  comedi_from_physical().   The
23       converter parameter can then be used to convert data from the specified
24       subdevice, channel,  and  range.   The  direction  parameter  specifies
25       whether   converter   will   be   passed   to  comedi_to_physical()  or
26       comedi_from_physical().  The parsed_calibration parameter contains  the
27       software  calibration  values  for  your device, and may be obtained by
28       calling comedi_parse_calibration_file() on a calibration file generated
29       by the comedi_soft_calibrate program.
30
31       This function is only useful for boards that perform their calibrations
32       in software on the host computer.  A subdevice will advertise the  fact
33       that  it depends on a software calibration with the SDF_SOFT_CALIBRATED
34       subdevice flag.
35
36       Whether or not the result of this  function  actually  depends  on  the
37       channel  parameter  is  hardware dependent.  For example, a multiplexed
38       analog input will typically use the  same  calibration  for  all  input
39       channels.  Analog outputs will typically use different calibrations for
40       each output channel.
41
42       Software calibrations are  implemented  as  polynomials  (up  to  third
43       order).   Since  the  inverse  of  polynomials of order higher than one
44       can't be represented exactly as another polynomial, you may not be able
45       to get converters for the "reverse" direction.  For example, you may be
46       able to get a converter for an analog input in  the  COMEDI_TO_PHYSICAL
47       direction, but not in the COMEDI_FROM_PHYSICAL direction.
48

RETURN VALUE

50       Zero on success or -1 on failure.
51
52
53
54                                28 October 2007COMEDI_GET_SOFTCAL_CONVERTER(3)
Impressum