LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed Step Frequency Function

Hello All,

 

I am trying to create a function that will allow for me to create a step frequency function dependent only on time. I would like to input certain frequency that Iwould like to relay to a function generator. These frequencies would be required to be sent to the function generator at certain time.

 

Ex.)

       Freq. 1 - 1 MHz

       Freq. 2 - 2 MHz

       Freq. 3 - 3 MHz

       Freq. 4 - 4 MHz

 

I would want Frequency 1 to occur from t = 0 to t<1 for a 4 second period

I would want Frequency 2 to occur from t = 1 to t<2 for a 4 second period

I would want Frequency 3 to occur from t = 2 to t<3 for a 4 second period

I would want Frequency 4 to occur from t = 3 to t<4 for a 4 second period

 

I would then like the sweep to continue until I hit the stop button.

 

I have been trying many different things, but am still having trouble with this funciton. If anyone know of any tips that would work, it would be great if you could point me in the right direction

0 Kudos
Message 1 of 2
(2,352 Views)

This sounds like it should be fairly straightforward thing to do with a counter/timer in pulse generation mode.  Unfortunately, it isn't.  

NI has not yet supported the ability to perform buffered variable-timing pulse generation with counters.  10 years have passed since I first starting asking for it, so I don't really hope for it any more.

 

However, there's another potential problem lurking here too.  Many of NI's DAQ boards will have a problem generating 3 MHz exactly.  The board clocks tend to max out at 80 Mhz and you can only generate integer divisors of that.  The closest you can get to 3.00 MHz will be with a divisor of 27 (or 26 if you need true square waves), producing a freq of 2.963 MHz (or 3.077 for square waves).

 

Part 2 of the answer: Exactly how precise must the frequencies and their durations be?  Because you *can* do this with a single counter / timer if you can accept the frequence error noted above *and* some imprecision in the durations due to software timing.  You can likely hit your 1.00 second duration targets to within <1% most of the time, though under Windows such timing will never be 100% reliable.

 

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(2,340 Views)