LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generation of square wave by varying the amplitude at regular time intervals.

Can any one  help me by providing the LabVIEW code for generating the square waveform continuosly starting with the amplitude 1v(p-p). After starting generation of this signal, we need to keep on increase the amplitude at regular time intervals by 5mv. Frequency of the signal should be 10Hz.
0 Kudos
Message 1 of 15
(8,147 Views)
 

Hello Gamma ray,

You can use several methods to generate square waves.  Here I have used the Square Waveform.vi. 
Please take a look at the screenshot.  You can take a look at the function's help file to understand the inputs.

 



Message Edited by FieldKam on 03-18-2008 11:43 PM

Kameralina

Download All
0 Kudos
Message 2 of 15
(8,130 Views)

Dear sir,

Thank you so much for providing me the required information. But when I want to increase the amplitude for every 60sec/1min, I am facing some problems. I think I can overcome it by doing some modifications in the VI what U have sent it to me, but I am not that much efficient in doing that. So, I request you to please check it once with 60sec Time interval.

Problem is that I am unable to control the VI like unable to stop it by Stop button and my sytem processing is also becoming slow, for your information I ran that VI in LabVEIW 8.6 Evaluation. 

And also please suggest me the DAQ card to generate the same signal to real world.

 

Thanks and Regards

A.Giridhar Yadav.

0 Kudos
Message 3 of 15
(8,114 Views)

Hello Giridhar,

You can change the time interval at which the amplitude increases by typing in a value in the "Time Interval" control that I put on the Front Panel.  Please take a couple of moments to understand the Block Diagram, if you have any questions, please ask.

The output is a waveform, and conforms to what you have asked for.  The waveform is generating and graphed faster than real life time, but if you play with the graph you and look at the time axis, you will see that it is outputting what you are asking.  I am unclear what you mean when you say that you are not able to press the stop button?  If your system is becoming too slow, increase the Wait Time (ms) in the loop.

Since the frequency you are using is low, you can use just about any DAQ card with digital output. 

Take care!

 
Kameralina

0 Kudos
Message 4 of 15
(8,094 Views)

Hello sir,

Thanks for ur guidance.

Sorry to ask you one question, i.e. when I am setting the time for 60 sec. in time interval(s), the amplitude of the signal should increase after that 60 seconds. But in this VI the amplitude is changing instantaneously after the VI starts running, Why it is so? Initially the amplitude of the signal is 1v(p-p), after setting the time for 60 sec the amplitude sholud be 1v for first 60 sec after that the amplitude of the signal sholud increase to 1.005v(p-p) and so on. So, for every 60 sec I have to see the change, But here I am unable to get that one, So, to have this what should be the values of Time interval and wait milli sec. so, I request you to, in getting out this issue.

thanks and Regards

A.Giridhar Yadav.

0 Kudos
Message 5 of 15
(8,082 Views)
Hi Giridhar,

The amplitude is not actually changing instantaneously.  It may appear so because that is how fast the signal is being compiled and plotted, however, if you look at the time scale on the graph, you will see that the time is moving (being plotted) faster than real time.  The actual increase in amplitude does correspond to the properties that you have set.  I can assure you that if you take a look at the signal itself, ex output it on a card or view it in an array, you will get what you are looking for.




Kameralina

0 Kudos
Message 6 of 15
(8,058 Views)
Dear Fieldkam,
 
Thanks for your interest in this subject.
What should be done if I want to generate a sine wave in phase with the square wave what we had generated earlier. Will that be sufficient if I add Sine generation function in the loop?
Actually my requirement is to do Amplitude modulation, with the square wave as carrier signal and sine wave as the modulating signal. So, I request you to help me in getting out this. If possible send me the code.
0 Kudos
Message 7 of 15
(8,031 Views)

Hello,

Yes, you can add a sine generation function in the loop. 

If you are interested in amplitude modulation, then you may want to have a look at the NI Modulation Toolkit.




Kameralina

0 Kudos
Message 8 of 15
(8,012 Views)

Dear sir,

Thanks for your cooperation, here is an another query my professor named Ramareddy is facing, please look into this once.

Can anyone help in getting out this project, My project includes the acquisition and analysis of gamma rays. So, I require a DAQ card to acquire these gamma rays(pulses).
 
Coming to the characteristics of these pulses
 
1. Rise time of the pulse = 0.1micro second
2. Fall time (Decay time) = 1 micro second
3. Average pulse rate <= 5000 pulses/second.
4. Amplitude of the pulse will varying between 0 to 5V/(10V variable)
 
I am using Proportional counter for these pulses detection, these characterisitcs of the pulse are obtained only after signal conditioning what i had.
 
Analysis of these pulses include two processes
 
1. Pulse height Analysis.
2. Multichannel scalar(MCS).
 
 
1. Pulse height analysis
 
In this process spectrum of the acquired pulses should be constructed, which contains the peaks. After obtaining the spectrum, we need to select a gamma ray peak over certain amplitude interval. This is known as pulse height analysis and selection of peak. So, from this process pulses of 5v will be obtained which are spaced randomly.
 
2. Multi channel scalar(MCS)
 
In this process the pulses obtain from the pulse height analysis should be counted as a function of external variable in the MCS mode of operation.
In this MCS mode of operation, data(pulses) should be stored into 2000 channels (preset channel no's) by recording the data for 100micro seconds in each channel. This cycle should be completed in 1/10 second. The trigger pulse to start this experiment (MCS mode of operation for data logging) will also initiate a square wave for a period 10hz. The data should be collected for over 600 sweeps and should be filed as a seperate data set.
 
So, for this process to be done using LabVIEW I need the DAQ card details and the appropriate functions for the analysis. I request the person who is going to provide solution, please provide the details of DAQ card and the functions required.
 
Regards
A.Giridhar Yadav.
0 Kudos
Message 9 of 15
(7,998 Views)

Hi Gamma Ray,

I'd like to help you achieve your goal.

In order to acquire a signal with details on the order of 100 nanoseconds you will probably want a high speed digitizer, but I'd like to find out more about how accurate you need your measurements to be before making a specific suggestion.  What kind of voltage resolution do you need to achieve?  Is the shape of the pulse important to know?  How long does the pulse last, or does it decay immediately after it peaks?  Definitely start browsing our Digitizers/Oscilloscopes for your acquisition.  Let me know a few more details and I can help steer you in the right direction.

The pulse height analysis can be done by sorting the acquired data into bins and finding the number in each bin.  While there are no built-in LabVIEW functions that complete this process, you can definitely create an analysis function to quickly sort the data out and plot number vs. pulse height.

The MCS analysis confuses me a bit.  Are you simply looking to gather the voltage vs. time in 100 microsecond packets over the course of a given time period?  I'm also not clear on how the 10Hz square wave relates to this analysis step and also what the 600 sweeps are going over.  Some further explanation of this step would definitely help me give you a better idea of what you can do.

 
Regards,
John Bongaarts
0 Kudos
Message 10 of 15
(7,956 Views)