Specifications
Comedi
57 / 148
In practice, their are some rules of thumb on how calibrations behave. No calibrations depend on the analog reference. A
multiplexed analog input will have calibration settings that do not depend on the channel, and applying a setting for one channel
will affect all channels equally. Analog outputs, and analog inputs with independent a/d converters for each input channel, will
have calibration settings which do depend on the channel, and the settings for each channel will be independent of the other
channels.
If you wish to investigate exactly what comedi_apply_calibration() is doing, you can perform reads on your board’s
calibration subdevice to see which calibration channels it is changing. You can also try to decipher the calibration file directly
(it’s a text file).
The file_path parameter can be used to specify the file which contains the calibration information. If file_path is N-
ULL, then Comedilib will use a default file location. The calibration information used by this function is generated by the
comedi_calibrate program (see its man page).
The functions comedi_parse_calibration_file(), comedi_apply_parsed_calibration(), and comedi_c-
leanup_calibration_file() provide the same functionality at a slightly lower level.
Return value
Returns 0 on success, -1 on failure.
5.4.3.2 comedi_apply_parsed_calibration
comedi_apply_parsed_calibration — set calibration from memory
Synopsis
#include <comedilib.h>
int comedi_apply_parsed_calibration(comedi_t * device, unsigned int subdevice, unsigned int channel, unsigned int range,
unsigned int aref, const comedi_calibration_t * calibration);
Status
alpha
Description
This function is similar to comedi_apply_calibration(), except the calibration information is read from memory instead
of a file. This function can be more efficient than comedi_apply_calibration() since the calibration file does not need to
be reparsed with every call. The value of parameter calibration is obtained by a call to comedi_parse_calibration-
_file().
Return value
Returns 0 on success, -1 on failure.
5.4.3.3 comedi_cleanup_calibration
comedi_cleanup_calibration — free calibration resources
Synopsis
#include <comedilib.h>
void comedi_cleanup_calibration(comedi_calibration_t * calibration);