TsctlAIOConfigureDesc

From embeddedTS Manuals

If the specific configuration is legal, the AIOs are configured to that configuration and a positive value is returned. Otherwise a negative error code is returned. The length of all passed Arrays must be equal to the number of channels.

low and high contain the desired voltage range in effect for each channel.

prec contains the desired (minimum) precision in bits for each channel

t contains the desired (maximum) period in ns for each channel. The AIO_HZ() macro can be used to convert back and forth between Hz and nanoseconds.

trigger contains the desired trigger signal for activating each channel

itrig is the interrupt trigger signal. If this value is non-zero, then when the trigger occurs during a call to Gets8/16/32 or Puts8/16/32, the call will return immediately at the end of the current set of samples, even if the requested number of samples has not yet been taken. A value of zero disables the interrupt trigger.

Hardware capabilities differ; to ensure maximum conversion rates across platforms when using Get or Put, call Configure before each call to only enable the next channel to converted. This will also allow for different channel configurations that would not be legal when enabling multiple channels. For example, suppose an AIO supports either 100Hz sampling at 12 bits or 50Hz sampling at 16 bits. It would not be legal to enable channel 1 for 100Hz@12 bits and channel 2 for 50Hz@16 bits at the same time. However by only enabling one channel at a time in turn before sampling it would be possible to accomplish this as both configurations are not active simultaneously.

Calling Configure while a channel is active will cause the current activity to be terminated, either immediately or after the current sample is complete, depending on the capabilities of the hardware. Any data already waiting for a call to Get or Gets8/16/32 will be discarded.