03-22-2006 04:02 PM
03-23-2006 11:27 AM
03-28-2006 11:53 AM
Thank you for your help!
The method it's working just fine for an internal clock.
In my application I have to use external clock(100Hz to 10 kHz) to generate this signal.
In this case to have the frequency that I want at different clock frequency I am using an 10000 elements buffer and dependent on the clock frequency I am writing the number of values that I need.For this I choose to manually allocate the output buffer.
I am using a PCI-6229 acquisition board , Borland C++ Builder 6.0 and this is the code I am using to initialize the task:
ErrChk(DAQmxCreateTask("",&GenStim));
ErrChk(DAQmxCreateAOVoltageChan(GenStim, "/Dev1/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
ErrChk(DAQmxCfgSampClkTiming(GenStim,"/Dev1/PFI12",10000,DAQmx_Val_Rising, DAQmx_Val_ContSamps,1000));
ErrChk(DAQmxSetWriteRegenMode(GenStim, DAQmx_Val_DoNotAllowRegen));
ErrChk(DAQmxCfgOutputBuffer(GenStim,10000));
ErrChk(DAQmxWriteAnalogF64(GenStim, 10000,0,10,DAQmx_Val_GroupByChannel,AOBuffer, &written,NULL));
When the last line is executed I get an "Invalid Floating point operation".
If I change the value from 10000 to 1000 the application works fine, but for clock frequencies bigger than 1000Hz I need to write more than 1000 Values.
Any Help is Greatly Appreciated.
Bogdan Mitrea
03-28-2006 01:34 PM
03-28-2006 02:16 PM
Thank you for your quick answer.
I am using NI-DAQmx 8.0 and as it states in the knowledge base this issue must be fixed.
I am using this board for a while with NIDAQmx 7.4 up to 8.0 and Borland C++ and I never had any problems with it.It is true that this is the first time when I am trying to manually configure the output buffer.
The lib file that I am using was obtained from the standard NIDAQmx installation file after I applied coff2omf command to make it compatible with Borland C++.
I also tried the Borland compatible file that is available for download on your website but the effect is the same.
I will try that code in Visual C++ 2005 just to be sure that is nothing wrong with it.
Thank you again for your answer.
Bogdan Mitrea
04-03-2006 05:28 PM
04-04-2006 07:02 PM
Bogden,
I think the problem you are having, is exactly what you described. Unfortunately there is no way to dynamically change that buffer size during the acquisition on the fly, which is what you would need to fix that problem. So you will have to stop the task, resize it, and then start again. Hope that will work for you. -GDE