10-14-2005 12:45 AM
10-17-2005 11:38 AM
The command that you need is as follows. You can also find this information on the command by going to Start > All Programs > National Instruments > NI-DAQ > NI DAQmx Function Reference Help and searching for the command:Regards,
"DAQmxSetWriteRegenMode(TaskHandle taskHandle, int32 data);
"Data Type: int32
Description:
Specifies whether to allow NI-DAQmx to generate the same data multiple times.
If you enable regeneration and write new data to the buffer, NI-DAQmx can generate a combination of old and new data, a phenomenon called glitching.
"Valid values:
- DAQmx_Val_AllowRegen - 10097
Allow DAQmx to regenerate samples that the device previously generated. When you choose this value, the write marker returns to the beginning of the buffer after the device generates all samples currently in the buffer.
- DAQmx_Val_DoNotAllowRegen - 10158
Do not allow NI-DAQmx to regenerate samples the device previously generated. When you choose this value, NI-DAQmx waits for you to write more samples to the buffer or until the timeout expires.
"You can get/set/reset this property using:
DAQmxGetWriteRegenMode
DAQmxSetWriteRegenMode
DAQmxResetWriteRegenMode"
If you can use LabVIEW there is already an existing example online: DAQmx - Continuous Reconfigurable Waveform Generation Using Non-Regeneration
Block Diagram Steps:
1. Create an Analog Output Voltage channel.
2. Configure the task to prohibit the automatic regeneration of data.
3. Call the DAQmx (Sample Clock) VI to set the sample clock rate. Additionally, set the sample mode to Continuous.
4. Read the actual sample clock rate (eventually coerced depending on the hardware used).
5. Compute the desired waveform, using the buffer size and the actual update rate. This VI keeps track of the phase of the waveform to ensure that the generated signal is continuous.
6. Write the waveform to the output buffer.
7a. Call the Start VI. This is only needed when the loop is executed for the first time.
7b. Do nothing.
8. Loop continuously until user presses the Stop button. Every iteration computes and writes a new waveform to the buffer.
9. Call the Clear Task VI to clear the Task.
10. Use the popup dialog box to display an error or warning if any.