From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a pulse with the waveform generator?

Solved!
Go to solution

Hi,

 

I want to ask if anyone knows how to use the Elvis platform to generate a regulated pulse wave?

image.png

It should look roughly like the image above. A sine wave with regulation.

Anyone who can answer my question please reply to my post.

Thank you.

0 Kudos
Message 1 of 25
(12,427 Views)
Solution
Accepted by topic author w.joey

Are you using LabVIEW to generate the waveform or using the Soft Front Panels? In LabVIEW, you can use the Function Generator express VI and specify the Type as "Sine". Then, you only need to change the amplitude of the sine wave. During the actual pulse, the amplitude would be what you want (i.e 1 V) and during the time the pulse is inactive, set the amplitude to 0.

 

regulated_sine_fgen.png

 

If you are using the Soft Front Panels, you can use the Waveform Editor to create a waveform that includes a sine wave for the length of your pulse and then values of '0' for the rest of the time. Then, use that waveform in the Arbitrary Waveform Generator soft front panel. Just create a sine component as the first part of the waveform and then add another component at a DC Level '0' for the remainder.

 

regulated_sine_waveform.pngregulated_sine_arb.png

Donovan
0 Kudos
Message 2 of 25
(12,420 Views)

Hi,

 

Thank you for your reply.

If i were to use the waveform generator, how can i use it to generate the sine wave as shown in your reply?

I could not find information on how to create a waveform in the waveform editor.

0 Kudos
Message 3 of 25
(12,406 Views)

Hi,

 

Thank you for your reply.

If i were to use the waveform generator, how can i use it to generate the sine wave as shown in your reply?

I could not find information on how to create a waveform in the waveform editor.

0 Kudos
Message 4 of 25
(12,392 Views)

When you open the Waveform Editor, click on New Component, which will provide access to the function library. You can then choose a sine wave and set the amplitude, offset, frequency and phase. Then, create a new segment, followed by a new component, which is a DC Level function with an offset of zero. Then save the waveform and use it in the waveform generator.

Donovan
0 Kudos
Message 5 of 25
(12,379 Views)

Hi Donovan,

 

Thank you for your reply. I have managed to do that. But i wanted the waveform to have 40kHz. How much sampling should i have?

Even though i used to waveform editor to create a waveform with 40kHz, i connected it to the oscilloscope but it only has 1kHz. Why is that so?

After checking the waveform with the oscilloscope, if it works, if i were to send the generated waveform to the analog inputs, then how can i retrieve the information from LabVIEW or Elvis? I do not know where i can go to view the results from the analog inputs on the computer as well as on the LabVIEW control palette.

0 Kudos
Message 6 of 25
(12,374 Views)

Did you want the frequency of the sine wave contained in the waveform to be 40 kHz or the frequency of the entire output waveform to be 40 kHz?

Donovan
0 Kudos
Message 7 of 25
(12,371 Views)

Hi Donovan,

 

Thanks again for the reply. Can i have the answers to both cases?

0 Kudos
Message 8 of 25
(12,366 Views)

There are a couple things to consider when creating a waveform with the editor. The first is how many cycles of the sine wave you want in your waveform and the second is how many points per cycle are needed.

 

Effectively what the waveform editor does is create a wave with some number of discrete points. When you are creating a periodic component (a sine wave for example), there are 3 main controls to consider: Frequency of the wave, Sample Rate and Duration.

 

If you want to create a sine wave for a pulse, you first need to determine how many sine wave cycles you want in the pulse. The number of cycles will be approximately Duration * Frequency. So, if you wanted 10 cycles of a sine wave, you could have something like a duration of 1ms and a frequency of 10 kHz. If you only wanted one cycle, you would do something like 1 kHz for 1ms.

 

The second part is how many samples you want to use to represent these cycles. The number of samples stored in the waveform will be Duration * Sample Rate in the waveform editor. So, if you had a wave that lasted 1ms in the waveform editor and you wanted 125 samples, you would set the sample rate to 125 kHz. If you want 125 samples of a sine wave that contains 10 cycles, you could set Frequency to 1 kHz, Duration to 1ms and Sample Rate to 125 kHz. This waveform is then written to disk.

 

When you use the Arbitrary Waveform Generator, the rate at which these points are updated is based on the Update Rate in the soft front panel. So, really all the Arb knows is that you want to periodically output the samples saved in the file, it doesn’t know what settings you used to create the wave. If you use an Update Rate that matches what you had in the waveform editor (125 kHz), you will the same wave. It will be 10 cycles and take 1 ms to output the entire wave. However, if you set the Update Rate to 250 kHz, you will see that the frequency of the output waveform is now doubled. The 10 cycles will use the same points, but will now be written twice as fast so your cycles will complete in half the time.

 

So, to output your entire saved wave at 40 kHz, you would need to have an update rate equal to the total number of points in your wave times 40 kHz. In this case, it would be 125 * 40 kHz = 5 MS/s. That’s faster than the AO on an ELVIS II can go, so you would need fewer samples in your waveform to get that. However, to get the actual sine wave portion to output at 40 kHz, you would only need 125 samples (number of samples in the sine component) * 40 kHz /10 cycles = 500 kS/s, which the waveform generator can do.

 

The actual numbers you use for your calculation will be different because you will have extra samples in the wave that are just ‘0’, but the math will be the same. If you had 10 cycles of a sine wave for 1 ms and the same length of ‘0’ for your waveform at a sample rate of 125, you would have 250 total samples. However, to get the frequency of the sine portion of the pulse to be 40 kHz, you would still only need an update rate of 500 kS/s.

 

To check the output in LabVIEW, you can use the NI ELVISmx Oscilloscope express VI on the Measurement I/O»NI ELVISmx palette and create a graph indicator from the output, or you can use the DAQ Assistant express VI and configure it for analog input on the AI channels of the ELVIS II unit.

Donovan
Message 9 of 25
(12,356 Views)

Hi Donovan,

 

Thanks for your help.

I managed to get the waveforms accurately this time.

But i noticed i didn't get any reply on how to view the results on the analog inputs from Elvis II board with the Instrument Launcher or Labview.

It must have been missed because i wrote a huge chunk of words to you.

Please get back to me if you can.

 

Also, i got another issue as well.

I got this error image from trying to output result waveform 2 channels of the oscilloscope on Labview from Elvis II platform.

The results were fine on the oscilloscope from the Instrument Launcher.

Initially i didn't use the sequence structure, only did so after the error occurred. I tried to have time delay up to 10 seconds even but it doesn't work.

Please help me solve my issue. Thank you.

 

 

error 01.png

0 Kudos
Message 10 of 25
(12,346 Views)