10-11-2015 07:04 PM
Not sure how to do this. Making a dual sine wave generator to output the sound to the computer output and display the two input sinewaves and the sum of the sine waves. I started with the Generate_Sound.vi and added a second sinewave generator. Alas the functionality is not quite what I need. When I run the VI with reset set to false I get a nice continous sounding output. The graphs update continually and the changes in frequency, amplitude and phase are displayed. So far so good.
I would like add a display that starts at 0 time and displays just the first n data points - whatever is shown on the existing graphs but that isn't updated unless one changes one of the controls. This display will be used for students to compare the phase relationship between the two sine waves. I can effectively do this by setting the reset input on the sinewave generator to true but this causes distortion - one can hear the clicks as the generator is reset. One click is okay but hearing it click repeatedly is a distractor.
Long story short I'm hoping someone might provide some guidance on how to best proceed to get a static display - do I need an oscilloscope vi? Is there such a thing? Any guidance, suggestions will be most appreciated.
Solved! Go to Solution.
10-11-2015 08:41 PM
You could make it so that the signals only reset when the phase value is changed. You can do that with a coup.le of feedback nodes and a little boolean logic.
Some other nodes.
1. You should just put all of the waveforms into a single graph. It will make it a lot easier to see what is happening.
2. Show the digital display on the sliders so you can have more accurate inputs.
10-12-2015 03:47 PM
Thank you for the suggestions. I put the two input waveforms on one graph but left the summed waveform on a separate graph. Otherwise it just apears too busy (at least to me. I also added the feedback looop for the phase controls and that does work to reset the sine wave generate vi's only when needed. Much better. However, I still have the problem that the displayed signal for channel one does not always start at the zero crossing point and it "moves" across the screen sso it is difficult for students to examine the relationship between the input signals ad the summed result. The work around is I can stop the signal by stopping the vi but this seems like a crude way to do things. So I'm still open as to suggestions on how to read and display say the first N points of the data. With an osilloscope would just be a single sweep with the trigger at zero volts on a positive slope. With LabView vi's it is nt so clear. Further suggestions, pointers or ideas?
10-13-2015 06:49 PM - edited 10-13-2015 06:51 PM
Hey Danl_B
If you put a case structure around your graphs, you can choose whether you want to update the graphs or not with a boolean. If you run continuously you shouldn't get the clicking noise, and you can simply turn the boolean off to freeze your graphs in their current state.
Take a look at my edit, and see if it fits your needs. In it's current state, this won't automatically update when a change is made to the inputs, but you could program an event structure (in a producer consumer fashion) to handle something like that rather than the boolean switch
10-13-2015 09:25 PM
DangerDave,
I couldn't open your VI as I'm still using V2013. But your suggestion of using a case structure worked quite well. Thank you for the suggestion. I was looking for something way more difficult. I'll also play with the event structure to see if an event - update and freeze will work a little more intuitively.
Many thanks to both you and crossruiz for the assistance.
DanlB
10-14-2015 09:42 AM - edited 10-14-2015 09:54 AM
Whoops. Sorry about that! Sounds like you already added my minor change, but just in case you want to take a look: