Section 4.2 explains how instructions are used to do
acquisition on channels. This section explains
how they are used to configure a subdevice.
There are various sorts of configurations, and the
specific information for each different configuration possibility is
to be specified via the
buffer of the
instruction data structure.
(So, the pointer to a
is misused as a pointer to an array with board-specific information.)
INSN_CONFIG as the
member in an
instruction data structure
indicates that the instruction will
not perform acquisition on a
channel, but will configure that channel.
member in the
data structure, contains the channel to be configured.
The zeroth element of the data array
is always an id that specifies
what type of configuration instruction is being performed. The
meaning of rest of the elements in the data array
depend on the configuration instruction id.
Some of the
possible ids are summarised in the table below, along with the
meanings of the data array elements for
each type of configuration instruction.
|data||Description||n (number of elements in data array)||Meanings of data, ..., data[n-1]|
Configure a DIO line as input. It is easier to use
Configure a DIO line as output. It is easier to use
Select an alternate input source. This instruction is used by calibration
programs to configure analog input channels
which can be redirected to read internal calibration
references. You need to set the ||2||data: alternate input source.|
|Specify block size for asynchonous command data. When performing streaming input, many boards accumulate samples in internal fifos and transfer them to the host computer in chunks. Some drivers let you suggest a size in bytes for how big a the chunks should be. This lets you tune how often the host computer is interrupted with a new chunk of data.||2||data: The desired block size in bytes. The actual configured block size is writen back to data after the instruction completes. This instruction acts purely as a query if the block size is set to zero.|
Queries the configuration of a DIO line to see if it is an input or output.
It is probably easier to use the comedilib function
data: The instruction sets this element to either
See the comedilib demo program
demo/choose_clock.c for an example
of using a configuration instruction.