Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Normalizing frequencies

Has anyone used the Square Wave.vi?  I'm trying to generate a square wave with a 75% duty cycle at 244kHz.  For some reason I am not able to generate this.  The frequency input needs to be normalized.  Can someone please help me out.  Thanks.
0 Kudos
Message 1 of 10
(9,026 Views)

Hello Guy04,

Please see the following Knowledge Base which describes how to determine the actual output frequency of a waveform generation VI:
http://digital.ni.com/public.nsf/websearch/AD1739FDEDBE080886256DF9007B929A?OpenDocument

Does this answer your question?  Are you able to see the "signal out" on a waveform graph indicator in LabVIEW?  Are you able to output the signal from your hardware?  What hardware are you using to generate this signal?

Regards,
Sean C.

0 Kudos
Message 2 of 10
(9,017 Views)
Thank you. I'm now able to generate my frequency but, now what I need to do is generate an arbitrary sequence waveform...meaning generate my square wave multiple times and then have a time delay in which the waveform remains at TTL high and then does this loop over and over.  I'm using the PXI-5412.  I tried using the square wave by doing 100% duty cycle but I cannot get my exact ms delay since I cannot change the sample rate for this second half (the high portion of the wave).  The sample rate has to be the same for the square wave and the high wave. 
 
Thanks for your help.
0 Kudos
Message 3 of 10
(9,001 Views)

Hello Guy04,

If the Sample Rate must be the same for both portions of your arbitrary sequence waveform, then the length of the TTL high will be completely determined by the number of TTL High samples.

For example, if my sample rate is 1000 Hz, and I want to output a value of 5V for 500 ms, I would set the amplitude of my Square Wave.vi to 5, the duty cycle to 100%,  and the number of samples to 500 (frequency does not matter because of the 100% duty cycle).  If I wanted to output 5V for 600 ms, I would set the number of samples to 600.

The amount of time it will take to generate this portion of the waveform is determined by dividing the number of samples by the sample rate.

Please let me know if you have any further questions.

Regards,
Sean C.

0 Kudos
Message 4 of 10
(8,992 Views)
How can I do a more accurate delay, like say 9.98ms delay, because this method suggests that the delay be an integer multiple of the sampling rate?
 
 
0 Kudos
Message 5 of 10
(8,772 Views)

Hi Guy04,

Unfortunately, the best delay precision you can get is in integer multiple. The delay is calculated as a multiple of the sampling rate when you use the Square Wave.vi, therefore you cannot get to the millisecond range.

Regards,
Natasa
0 Kudos
Message 6 of 10
(8,721 Views)
You can use a higher sample rate (say, 5x the original sample rate) and multiply the number of samples you use in your waveforms by the same amount (again, 5x). This way each sample is shorter and you can deal with delays more precisely.
These devices have lots of memory and the waveforms are transferred through PCI/PXI very quickly, so in many applications the performance hit on your application for doing this is acceptable.

Hope this helps.

Marcos
Marcos Kirsch
Chief Software Engineer
NI Driver Software
0 Kudos
Message 7 of 10
(8,710 Views)

You can control your delay time by outputting a high waveform (fixed voltage level) for a specific number of samples.  At the maximum sample rate of the 5412 (100 MHz), each sample lasts for 10 ns.  There is a minimum quantum for the number of samples to generate of 4, so your resolution is actually 40 ns.  But instead of 100 MHz, let's say you run your sample clock at 100 kHz.  This would give you 40 us resolution.  So for your example of a 9.98 ms delay: You could generate 1000 samples (10 ms delay) or 996 samples (9.96 ms delay), but not 9.98 ms exactly.  But to solve that, just run at a faster sampling rate.  Of course a faster sampling rate will require a larger waveform for you main waveform signal, but even with the 8 MB option, you should have plenty of onboard memory.

Bottom line, you can easily create a delay between your signal generation with a resolution of 40 ns.

Neil F.

Modular Instruments Software 

Neil Feiereisel
Principal Engineer, Modular Instruments, National Instruments
0 Kudos
Message 8 of 10
(8,707 Views)

Hi Guy04

 

If you need a transition of a constant TTL level, there is no need to use the SquareWave.vi to create the waveform, especially if you need a specific time.  You can use a simple loop to create waveforms of any size.

 

Based on using the Arbitrary Sequence mode, just create a waveform of constant value.  The value (scaled 0 to 1) when taking into the account of the gain setting, will give the voltage you need at the output.

 

The number of samples will be determined by the minimum number of samples in the waveform, the quantum of 4, the sample rate, and the number of times you can loop the waveform.  (Consult your module’s specifications for the minimum number of samples, it will be based on your sample rate and trigger mode.) 

 

IE, based on a 10 MSps rate, I can use a 1000 sample rate looped 5,000 times to get 500 ms.  996 samples looped 5,000 times gives you 498 ms.  You can play with the number of loops as well.

 

Jerry

0 Kudos
Message 9 of 10
(8,705 Views)

I guess I was wrong.  My apologies for the confusion I have created with my previous post.

Regards,
Natasa
0 Kudos
Message 10 of 10
(8,692 Views)