I'm trying to program an NI E series card to perform some analog output
at a very high frequency and seem to be running into unexplainable
problems, maybe you can answer the below question or forward it to
someone who might know?
I need to produce some very high frequency sounds, > 22KHz, and
would like to produce them at a sample rate well above Nyquist.
The E Series National Instruments card I working with begins to
malfunction when supplied with a high sample rate as a
parameter, but when given a low sample rate, say 24KHz, it works just
fine. The card is advertised as being able to sample at 200KHz.
I am using the exact algorithm as supplied in the manual:
WFM_Scale
WFM_Load
WFM_Rate(24000, ....... <---- here is where I supply my sample rate
WFM_ClockRate
WFM_Group_Control
I don't get any errors or crashes. A sample rate less than 24000 works fine, anything greater and it appears as if the card fails to output all the points in its buffer.
I can do this after WFM_Group_Control returns (which it does immediately as it is asynchronous) :
while(!wfmStopped)
WFM_Check(..... &pointsDone)
cout << pointsDone
I will always get a random number of points returned.
Measuring on a scope I see that the waveform is very short and always a random length/duration.
I believe the card is simply failing to complete the operation.
I traced the WFM_Rate function under different sample rate conditions, examing the return values for the UpdateTB and UpdateInt variables. I could confirm that the appropriate values required for using a faster clock were indeed set. So I don't know what else to do from here except buy a different AD card from another vendor.
Any help would be greatly appreciated.