LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generation and addition of two sin waves

Thanks
i am sending the vi. it generates two different
sin waves and after addition of these sin waves i am calling A0 write VI. i can also watch them on Oscilloscope. now my questions are?
1) i can only give one value of amplitude. i would like to give max and min value of amplitude each for both sin waves.
2)how can adjust that this program must run for some fixed time for example 20 hours, and then automatically stops. in which part i have to place the watch?
3) i want to calculate internally period for both of these generated sin waves. how can i calculate the period of a sin in the program and display in indicator.
i am using board AT-MIO-16XE-50
thanks again for any help
0 Kudos
Message 1 of 4
(2,894 Views)
see attached vi for items 1 and 2. you should be able to add the max and min by maipulating the amplitude and DC offset.


to calculate the period, you have to AI read the waves and monitor the peak to peak (zero crossings, or min to min), approximate the time (distance between the two), to get a meaurment of the period. You will probably have issues with noise.
0 Kudos
Message 2 of 4
(2,894 Views)
Thanks.
well i tried the above example,but i was not able to see the two combined waves on ossilloscope. i dont know why? the VI executes and does not give any error but no result on ossiloscope. some issues are not clear to me.
1) i would like to adjust the amplitude in mm and frequency in HZ in the controls of both sine waves.
2)The amplitude that i would like to give as a user in mm is internally converted to volts. for this internal conversion from mm to volts, i want another pull down menu. for example if i select a value 125 from this pull down menu, then it is equivalent to 10 volts and now for my sine wave when some value of amplitude, i give in mm. it will take this value and convert to volt internally according to the pull down selction of 125
mm/10 volts.
3)where should iuse AI read in order to calculate period of both sine waves independently.
as i am a beginner, and trying to learn, please give me an example.
regards
0 Kudos
Message 3 of 4
(2,894 Views)
make sure that the voltages generated and their sum do not go outside the range -10 to 10 (or 0 to 10) depending on the capability of the card. You may want to plot that to see.

2) you should use a curve (may be linear) to convert mm to volts (max mm and min mm should be converted to max V and min volt)

The frequency of the wave =
(# of cycles per buffer)(update rate)/(# of points per buffer).
Starting from frequency, set the others accordingly.

There are many examples that ship with labView for wave form generation and period measuremnt
0 Kudos
Message 4 of 4
(2,894 Views)