Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Change sample rate on NI9477 on the fly

I want to generate a continuous square wave on NI9477 and need to change the frequency of the square wave on the fly. Can this be done by changing the output sample rate? Are there any examples how it cane be done?

0 Kudos
Message 1 of 2
(5,274 Views)

E-team,

 

You really can't change your generation rate of your card without stopping the task and then restarting it. However, you can do things like generate at a higher rate and vary the waveform you are generating to change the appearance of the signal. For Instance:

 

Let's say you are generating at 1 kHz, and your waveform is 10101010, it would appear that you are generating a 500 Hz square wave. You could generate at 2 kHz and write 1100110011001100 and it would also appear as a 500 Hz square wave. Now, if you are generating at 2kHz and you have generated 1100110011001100 and you want to suddenly change the frequency of your output signal you can just start generating 1010101010 at the same 2kHz and it would now appear as though you have changed your output frequency, while in reality you have always been generating at 2 kHz.

 

As for examples, you could look at a non-regeneration example, where you are always writing new samples to the DAQ card.

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 2 of 2
(5,211 Views)