AI_ContReadMultiChannelsToFile | ![]() ![]() ![]() ![]() |
AI_ContReadMultiChannelsToFile
@ Description
This function performs continuous A/D conversions on the specified 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 PCI-9118 auto-scan and channel-gain queue functionality to perform multi-channel analog input.
@ Cards Support
9118
@ Syntax
I16 AI_ContReadMultiChannelsToFile (U16 CardNumber, U16 NumChans, U16 *Chans, U16 *AdRanges, U8 *FileName, U32 ReadCount, F64 SampleRate, U16 SyncMode)
@ Parameter
CardNumber : The
card ID of the card that want to perform this operation.
numChans : The number
of analog input channels in the array Chans. The valid value:
PCI-9118: 1 through 255
Chans : Array
of analog input channel numbers. The channel order for acquiring data is
the same as the order you set in Chans.
PCI-9118: numbers in Chans must be within 0 and 15. Since there
is no restriction of channel order setting, you can set the
channel order as you wish.
AdRanges :
An integer array of length numChans that contains the analog input
range for every channel in array Chans.
PCI-9118: Please refer to the Appendix B for the valid range values. Since
PCI-9118 supports different ranges, the
range values in AdRanges can be any of the valid range values of
PCI-9118.
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.
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_9118_Config(),
the sampling rate is determined by an
external trigger source, you have to set this argument as CLKSRC_EXT_SampRate.
SyncMode : Whether
this operation is performed synchronously or asynchronously. If any trigger
mode is enabled by calling
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, ErrorOpenFile