AI_ContScanChannelsToFile Previous topicNext topicFirst topicLast topic

AI_ContScanChannelsToFile

@ Description

This function performs continuous A/D conversions on the specified continuous analog input channels at a rate as close to the rate you specified and saves the acquired data in a disk file. The data written to the file are decimal numbers. Please refer to Appendix C, AI Data Format for the format of the data in the data file. This function takes advantage of the hardware auto-scan functionality to perform multi-channel analog input.

@ Cards Support

9111, 9112, 9113, 9114, 9118, 9812/10
@ Syntax

I16 AI_ContScanChannelsToFile (U16 CardNumber, U16 Channel, U16 AdRange, U8 *FileName, U32 ReadCount, F64 SampleRate, U16 SyncMode)

@ Parameter

CardNumber : The card ID of the card that want to perform this operation.
Channel : The largest channel number of specified continuous analog input channel. The channel order for acquiring data is as
               follows:
               PCI-9111: number of Channel must be within 0 and 15. The continuous scan sequence is ascending and the first one
                              must be zero. For example, 0, 1, 2, 3.
               PCI-9112/cPCI-9112: number of Channel must be within 0 and 15. The continuous scan sequence is descending, and the
                              first one must be zero. For example, 3, 2, 1, 0.
               PCI-9113: number of Channel must be within 0 and 31. The continuous scan sequence is ascending and the first one
                              must be zero. For example, 0, 1, 2, 3.
               PCI-9114: number of Channel must be within 0 and 31. The continuous scan sequence is ascending and the first one
                              must be zero. For example, 0, 1, 2, 3.
               PCI-9118: number of Channel must be within 0 and 15. The continuous scan sequence is ascending and the first one
                              must be zero. For example, 0, 1, 2, 3.
               PCI-9812/10: number of Channel must be   0, 1 or 3. The continuous scan sequence is ascending and the first one must
                              be zero. For example, 0, 1, 2, 3.
               cPCI-9812/10: number of Channel must be 0, 1 or 3. The continuous scan sequence is ascending and the first one must
                              be zero. For example, 0, 1, 2, 3.
AdRange : The analog input range the continuous specified channel is setting. Please refer to the Appendix B for the valid range
                values.
FileName : Name of data file which stores the acquired data
ReadCount : If double-buffered mode is disabled, ReadCount is the number of A/D conversions to be performed. For double-buffered
                   acquisition, ReadCount is the size (in samples) of the circular buffer and its value must be a multiple of 4.
 
Note: if the card is PCI-9111, PCI-9113 or PCI-9114, this function uses FIFO-Half-Full interrupt transfer mode. So the value of ReadCount must be the multiple of 512 for non-double-buffer mode, or multiple of 1024 for double-buffer mode.

SampleRate : The sampling rate you want for analog input in hertz (samples per second). The maximum rate depends on the card
                     type and your computer system. If you set A/D trigger source as external trigger by calling AI_9111_Config(),
                     AI_9112_Config(), AI_9113_Config(),AI_9114_Config(), AI_9812_Config() or AI_9118_Config(), the sampling rate
                     is determined by an external trigger source, you have to set this argument as CLKSRC_EXT_SampRate.
                     If you set A/D trigger mode as external trigger by calling AI_9812_Config(), the frequency divider is set as 2 by the
                     driver. Hence, the sampling rate is:
                                                Frequency of external trigger source / 2

SyncMode : Whether this operation is performed synchronously or asynchronously. If any trigger mode is enabled by calling
                  AI_9111_Config(), AI_9812_Config() or AI_9118_Config(), this operation should be performed asynchronously.
                  Valid values:
                    SYNCH_OP : synchronous A/D conversion, that is, the function does not return until the A/D operation complete.
                    ASYNCH_OP: asynchronous A/D conversion

@ Return Code

NoError, ErrorInvalidCardNumber, ErrorCardNotRegistered, ErrorFuncNotSupport, ErrorInvalidIoChannel, ErrorInvalidSampleRate, ErrorInvalidAdRange, ErrorTransferCountTooLarge, ErrorContIoNotAllowed, ErrorLastChannelNotZero, ErrorDiffRangeNotSupport, ErrorChannelNotDescending, ErrorChannelNotAscending