Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to adjust digital output rate using internal sample clock ?

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

0 Kudos
Message 1 of 7
(5,663 Views)

Hardware is NI-USB-6259

0 Kudos
Message 2 of 7
(5,659 Views)

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

 

Rob B
FlexRIO Product Manager
0 Kudos
Message 3 of 7
(5,650 Views)

Hi Rob,

 

Is there any sample code that you know of to do this ? I am not using labview.

 

Thanks

Tom

0 Kudos
Message 4 of 7
(5,643 Views)

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!

 

Rob B
FlexRIO Product Manager
0 Kudos
Message 5 of 7
(5,637 Views)

This resource may help in the meantime.

 

http://www.ni.com/white-paper/3167/en/

 

Rob B
FlexRIO Product Manager
0 Kudos
Message 6 of 7
(5,636 Views)

Thanks,

 

Appreciate it !

 

Regards,

Tom

0 Kudos
Message 7 of 7
(5,634 Views)