07-21-2005 02:07 AM
07-22-2005 10:34 AM
Hi ajmal,
I think you are referring to the function DAQ_To_Disk when using Traditional
DAQ calls. You can always find out more information on what a specific
command does by going to the Traditional NI-DAQ Function Reference Help (Start
> All Programs > National Instruments > NI-DAQ).
I will go ahead and paste all of the information from that help file in this
post
status = DAQ_to_Disk (deviceNumber, chan, gain, filename, count, sampleRate, concat)
Performs a synchronous, single-channel DAQ operation and saves the acquired data in a disk file. DAQ_to_Disk does not return until Traditional NI-DAQ has acquired and saved all the data or an acquisition error has occurred.
Direction | Name | Type | Description |
---|---|---|---|
Input | deviceNumber | i16 | assigned by Measurement & Automation Explorer |
chan | i16 | analog input channel number | |
gain | i16 | gain setting | |
filename | STR | name of data file to be created | |
count | u32 | number of samples to be acquired | |
sampleRate | f64 | rate in units of pts/s | |
concat | i16 | enables concatenation to an existing file |
chan is the analog input channel number. If you are using SCXI, you must use the appropriate analog input channel on the DAQ device that corresponds to the SCXI channel you want. Select the SCXI channel using SCXI_Single_Chan_Setup before calling this function. Refer to the Traditional NI-DAQ User Manual for PC Compatibles for more information on SCXI channel assignments.
Range: See the DAQ Device Analog Input Channel Settings topic.
gain is the gain setting to be used for that channel. This gain setting applies only to the DAQ device. If SCXI is used, you must establish any gain at the SCXI module either by setting jumpers on the module or by calling SCXI_Set_Gain. Refer to the DAQ Device Analog Input Channel Settings topic for valid gain settings. If you use invalid gain settings, Traditional NI-DAQ returns an error. Traditional NI-DAQ ignores gain for the LPM.
![]() |
Note If you want to supply a gain of 0.5, use the value -1. |
count is the number of samples to be acquired (the number of A/D conversions to be performed). The length of your data file in bytes should be exactly twice the value of count upon completion of the acquisition. If you have previously enabled pretrigger mode (by a call to DAQ_StopTrigger_Config), Traditional NI-DAQ ignores the count parameter.
Range: | 3 through 232 - 1 (except the E Series devices). |
0 through 232 - 1 (E Series devices). | |
2 through 224 - 3 (PCI-6110 and PCI-6111) count must be even. | |
2 through 224 (44XX devices). | |
2 through 232 - 1(45XX devices). |
07-22-2005 10:34 AM
sampleRate is the sample rate you want in units of points per second.
Range: Roughly 0.00153 pts/s through 5,000,000 pts/s. The maximum range varies according to the type of device you have and the speed and degree of fragmentation of your disk storage device.
concat enables concatenation of data to an existing file. Regardless of the value of concat, if the file does not exist, it is automatically created.
Range: | 0: Overwrite file if it exists. |
1: Concatenate new data to an existing file. |
DAQ_to_Disk initiates a synchronous process of acquiring A/D conversion samples and storing them in a disk file. DAQ_to_Disk does not return control to your application until Traditional NI-DAQ acquires and saves all the samples you want (or until an acquisition error occurs).
![]() |
Note If you are using an E Series device, apply a trigger you select through the Select_Signal or DAQ_Config functions to initiate data acquisition. If you are using all E Series devices, see the Select_Signal function for information about the external timing signals. If you do not apply the start trigger, DAQ_to_Disk does not return control to your application. Otherwise, DAQ_to_Disk issues a software trigger to initiate the DAQ operation. |
If you enable pretrigger mode, the sample counter does not begin counting acquisitions until you apply a signal at the stop trigger input. Until you apply this signal, the acquisition continues to write data into the disk file. Traditional NI-DAQ ignores the value of the count parameter when you enable pretrigger mode. If you do not apply the stop trigger, DAQ_to_Disk eventually returns control to your application because you eventually run out of disk space.
In any case, you can use Timeout_Config to establish a maximum length of time for DAQ_to_Disk to execute.