TsctlAIOGets32Desc

From embeddedTS Manuals

This call is only valid if AIO is an ADC. Otherwise a negative error value will be returned.

If the specified buffer was successfully passed to Readys, then this call will block until that conversion is completed. Otherwise, the conversion will be initiated immediately such that each enabled channel will be activated in turn, looping around until the specified number of samples have been taken for each channel and placed into the specified buffer, with the function blocking until all conversions are completed or the interrupt trigger occurs. In either case, a positive return code will be returned indicating the number of samples actually taken.

The function may also return less than the requested number of samples of an overflow or other such error occurs. If fewer than the requested number of samples are returned, the next call may return a negative error code, and the following call will restart acquisition. The intervening error code allows the caller to determine what went wrong, and to resynchronize acquisition. For example, if an overflow occurs, the remaining data before the overflow will be returned, after which the caller will learn of the overflow and can take whatever steps are necessary due to missing samples at that point.

This function is only suitable for calling if the precision of all channels to be sampled is less than or equal to 32 bits. Channels that have a higher precision will return truncated data. The format of the data put in the passed array is such that each sampled channel is added in turn. After the last channel is sampled the next sample will start over the with first channel. The length of the Array determines how many samples will be taken: it is not necessary to take a sample of every channel, and if the length of the Array is not an even multiple of the number of channels being sampled the last sampling will not contain all channels.