LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate Multiple Frequency Signals and DC Signals with constant Update rate using NI-6723

I  would like to  generate Multiple Frequency Signals and DC Signals with constant Update rate using NI-6723

I have configured 24 channels of NI_6723 card  like below :-
 
Out of 24 channels, 19 channels are of  type  DC voltage and 5 channels of type Frequency

 Dev1/ao0:23  with Update rate as 500000

 
The below snippet shows the way I am configuring all 24 channels :-


Snippet :-
 
Channel s: Dev1/ao0:23
rate : - 500000
 
1.DAQmxCreateTask("Dev1/ao0:23",taskHandle);
2.DAQmxCreateAOVoltageChan(taskHandle,"Dev1/ao0:23","",-10.0,10.0,DAQmx_Val_Volts,NULL);
3.DAQmxCfgSampClkTiming(taskHandle,"",500000,DAQmx_Val_Rising,DAQmx_Val_ContSamps,500000);
5.DAQmxWriteAnalogF64(taskHandle,500000,0,10.0,DAQmx_Val_GroupByChannel,data,&written,NULL);
6.DAQmxStartTask(taskHandle);

After Configuring, I am writing the data array which consists of data for all 24 channels like below (each channel data being equally spaced at 500000) :-

7.DAQmxWriteAnalogF64(taskHandle,500000,0,10.0,DAQmx_Val_GroupByChannel,data,&written,NULL);

But when the step 7 executes the NI-6723 card generated an error which says

"DAC CONVERSION ATTEMPTED BEFORE  DATA TO BE CONVERTED WAS AVAILABLE, OR REDUCE OUTPUT BUFFER SIZE ..."

Please find the attachement for error message.

I am unable to understand where the problem exists. Would you help me?
 
Regards
krishna
0 Kudos
Message 1 of 2
(2,919 Views)
Hello Krishna,

The default behavior of the DAQmx driver is to wait until the AO buffer is empty before requesting more samples.  The error you see is probably due to data not being available right away to be written.  I would recommend  changing the transfer request condition so that more data is loaded into the buffer each time the memory is half full or less.  To do this you use
DAQmxSetAODataXferReqCond and the value is DAQmx_Val_OnBrdMemHalfFullOrLess.  You will want to set this property before the initial write to the buffer. 

Let us know if that does not resolve the problem.

Regards,
Micaela N
National Instruments
0 Kudos
Message 2 of 2
(2,901 Views)