02-03-2014 12:51 AM
Hi, I am trying to generate a digital signal, as a spicific sample rate.
I.e, i have a digital pattern and i wis to output this pattern at various sampling rates. I would like toadjust the clock rate to do this, but when i try, it tells me I have to use an exteran clock ? i would like to output bool my_dig_pattern[100] at rates of 10 samples per sec up to 1000 samples per sec.
The same timing.configuresampleclock call works ok on analog out ?
The code
dataGenerationTask.Timing.ConfigureSampleClock("", (double)100, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, this.WFdata.totalSamples);
results in error -200303.
Is there anyway I can adjust the digital output rate ??
The burst digital out example generates and erro when trying to configure the clock so thats no help...
myTask.Timing.ConfigureHandshakingBurstExportClock(clockSourceTextBox.Text, (double)samplesClockRateNumericUpDown.Value, pauseTriggerCondition, activeLevel, pulsePolarity, SampleQuantityMode.ContinuousSamples, (int) samplesPerBufferNumericUpDown.Value);
Any help greatly appreciated
Thanks
02-03-2014 01:23 AM
Hardware is NI-USB-6259
02-03-2014 02:14 PM
Tom, you should try using a counter output as your digital output sample clock. You could then vary the frequency of the counter to change the frequency of your digital output.
Please see this forum thread for more information:
http://forums.ni.com/t5/Multifunction-DAQ/sample-clock-to-control-digital-output-rate/td-p/433300
02-03-2014 09:10 PM
Hi Rob,
Is there any sample code that you know of to do this ? I am not using labview.
Thanks
Tom
02-04-2014 09:19 AM
Tom, I understand that you are not using LabVIEW, the function calls and DAQ Tasks should be set up the same way though. I"ll take a look and see what I can dig up!
02-04-2014 09:20 AM
This resource may help in the meantime.
http://www.ni.com/white-paper/3167/en/
02-04-2014 09:22 AM
Thanks,
Appreciate it !
Regards,
Tom