AI_ContReadChannelToFile | ![]() ![]() ![]() ![]() |
AI_ContReadChannelToFile
@ Description
This function performs continuous A/D conversions on the specified analog input channel 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.
@ Cards Support
9111, 9112, 9113, 9114, 9118, 9812/10
@ Syntax
I16 AI_ContReadChannelToFile (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 : Analog input
channel number
Range: 0 through 15 for PCI-9111
Range: 0 through 15 for PCI-9112/cPCI-9112
Range: 0 through 31 for PCI-9113
Range: 0 through 31 for PCI-9114
Range: 0 through 15for PCI-9118
Range: 0 for PCI-9812/10 and cPCI-9812/10
AdRange : The
analog input range the specified channel is setting. We define some constants
to represent various A/D input ranges
in dask.h. Please refer to the Appendix B, AI Range Codes,
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).
Your maximum rate depends on the card
type and your computer system. If you set A/D trigger mode 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, ErrorInvalidAdRange, ErrorTransferCountTooLarge, ErrorContIoNotAllowed, ErrorInvalidSampleRate, ErrorOpenFile